Kris Rice

Subscribe to Kris Rice feed
Educating developers on what Oracle tools and products our team makes, hopefully.
Updated: 15 hours 12 min ago

SQLcl custom Input prompt and validations

Wed, 2016-11-30 18:14
Another quick twitter inspired blog post inspired by the SQLcl account itself. Asked and answered: Do you support the ACCEPT command? YES. pic.twitter.com/NchmQ6Eegs — SQLcl (@oraclesqlcl) November 29, 2016 ACCEPT is a great way to get input but validation has to happen elsewhere as there's no hooks to do something like validate a number in a range without running a sql or plsql that does

ECMA Script 6 / Nashorn / Java 9 and SQLcl

Thu, 2016-11-17 08:57
This blog post brought to you by the letter M as in Martin . Follow @martindsouza . He asked me on twitter if SQLcl via Nashorn could use ECMA Script 6 features yet.  The answer is yes.  So, for the brave that want to try out the latest greatest ECMA Script 6 features it can be done with SQLcl. This is a good reference for what's in version 6 that could be useful.  The only caution is not

Import APEX apps now easier with SQLcl

Wed, 2016-11-16 14:28
Hopefully by now everyone knows there's the ability in SQLcl to use Javascript and the same javascript can be used to make custom commands extending what SQLcl offers out of the box. Also, I hope everyone knows we are posting examples of this to github as a base for anyone to learn and try it out.  Just in case here's the link to the GitHub location https://github.com/oracle/oracle-db-tools/tree

SQLcl as a library in existing programs

Tue, 2016-11-15 10:34
I got a question over the weekend if SQLcl could be leveraged as library from inside a Jython program. This may seem like it's the same thing as adding jython to SQLcl to use instead of Javascript but it's a significant difference. This method allows for the use of SQLcl in any existing program. That means when the program needs to interact with the database, all the code in SQLcl that is tried

Adding Reserved command in SQLcl

Mon, 2016-11-14 08:27
I saw Stephen's example of checking reserved words in the database from Vertan's day and figured I'd do the same in SQLcl. #595 #plsql Is it a reserved word? PL/SQL procedure to help you sort that out. Dyn PLSQL example! @oraclelivesql https://t.co/M10kVnsQ3y pic.twitter.com/XFFHOVzNCK — Steven Feuerstein (@sfonplsql) November 11, 2016 Checked if something is reserved seems like a nice add

Export APEX application with SQLcl

Mon, 2016-10-10 19:23
APEXExport has been around a long time for exporting an application and anything else like images, feedback,websheets,.. into a file system so that they can be version controlled.  This is a must if there is ever a need to rollback or see what the application was X days ago.  This is a java program that is part of the apex distribution.  The catch for some folks is that it's a java program and

ORDS 3.0.7 more secure by default

Wed, 2016-09-28 10:50
Defaulting  PL/SQL Gateway Security Oracle REST Data Services 3.0.7 went out yesterday.  There's an important change that went in to better secure installations by default.  It has always been the case that we recommend customers set the validations for the plsql gateway.  There has always been a validation configuration option to lock down what procedures are accessible which was outlined in

Kill DB sessions the easy way with SQLcl

Wed, 2016-06-22 14:37
Seems I can not tweet these animated GIFs anymore. So this is another very short blog post to show real case for adding a new command into SQLcl which can be downloaded here. It's hard annoying tedious to find SID and SESSION then alter to kill that when needed.  What if there was a simple kill command. Here a sample one that takes in the 2 options:   kill sid serial#   Example :   kill 1 2 OR

SQLcl and Query Change Notification

Thu, 2016-06-16 12:23
The database has had Query Change Notification for a while but to use it required a custom program. Such as Tim outlines on his blog https://oracle-base.com/articles/10g/dbms_change_notification_10gR2 Since SQLcl has Nashorn, now it can be integrated with a few lines of javascript to get notified when changes happen.  The script is below and posted.  The catch is QCN only works on Varchars and

Putting SQL in the corner with Javascript in SQLCL

