Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for noobs #11

Closed
jfbleach opened this issue Nov 8, 2017 · 4 comments · May be fixed by #44
Closed

for noobs #11

jfbleach opened this issue Nov 8, 2017 · 4 comments · May be fixed by #44

Comments

@jfbleach
Copy link

jfbleach commented Nov 8, 2017

A short piece in the read me on how to run your example scripts would be great for those of us new to sqlcl. Not knowing how to run scripts in sqlcl, I finally found an example in an old closed issue.
Example:
script apx
apx workspace

I didn't realize "script apx" was just the load command and didn't enter the second line. I expected something to happen and was left wondering what happened.

@totierne
Copy link

totierne commented Jan 2, 2018

SQL> help
For help on a topic type help <topic> 
List of Help topics available:
/                @                @@               ACCEPT           
APEX             APPEND           ARCHIVE_LOG      BREAK            
BTITLE           CD               CHANGE           CLEAR            
COMPUTE          CONNECT          COPY             CTAS             
DEFINE           DEL              DESCRIBE         DISCONNECT       
EXECUTE          EXIT             FIND             FORMAT           
HISTORY          HOST             INFORMATION      INPUT            
LOAD             NET              OERR             PASSWORD         
PRINT            PROMPT           QUIT             REMARK           
RESERVED_WORDS   REST             RUN              SAVE             
SET              SETERRORL        SHOW             SHUTDOWN         
SPOOL            SSHTUNNEL        START            STARTUP          
TIMING           TNSPING          TTITLE           UNDEFINE         
WHENEVER         WHICH            XQUERY 

(note script is missing from the list above which is a bug)

SQL> help script
SQLcl scripting is based on Java's JSR-223 which allows scripting languages to be executed from the Java VM. There are a number of languages that can be plugged in with the NashHorn Javascript engine being included in Java. 

The addition of client side scripting will allow control flow in the sql scripts themselves. It also allow for things like file access, greater control on host commands, leverage various javascript libraries, and the ability to leverage java.

To run a script simply type: script <script name> If there is no file extension passed along it assumes a .js.

Examples at https://github.com/oracle/oracle-db-tools/tree/master/sqlcl/examples

@gvenzl
Copy link
Member

gvenzl commented Feb 1, 2018

Hi @totierne, can you add a short paragraph on that in the ReadMe as @jfbleach suggested?

@krisrice
Copy link
Contributor

krisrice commented Feb 1, 2018

Good point I should put the blog link into each script as well. For example the one you mentioned is outlined here: http://krisrice.io/2016-10-11-export-apex-application-with-sqlcl/

@bamcgill
Copy link
Member

closing this as we have another Pull request #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants