Development

No More Aquariums or Zoos For Me

FeuerThoughts - Tue, 2016-09-06 10:05
I just finished reading Carl Safina's Beyond Words. It is the latest of a number of books (another great one is Out on a Limb by Ben Kilham) I have read that make it clear beyond any reasonable doubt that the individuals of many, many other species, including bears, octopuses, gorillas, chimpanzees, bonobos, crows, are turtles are self-aware; feel pain, sadness, joy; fear death; play; have individual personalities; work with tools; on and on and on.

In other words, they are no different from us. Except that their bodies have adapted to different circumstances, resulting in different body plans, different capabilities, different ways of manifesting their thoughts.


Yet we enslave them, control their reproduction, abuse and torture them, outright kill them en masse.

It is impossible to live in "civilization" without being at least complicit with much of this destruction (just imagine for a moment the thousands of factories that are needed to put a cell phone in your hands). 

It is, therefore, impossible not to sound like a hypocrite when expressing such thoughts.

Well, fine. Being a hypocrite is better than being an "all-in" abuser. 

And while I am not yet at the point in my life at which I can say goodbye to cars and cell phones, there are things I can do to minimize my hypocrisy and avoid overt support to human devastation of others.

Which brings me to zoos and aquariums. 

I can't do it anymore. I can't wander around exhibits, whether indoors or out, whether spacious or cramped, whether "humane" or neglectful, that restrain animals that should be living free. The justifications for these exhibits fall flat, sound weak and defensive. 

And if you do find any of them even slightly persuasive, simply substitute "Ota Benga" for "elelphant" or "stingray" and see how it "reads."

I do not look forward to the next time my family - my granddaughters! - wants to go to the aquarium or zoo, and I have to say "No thanks, you go without me."

But that's what I will be doing.


Categories: Development

Why Do Some Companies Have Teams with People from Multiple Contracting Companies?

Complete IT Professional - Mon, 2016-09-05 06:00
Do you work for a company that hires contractors? Have you ever wondered why they use several companies instead of just going to one company for all of their work? This happens quite often, so i wanted to explain why it happens. Why would this be good to know? If, like me, you work for a contracting company, it’s good to […]
Categories: Development

Oracle TO_LOB Function with Examples

Complete IT Professional - Thu, 2016-09-01 14:05
The TO_LOB function is an Oracle conversion function. Learn what it is and see some examples in this article. Purpose of the Oracle TO_LOB Function The purpose of the TO_LOB function is to convert LONG or LONG RAW values to LOB values.   Syntax The syntax of the TO_LOB function is: TO_LOB ( long_value ) […]
Categories: Development

Oracle LOCALTIMESTAMP Function with Examples

Complete IT Professional - Thu, 2016-09-01 06:00
In this article, I’ll explain what the Oracle LOCALTIMESTAMP function does and show some examples. Purpose of the Oracle LOCALTIMESTAMP Function The LOCALTIMESTAMP function will return the current date and time of the session time zone. This means it’s likely in the time zone that you’re located in (as opposed to the server time zone). […]
Categories: Development

What Does Oracle PARTITION BY Do?

Complete IT Professional - Mon, 2016-08-29 06:00
Have you ever seen the PARTITION BY keyword used in Oracle queries? If so, do you know what it does and how to use it? Learn about the Oracle PARTITION BY keyword and see some examples in this article. What is the Oracle PARTITION BY Keyword? PARTITION BY is a keyword that can be used […]
Categories: Development

Oracle ASCIISTR Function with Examples

Complete IT Professional - Thu, 2016-08-25 16:17
In this article, I’ll explain what the Oracle ASCIISTR function does, and show you some examples. Purpose of the Oracle ASCIISTR Function The ASCIISTR function converts a string in any character set to a string in the database character set. If there are any characters that are not ASCII, they are converted to a format […]
Categories: Development

Oracle DBTIMEZONE Function with Examples

Complete IT Professional - Thu, 2016-08-25 06:00
In this article, I’ll explain what the Oracle DBTIMEZONE function does, and show you some examples. Purpose of the Oracle DBTIMEZONE Function The DBTIMEZONE function returns the timezone offset of the database, in the format of [+|-]TZH:TZM, or a time zone region name. It’s helpful when working with dates to know what timezone the database […]
Categories: Development

The Madness of the Modern Human