Fri, 2016-06-10 15:03
Here's a pretty small javascript file that allows for running sql in the background of your current sqlcl session.  This is a trivial example of a sql script that has a sleep in it to simulate something taking time. It also prints the SID to show it's a different connection than the base. select 'DB SID ' ||sys_context('USERENV','SID') || ' is going to sleep' bye from dual; begin

Tuning SQL with Javascript in SQLCL

Fri, 2016-06-10 15:03
In case anyone missed it, #sqlcl has the ability to run javascript. This opens a lot of options.  Here's a simple example that shows how to using javascript. Open a new Database Connection Collect stats on the base connection Do work on the main connection Collect stats again Only Print the stats that changed In SQL Developer, the autotrace feature has for a long time selected the session

Carbonated SQLCL - aka SODA support

Fri, 2016-06-10 15:03
     Oracle Database 12.1.0.2 introduced JSON support.  This is supported in REST Data Services already and now in the latest SQLCL.  This means ORDS can serve up the access to client applications and developers can have a command line way to interact and test features/queries/... in a nut shell a shell for JSON document storage. To use this feature the database will be to have patch #20885778

SQLCL - Blob loading ALL the files

Fri, 2016-06-10 15:03
The github repo for all the things the DB Tools team does will be posted here https://github.com/oracle/Oracle_DB_Tools This will include sqlcl , sqldev, modeler, ords , and who knows what other things we have up our sleeves to post.  This repo is going to be made up of  examples and getting started things like a new extention for sqldev, custom transformation for modeler, ords integration with

AskTom's print_table - SQLCL version

Fri, 2016-06-10 15:03
There was an idea logged over on community.oracle.com to add AskTom style print_table to sqlcl. Here's how easy it is now that there's scripting in sqlcl.  This is a simple js file that loops over the rows and columns and prints them.  When using the executeReturnListofList the first row is the name of the columns for reference.  With that data there it's quite simple to customize any output.

SQLCL - Blob loading from a file

Fri, 2016-06-10 15:03
There is a ton of ways having new scripting in sqlcl can help.  One example is a simpler way to load a local file into a BLOB in a column. Prior to this the only options I know of would be to write custom code or move the files to the server and use utl_file or xdb or some combination of things like this. Enter SQLCL and javascript method #1. Here's a simple script which loads a local file

SQLcl - Oct 13th Edition

Fri, 2016-06-10 15:03
Another build of SQLCL is out.  This one has lots of great things in it.  There's fix in there to work with Cygwin for the unlucky people that are still on windows. Now the new stuff:  SCRIPT This new command can radically change things you can do in the tool.  The script command runs a script that can be any language that is JSR-223 enabled.  The best list I can find is here: https://

SQLcl - Oct 5th Edition

Fri, 2016-06-10 15:03
It was time for another push of the new sql command line , sqlcl.  Here's the changes in the latest build.  There are a number of bugs fixed relating to connecting to idle databases, alias feedback, and picking up the $ORACLE_HOME's jdbc driver when available.  There is only a couple functional changes. First is that now the jdbc connect string itself can be specified.  This opens up a number

SQLCL - More secure, now with REST !

Fri, 2016-06-10 15:03
A new SQLCL build was just posted go grab it and kick the tires.  There are well over 100 bug fixes in there so it's better than ever.  Also there's some new things. More Secure    Imagine you have an api that is called and a password or something is used in the parameters.  We use exec MY_API(...)  and it works just fine.  However consider if someone with access to v$sql they just got

SQLcl , yet again

Fri, 2016-06-10 15:03
By the Numbers There's a new SQLcl out for download.  In case, there are too many to keep track of the build numbers are quite easy to tell if you have the latest.  The build posted today is  sqlcl-4.2.0.15.167.0827-no-jre.zip Here's what we are doing 4.2.0 <-- doesn't matter at all 15     <- year 167   <- day in julian 0827 <- time the build was done So yes, this build was done today at 8am

Repeating another SQLCL EA release

Fri, 2016-06-10 15:03
    It's been a month and a lot of bugs have been fixed in that time and new features added. That adds up to time for another EA for our new sqlcl.  The third sqlcl EA is out now and can be found here on the SQL Developer 4.1 download page.     Not sure what this sqlcl thing is ? Check here. LOAD:  Making CSV loading to the db very easy Here's a very quick example of the possibilities.

Pages