Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQLcl - Start sql script on MS Windows with a defined path

Gunther PippèrrMay 3 2016 — edited May 17 2016

Hello Team,

how I can escape the \ in the path to a sql script in SQLcl to call the script?

I get the following errror  (sorry, German environment):

SQL> @c:\ps\sql\ls

Fehler beim Start in Zeile: 1 in Befehl -

@c:\ps\sql\ls

Fehlerbericht -

SP2-0310: öffnen von Datei nicht möglich: "c:pssqlls.sql"

Thanks

Best Regards

Gunther


PS:  I use  sqlcl-4.2.0.16.112.0616

This post has been answered by Gunther Pippèrr on May 17 2016
Jump to Answer

Comments

Gunther Pippèrr

Hello,

one workaround is the use of the ? Syntax, use Oracle Home and travers back to the original destination.

For example:


SQL> @?/../../../../../ps/sql/ls.sql


Best Regards

Gunther

BrianDwyer

Hi, I'm using an earlier version (4.2.0.16.049.0843) and i'm able to call scripts without needing to put escape characters in.

SQL> @D:\bob\bob

Hello, My name is ob and I am called from D:\bob\bob.sql

SQL>

Wonder if it is just a bug in that release.

Brian

Gunther Pippèrr

Hello Brian,

If I start SQLcl with /nolog and connect later to a database the call of the script works!

sql.bat /nolog


SQLcl: Release 4.2.0.16.112.0616 RC auf Di Mai 03 13:18:38 2016

SQL> @c:\ps\sql\hello.sql

Hello World

-- If I connect now to a database,

SQL> connect system@testdb
connected

SQL>  @c:\ps\sql\hello.sql
Hello World


Only If I login first to a database I get the error!

My next try is to set different NLS CHARSET's settings, maybe a charset problem?

Best Regards

Gunther

I think this is a bug.

BrianDwyer

Hi, upgraded to the latest version and get the same issue so it is only in this release.

the work around of sql /nolog then connecting from there gets round the issue. if you forget to do that then just use two \\ instead of one in the path

the bug also stops you using the CD command to move around from within SQLcl.

Brian

Gunther Pippèrr
Answer

Hello,

I test the version 4.2.0.16.131.1023  from May 13, 2016 and it works now!

CD is a nice feature!

Thanks

Best Regards

Gunther

Marked as Answer by Gunther Pippèrr · Sep 27 2020
1 - 6

Post Details

Added on May 3 2016
6 comments
1,480 views