FeuerThoughts - Tue, 2016-08-23 17:13
"I eat using Uber-Eats.I push a button, the food is made, the driver delivers it to me. But when it's fully autonomous, how does the food actually get to my door? There's a tech stack that can get the car through the physical world to my doorstep, but then what? Does some robot get out of my car and deliver my food? That's hard. I don't know if that's two decades out, but the point is the physical world is getting wired up fast."
As you might guess, that is a quote from Uber's Mad CEO, Something-or-Other Kalanick. A unicorn billionaire who first wants to push taxi cab drivers to poverty, replacing them with "gig" contractors, who will then (in not too many years) be replaced by driverless cars.

Seriously, what is wrong with us? With the oceans crashing against our coastal cities, the planet warming, the poles melting, the forests being razed, the Sixth Extinction well in progress, can we still be so madly obsessed with using technology in the most absurd, energy-consuming, convenience-crazed ways?

A driverless car brings the food to my building "but then what?"

BUT THEN WHAT? How about getting your big fat ever spreading butt out of your Lazy-Boy and answering the damn door yourself, maybe even walking outside to a neighborhood restaurant and partaking in a meal around others?

Silly, sad humans.
Categories: Development

Getting ready your EM12cR5 system with latest Patches for Exadata Management

Arun Bavera - Tue, 2016-08-23 10:00
As of Aug 2016 these are the latest Patches Needed:

For OMS side:
PSU (12.1.0.5.160719)    Note 2158181.1 Patch 23087400 ( latest PSU)
OMS System side Monthly bundle patch – OMS Patch 23741465 ( jul2016)

For Agent side:
Agent Core System Patch: 23639986
Agent DB 12.1.0.8.0 Discovery Patch: 22135601
Agent DB 12.1.0.8.0 Monitoring Patch: 23517257
Agent FMW 12.1.0.8.0 Discovery:  23217959
Agent FMW 12.1.0.8.0 Monitoring: 23741311

EM for Exadata Plug-in  12.1.0.6.160731
Agent Exadata 12.1.0.6.0 Monitoring: 23639890
Agent Exadata 12.1.0.6.0 Discovery:  20844924

Use the EM Patch capability to create a Patch plan and apply these patches (agent side only):



Automating the Agent Side Patching
If you want to automate applying these patches for every new agent and plugin deployment follow this process:
Install the above agent side patches on any one of the agent. Use this as Golden Template and use Clone feature to deploy the further agent. ( Each GoldenTemplate for each platform)
OR
Step 1: Copy the Agent Sytem Patch to: $OMS_HOME/install/oneoffs/<agentversion>/<platform>
For Example:
cd /u01/app/oracle/middleware/oms/install/oneoffs/12.1.0.5.0/Generic
ls -ltr
total 19987
-rw-r--r-- 1 emuser oinstall 20383932 Aug 23 10:36 p23639986_121050_Generic.zipStep2: Create the custom plugin out of the above any one Golden Agent, to bake the patches in the default plugins:
Database Custom Plugin creation:
emcli create_custom_plugin_update -agent_name="mysystem.com:3872" -plugin_id="oracle.sysman.db" -overwrite
FMW Custom Plugin creation:
emcli create_custom_plugin_update -agent_name="mysystem.com:3872" -plugin_id="oracle.sysman.emas" -overwrite
Exadata Custom Plugin creation:
emcli create_custom_plugin_update -agent_name="mysystem.com:3872" -plugin_id="oracle.sysman.xa" -overwrite
Verify the patches:
emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.db" 
emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.db" -discovery

emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.emas" 
emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.emas" -discovery

emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.emas" 
emcli list_patches_in_custom_plugin_update -plugin="oracle.sysman.xa" -discovery


Now, any new agent deployed from console or emcli, even though you forget to use clone feature will make sure the latest Agent System patches are picked up from default patch locations and plugins deployed will make sure the patches contains for plugins as they are the default plugins now.

