Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximum length of an SQL*Plus command?

Status
Not open for further replies.

mbames

Programmer
Jun 5, 2003
29
GB
I have written a nice long query that uses multiple joins, however when I started adding in the names of the fields from the tables that I required SQL*Plus has started to throw a wobbly, but deleting just one field name makes it work.

A working command is 1023 characters long, but any longer than this and it fails. Is this a known problem?

I'll stick the long line into my C++ app in a minute and see what happens there.

Cheers,
Matt
 
Just tried it from code, and it executes fine from there, so I assume this is a limitation that has being imposed by SQL*Plus

:-(
 
From my (8.1.6) SQL*Plus session buffer, I just successfully ran a SELECT that has these characteristics:

- 1,200 lines of code
- 72,000+ characters of code
- outputs 12,000 table columns of data

Since I didn't push it to fail-point, I'm not yet certain of the maximums.
 
Did you try to run it using copy/paste? I had the same problem. Try to use editor, called from sql*plus by ed or launch it from command file.

Regards, Dima
 
No doubt that the copy/paste or ed buffer is shorter than the SQL*Plus buffer. The successes were from running via the SQL*Plus &quot;@&quot; invocation and &quot;get <filename>&quot;. This shows that any character-length limitations are not with Oracle SQL or SQL*Plus, but rather with copy/paste and external modules. If someone is running lengthy code, most would agree that it is advisable to run from a scripted command file.

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top