Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1788
  • Last Modified:

Oracle SQL Script Errors

Hi,

I am new to Oracle and I have the following issue.....

I have been given a SQL script file that basically contains many 'CREATE TABLE' statements....

When I execute this script file using 'SQL *Plus' most of the SQL CREATE statments work O.K.....However near the end I get the following error messages.

SP2-0734: unknown command beginning "USING INDE..." - rest of line ignored.
SP2-0734: unknown command beginning "STORAGE(IN..." - rest of line ignored.
SP2-0734: unknown command beginning "PCTINCREAS..." - rest of line ignored.
SP2-0734: unknown command beginning "TABLESPACE..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
SP2-0734: unknown command beginning ") PCTFREE ..." - rest of line ignored.
SP2-0734: unknown command beginning "STORAGE(IN..." - rest of line ignored.
SP2-0734: unknown command beginning "PCTINCREAS..." - rest of line ignored.
SP2-0734: unknown command beginning "TABLESPACE..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.

I am not sure how best to track down which SQL statements are the one(s) causing the problem, can you help...?

Also what does the 'SP2-0044' code mean...?

Thanks Ian


0
ISC
Asked:
ISC
1 Solution
 
slightwv (䄆 Netminder) Commented:
First:
SP2-0044 For a list of known commands enter HELP and to leave enter EXIT

Cause: An unknown command was entered.

Action: Check the syntax of the command you used for the correct options.


Not for what's causing it:
Check for a blank line above a line starting with: USING INDE
0
 
slightwv (䄆 Netminder) Commented:
FYI:

In the script you can also add prompts or set echo on:

for example:
prompt Creating table tab1
create table tab1.....

or use:  set echo on

This will cause ALL commands to be echoed back to the screen.
0
 
paquicubaCommented:
Post your script...

You're missing ";" (semi-colons)  somewhere  
------------------------------------------------------------
SP2-0044   For a list of known commands enter HELP and to leave enter EXIT

Cause: An unknown command was entered.

Action: Check the syntax of the command you used for the correct options.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ISCAuthor Commented:
Sorry the script file is to large to post.....
0
 
dragonempCommented:
post the script from several lines before the error start so we can check it, I bet you miss a ";" somewhere.
0
 
slightwv (䄆 Netminder) Commented:
20 points says it's a blank line!!!

try running the following (keep the blank line above "using tablespace".  I'm unable to get this with a missing semi-colon.

drop table tab1;
create table tab1
(
      col1 char(1)
)

using tablespace tables;
0
 
Mark GeerlingsDatabase AdministratorCommented:
The problem could be a blank line, or a missing semi-colon, or it could be an out-of-space problem in the tablespace where the tables are being created, if the tablespace is not set to "autoextend".  Slightwv has given you a good way to find the line(s) with the problem, by adding "prompt ..." lines that indicate how far along the script is.  Of course, now if you re-run this script from the top, it will "fail" on all of the tables that it successfully created the first time, because they already exist now.  So, the simplest way to troubleshoot now may be to drop all of the tables that were created, then try to run the script with these "prompt..." lines so you can see exactly what it is trying to do when it fails.

You may also want to add a "spool" command at the top and a "spool off" command at the bottom to capture the output to a log file in case it is hard to catch the error(s) from the screen.  To do that just add a line like this as the first line of your script:

spool C:\temp\sql_log.txt

and add this line as the last line of your script:
spool off

Obviously the "C:\temp" part of this command must be a drive\directory that is valid on the machine where you run SQL*Plus.
0
 
Mehul ShahIT consultantCommented:
Yes I agree with markgeer.

There must be some blank line in the create table statement. eg

CREATE TABLE TEST (
NAME CHAR(4),
ID NUMBER(2))

USING INDEX
TABLESPACE "XXXXX"
STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0)
PCTFREE 10 INITRANS 2 MAXTRANS 255)

TABLESPACE "YYYYYY" PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255
STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS  2147483645 PCTINCREASE 0)


Check for the same and let us know.
0
 
helpneedCommented:
hi

The command entered was invalid.

Check the syntax of the command you used for the correct options


somethink like blank line or any other problem can cause these kind of problem my suggession is to
look up the entire query and try to locate the place

'SP2-0044' code means one particular error number 'sp' stands for sqlplus...

regards
0
 
ISCAuthor Commented:
Hi,

Sorry I did not reply earlier but I have been on holiday....

2slightWV" was spot on there was a blank line in the script file once I took this out and re-ran the script everything was fine...!

Many thanks for all your help...!

Ian


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now