References:
Applying Enterprise Manager Recommended Patches (Doc ID 1664074.1)
Oracle Recommended Patches (PSU) for Enterprise Manager Base Platform (All Releases) (Doc ID 822485.1)
Document 2038446.1 - Enterprise Manager 12.1.0.5.0 (PS4) Master Bundle Patch List
Enterprise Manager Cloud Control 12c Recommended Plug-Ins and Patches for Database as a Service (DBaaS) (Doc ID 1549855.1)         
Enterprise Manager for Exadata 12.1.0.6.0 Bundle Patch Bug List (Doc ID 1929659.1)
Patch Requirements for Setting up Monitoring and Administration for Exadata (Doc ID 1323298.1)
http://oraforms.blogspot.ca/2014/05/oracle-em12c-release-and-patch-schedules.html
https://blogs.oracle.com/oem/entry/simplified_agent_and_plug_in
Categories: Development

65 Business Jargon Phrases to Stop Using and What Do Use Instead

Complete IT Professional - Mon, 2016-08-22 06:00
If you’ve worked in an office for any length of time, you’ve probably heard one of these phrases. A phrase that makes no sense at all unless you explain it. A word that is used by management in not quite the correct way. A sentence that has a bunch of words but doesn’t really say […]
Categories: Development

Oracle TO_NCLOB Function with Examples

Complete IT Professional - Fri, 2016-08-19 06:00
The Oracle TO_NCLOB function is a simple function and is used for conversion. Learn what it does and see some examples in this article. Purpose of the Oracle TO_NCLOB Function The purpose of the TO_NCLOB function is to convert a value from a LOB to an NCLOB value. You may not use it very often, […]
Categories: Development

Oracle TO_CLOB Function with Examples

Complete IT Professional - Thu, 2016-08-18 06:00
In this article, I’ll take a look at the Oracle TO_CLOB function, and show you some examples. Purpose of the Oracle TO_CLOB Function The TO_CLOB function converts a value in an NCLOB column (the national character set) to a CLOB (in the database character set).   Syntax The syntax of the TO_CLOB function is quite […]
Categories: Development

5 Stages of the Software Development Cycle

Complete IT Professional - Mon, 2016-08-15 16:46
This is a guest post by Saurab Prabhakar. The Software Development Lifecycle (SDLC) defines a revolution. It is fundamentally a sequence of steps that display a model for the development and lifecycle management of certain software or even an application. The procedure can differ from business to business, but the standards remain firm. The software development […]
Categories: Development

Oracle STDDEV Function with Examples

Complete IT Professional - Fri, 2016-08-12 06:00
Have you ever seen the Oracle STDDEV function? In this article, I’ll explain what the STDDEV function does and show you some examples. Purpose of the Oracle STDDEV Function The purpose of the STDDEV function is to find the standard deviation of a set of numbers. The standard deviation is a mathematical concept, which is […]
Categories: Development

Oracle BFILENAME Function Explained with Examples

Complete IT Professional - Thu, 2016-08-11 06:00
The Oracle BFILENAME function is a useful file manipulation function. Learn what it is and how to use it in this article. Purpose of the Oracle BFILENAME Function The BFILENAME function returns an object called a “BFILE locator” from a specified directory and filename. This function is often used in PL/SQL to access the data […]
Categories: Development

Why Asking Myself How To Add Value At Work Is The Best Thing I’ve Done This Month

Complete IT Professional - Mon, 2016-08-08 06:00
I’ve been doing something at work which has been getting great results. I only started doing a lot of it a few weeks ago. But, I’ve had a few people notice, and I can see the positive impact it’s having on the team. I want to share it in this article so you can try […]
Categories: Development

Installing SQLcl on OEL/RHEL

Dimitri Gielis - Thu, 2016-08-04 16:55
In my previous post I talked about how SQLcl came in handy to work with JavaScript against the database.

The installation of SQLcl is easy... you just download the zip, unpack and run the executable.

But to be fair, before I got SQLcl running (especially the script part) I encountered a number of issues, so hopefully this post helps you be able to run SQLcl with all features in minutes as it's meant to be :)


Those were the error messages I received when running sql (script):

javax.script.ScriptException: sun.org.mozilla.javascript.EvaluatorException: Java class "java.util.ArrayList" has no public instance field or method named "0".

