SQL * Plus - Spool CSV - SP2-0734: unknown beginnin command

When I run the following .cmd task:

sqlplus -s User/Password@database @Query.sql 'G:'

I get this error:

SP2-0734: unknown command beginnin

Even adding set sqlblanklines onfailed.

With a simple query such as select * from table1, it works.

With a more complex request (several join, group by) it does not work => Even if the file is well generated. Inside the file, I just detect errors.

You will find more about the problem below:

SP2-0734: unknown command beginning "FROM NOTI...." - rest of line ignored.
SP2-0734: unknown command beginning "INNER JOIN..." - rest of line ignored.
SP2-0734: unknown command beginning "INNER JOIN..." - rest of line ignored.
SP2-0734: unknown command beginning "INNER JOIN..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
SP2-0734: unknown command beginning "INNER JOIN..." - rest of line ignored.
SP2-0734: unknown command beginning "INNER JOIN..." - rest of line ignored.
SP2-0734: unknown command beginning "INNER JOIN..." - rest of line ignored.
SP2-0734: unknown command beginning "INNER JOIN..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
SP2-0734: unknown command beginning "LEFT JOIN ..." - rest of line ignored.
SP2-0734: unknown command beginning "LEFT join ..." - rest of line ignored.
SP2-0734: unknown command beginning "LEFT join ..." - rest of line ignored.
SP2-0734: unknown command beginning "LEFT JOIN ..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
SP2-0734: unknown command beginning "LEFT join ..." - rest of line ignored.
SP2-0734: unknown command beginning "LEFT join ..." - rest of line ignored.
SP2-0734: unknown command beginning "WHERE NOTI..." - rest of line ignored.
SP2-0734: unknown command beginning "GROUP BY N..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
SP2-0734: unknown command beginning ",table1..." - rest of line ignored.
SP2-0734: unknown command beginning ",table2..." - rest of line ignored.
+4
source share
3 answers

By default, SQL * Plus treats an empty string as the end of a previous command :

An empty line in a SQL statement or script tells SQL * Plus that you have finished entering the command, but do not want to run it.

FROM SELECT - , , / . SELECT , .

SQL * Plus , -, SQL SQL * Plus, SP2-0044 .

; SET SQLBLANKLINES ON script:

SQL * Plus SQL script. ON SQL script. OFF, SQL script script.

+4

, SET SQLBLANKLINES ON, . , , , . , sql , , utf-8.

solution - sql β†’ ANSI. .

+1

SET SQLBLANKLINES ON , cmd sqlplus txt .

"PROMPT" select, . select PROMPT SP2-0734.

0
source

All Articles