javax.script.ScriptException: sun.org.mozilla.javascript.EcmaError: ReferenceError: "Java" is not defined. (#1) in at line number 1

The solution for me was to upgrade my Java version to Java 8.

Here're the steps on my OEL/RHEL system to upgrade Java:

$ cd /opt

$ wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.tar.gz"

$ tar xzf jdk-8u102-linux-x64.tar.gz 

cd jdk1.8.0_102/

alternatives --install /usr/bin/java java /opt/jdk1.8.0_102/bin/java 2
$ alternatives --config java

There are 5 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   3           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 4           /usr/java/jre1.8.0_101/bin/java
   5           /opt/jdk1.8.0_102/bin/java

Enter to keep the current selection[+], or type selection number: 5

$ alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_102/bin/jar 2
$ alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_102/bin/javac 2
$ alternatives --set jar /opt/jdk1.8.0_102/bin/jar
$ alternatives --set javac /opt/jdk1.8.0_102/bin/javac
$ java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)


$ export JAVA_HOME=/opt/jdk1.8.0_102
export JRE_HOME=/opt/jdk1.8.0_102/jre
$ export PATH=$PATH:/opt/jdk1.8.0_102/bin:/opt/jdk1.8.0_102/jre/bin

Now when running SQLcl everything worked like a charm. Hurray :)

Categories: Development

Oracle SESSIONTIMEZONE Function with Examples

Complete IT Professional - Thu, 2016-08-04 06:00
In this article, I’ll explain what the Oracle SESSIONTIMEZONE function is, and show you some examples. Purpose of the Oracle SESSIONTIMEZONE Function The SESSIONTIMEZONE function returns the timezone offset of your session, in the format of [+|-]TZH:TZM, or a time zone region name. This can be helpful to know, especially if you’re doing a lot of […]
Categories: Development

SQLcl to the rescue when the Database and APEX fail (with JSON limitations)

Dimitri Gielis - Wed, 2016-08-03 17:29
In the last two years I've been using JSON in almost every project I was involved in.
For example with APEX Office Print our plugin is sending JSON to the backend. This JSON you can actually see yourself in the Remote Debug screen in your AOP Dashboard.
Another example is the wearables project (IoT) I showed at KScope 16; the wearable is sending data to a smartphone or tablet, which in his turn is doing a call to our backend (in ORDS) and sending JSON across.

At the end of the day we want the data in the Oracle Database, so our APEX apps can work with that data.

Since Oracle DB 12c, JSON is supported straight from the database. I wrote a number of blog posts how to read JSON from SQL within the database. Here's a quick demo of JSON in the database:

SQL> create table tbl_with_json (
  2    json_clob  clob, 
  3    constraint json_clob_chk check (json_clob is json)
  4  );

Table TBL_WITH_JSON created.

SQL> 
SQL> insert into tbl_with_json (json_clob) values ('{
  2      "items": [{
  3          "client_id": -1,
  4          "registration_date": "2016-07-29T07:46:09.941Z",
  5          "question": "My Question",
  6          "description": "My huge clob"
  7      }]
  8  }');

1 row inserted.

SQL> 
SQL> select a.json_clob.items.question as question, a.json_clob.items.description as description 
  2    from tbl_with_json a;

QUESTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
DESCRIPTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
My Question                                                                                                                                                           
My huge clob                                                                                                                                                          




Now the reason of this blog posts: what if your JSON contains some very big text (>32K) in a single node e.g. in the description field? 

If you want to follow along in your own test case, open the description record in SQL Developer for example and past a large text (>32K) in the description node (so replace "My huge clob" with some other big text). Tip: For my test cases I typically use a Lorem Ipsum generator where I can specify the number of characters for example 33000 characters.



How can we parse this JSON and store for example the content of that in a CLOB field?

As I'm on 12c, should be simple right? The database is supporting reading JSON from SQL, so I first tried with JSON_TABLE, but there you can only define VARCHAR2 or NUMBER as data type, no CLOB, so went with VARCHAR2.

Here's the result:

SQL> select jt.question, jt.description
  2    from tbl_with_json, 
  3         json_table(json_clob, '$.items[*]'
  4           columns (
  5             question     varchar2 path '$.question',
  6             description  varchar2 path '$.description'
  7           )
  8*        ) as jt;

QUESTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
DESCRIPTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
My Question                                                                                                                                                           
                                                                                                                                                                      


Oracle just returns null (nothing - blank) for the description!

But it's definitely not blank:



Next I tried the query like in my initial example, but the result was the same:

SQL> select a.json_clob.items.question as question, a.json_clob.items.description as description 
  2    from tbl_with_json a;

QUESTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
DESCRIPTION
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
My Question                                                                                                                                                           
                                                                                                                                                                      


So the database will return a value when there's less than 4K (or possibly 32K depending the setting of your varchar2 size in the database) and it returns null when it's over this limit.

Hopefully Oracle Database 12.2 fixes this issue, but at the moment there's no native way to get to that data by using the Oracle supplied JSON functions.

Ok, what can we try next?...

Since Oracle Application Express 5, APEX comes with a very nice package to work with JSON, APEX_JSON. This package has been heaven for us, especially with AOP.
So I thought to try to use the APEX_JSON.PARSE and store it in a temporary JSON so I can read it with the get_clob_output method:

SQL> declare
  2    l_data clob;
  3    l_json apex_json.t_values;
  4    l_return clob;
  5  begin
  6    select json_clob
  7      into l_data
  8      from tbl_with_json;
  9    apex_json.parse(l_json, l_data) ;
 10    apex_json.initialize_clob_output(dbms_lob.call, true, 0) ;
 11    apex_json.open_object;
 12    apex_json.write(l_json, 'items[1].description') ;
 13    apex_json.close_object;
 14    l_return := apex_json.get_clob_output;
 15    apex_json.free_output;
 16  end;
 17  /

Error starting at line : 1 in command -
declare
  l_data clob;
  l_json apex_json.t_values;
  l_return clob;
begin
  select json_clob
    into l_data
    from tbl_with_json;
  apex_json.parse(l_json, l_data) ;
  apex_json.initialize_clob_output(dbms_lob.call, true, 0) ;
  apex_json.open_object;
  apex_json.write(l_json, 'items[1].description') ;
  apex_json.close_object;
  l_return := apex_json.get_clob_output;
  apex_json.free_output;
end;
Error report -
ORA-20987: Error at line 6, col 18: value exceeds 32767 bytes, starting at Lorem ipsum dolor sit amet, consectetuer adipiscin
ORA-06512: at "APEX_050000.WWV_FLOW_JSON", line 928
ORA-06512: at "APEX_050000.WWV_FLOW_JSON", line 993
ORA-06512: at line 9

But as you can see, there's a limit in there as well. So APEX 5 doesn't return null, but it returns an error. Hopefully a future version of APEX removes this limit ;)


When I work with data, I prefer to do it straight in the database, but now I was stuck. At those moments you have to go for a walk, get some sleep and talk to others to get more ideas... My preferred development languages (in this order) are APEX, SQL, PL/SQL, JavaScript, Node.js, ... (and then all others)

Then I remembered a blog post of Kris Rice that SQLcl has the ability to run JavaScript too because  SQLcl includes Nashorn (A Next-Generation JavaScript Engine for the JVM). So after looking at some SQLcl script examples, I wrote my own little SQLcl script that reads out the clob and puts it in a variable "content":

SQL> script
  2     var Types = Java.type("java.sql.Types")
  3     var BufferedReader = Java.type("java.io.BufferedReader")
  4     var InputStreamReader = Java.type("java.io.InputStreamReader")
  5     
  6     var GET_CLOB = "declare " + 
  7                    "   l_clob CLOB; " + 
  8                    " begin " + 
  9                    "   select json_clob " + 
 10                    "    into l_clob " + 
 11                    "    from tbl_with_json; " +
 12                    "   ? := l_clob;" + 
 13                    " end;"; 
 14  
 15     var cs = conn.prepareCall(GET_CLOB);
 16     cs.registerOutParameter(1, Types.CLOB);
 17     cs.execute();
 18     var clob = cs.getClob(1);
 19     cs.close();
 20  
 21     var r = new BufferedReader(new InputStreamReader(clob.getAsciiStream(), "UTF-8"))
 22     var str = null; 
 23     var content = "";
 24     while ((str = r.readLine()) != null) { content = content + str; }
 25     ctx.write(content);
 26  /
{ "items": [{ "client_id": -1, "registration_date": "2016-07-29T07:46:09.941Z", "question": "My Question", "description": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fring

So the above reads the content of the clob which contains the JSON.
As we are in JavaScript I thought we can parse this JSON and navigate to the description field. Once we have it we store it in another table or do whatever we want with it.
Cool if it would work, no? And it did! :)

So lets finish this example. First we create a table to store the description field (the very big text).

SQL> create table tbl_with_description (description clob);

Table TBL_WITH_DESCRIPTION created.


Here's the final script that will store the description node to another table :
- the ctx.write calls are there to send debug output
- the obj.items[0].description is how we get to the description node and we store that in a bind variable and execute another insert statement to save the description value:

SQL> script
  2  
  3  try {
  4     var Types = Java.type("java.sql.Types")
  5     var BufferedReader = Java.type("java.io.BufferedReader")
  6     var InputStreamReader = Java.type("java.io.InputStreamReader")
  7     
  8     var GET_CLOB = "declare " + 
  9                    "   l_clob CLOB; " + 
 10                    " begin " + 
 11                    "   select json_clob " + 
 12                    "    into l_clob " + 
 13                    "    from tbl_with_json; " +
 14                    "   ? := l_clob;" + 
 15                    " end;"; 
 16  
 17     var cs = conn.prepareCall(GET_CLOB);
 18     cs.registerOutParameter(1, Types.CLOB);
 19     cs.execute();
 20     var clob = cs.getClob(1);
 21     cs.close();
 22  
 23     var r = new BufferedReader(new InputStreamReader(clob.getAsciiStream(), "UTF-8"))
 24     var str = null; 
 25     var content = "";
 26     while ((str = r.readLine()) != null) { content = content + str; }
 27     //ctx.write(content);
 28  
 29     var obj = JSON.parse(content);
 30     ctx.write("Question: " + obj.items[0].question + "\n");
 31     ctx.write("Description: " + obj.items[0].description + "\n");
 32  
 33     var binds =  {};
 34     binds.description = obj.items[0].description;
 35  
 36     var ret = util.execute("insert into tbl_with_description (description) values (:description)", binds);
 37  
 38     if (ret) {
 39       ctx.write("Insert done!\n");
 40     } else {
 41       ctx.write("Error :(\n");
 42       var err = util.getLastException();      
 43       ctx.write("\nERROR:" + err + "\n");  
 44     }
 45  
 46  } catch(e){
 47      ctx.write(e +"\n")
 48      e.printStackTrace();
 49  }
 50  
 51  /
Question: My Question
Description: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis ... eu,
Insert done!


Testing:

SQL> select count(*) from tbl_with_description;

  COUNT(*)
----------
         1

SQL> select substr(description,1,50) from tbl_with_description;

SUBSTR(DESCRIPTION,1,50)                                                        
--------------------------------------------------------------------------------
Lorem ipsum dolor sit amet, consectetuer adipiscin                              

SQL> 

I was blown away by this... and I see a lot of potential be able to run JavaScript against the database.

There's actually a way to load Nashorn in your database too, so you can do JavaScript, Node.JS etc. straight from your database. Nashorn came with Java 8, but it should run in Java 7 too, now the default version of Java in the Oracle Database is 6, so there're some extra steps to do to get it to work. Running JavaScript from the database is something I've on my list to do R&D in and I actually submitted an abstract to KScope17 where I will present my results on this topic (if it gets accepted!) :) 

So to recap this (longer) blog posts:
1) JSON is being used a lot these days and having the possibility to work with JSON in the Oracle database is very nice, but as we have seen in the above example, it can't do everything yet. It has a real issue with large nodes.
2) Knowing other languages and thinking out-of-the-box might come in handy; I would even say that JavaScript becomes more and more important for an APEX developer.
3) SQLcl is a great tool, if you don't use it yet, I would definitely recommend looking into it. 
4) Oracle Nashorn opens up an entire new set of possibilities.

In the last paragraph of this blog post I want to thank Kris Rice for his help understanding SQLcl script. Although there are many examples, it took me some time to get going and I did struggle to understand how to get to error messages for example. Although it's mostly JavaScript in the script, having some Java knowledge makes it easier. Time to refresh that a bit, it has been 15 years ago I did some real Java coding.

Hope this blog post will help you work with JSON and JavaScript within an Oracle context.
Categories: Development

Oracle 12c New Features for Developers

Complete IT Professional - Mon, 2016-08-01 06:00
Oracle 12c is Oracle’s latest version of their database engine. Learn about all of the new Oracle 12c new features for developers in this massive guide. Introduction Oracle 12c comes with a range of new features. Many of these features are great improvements for developers, and some of them are more focused on database administrators. […]
Categories: Development

Pages

Subscribe to Oracle FAQ aggregator - Development