当我尝试从Unix服务器执行SQL脚本时显示错误但是我从sql navigator运行的SQL正常工作正常..请帮助我..
INSERT INTO t_csocstudent_course_local
(SELECT tsct.student_id,
tsct.object_lookup_id,
tsct.course_id,
tsct.xcourse_id,
clt.NAME,
tsct.course_type,
FROM temp_stud_course tsct join course_local clt
on tsct.COURSE_ID = clt.COURSE_ID
WHERE TO_CHAR (sc_timestamp, 'YYYYMMDDHH24MISS') >
(SELECT TO_CHAR (MAX (sc_timestamp), 'YYYYMMDDHH24MISS')
FROM t_student_course_local)
AND tsct.xcourse_id IN
('EX1','EX2'));
错误:
Error in loading main table
Enter password:
SP2-0734: unknown command beginning "WHERE TO..." - rest of line ignored.
AND tsct.xcourse_id IN
*
ERROR at line 3:
ORA-00933: SQL command not properly ended
提前致谢!!
答案 0 :(得分:1)
我不记得Oracle命令行客户端是否允许额外的空格换行符。删除WHERE
子句之前的额外换行符。
From the documentation,空行在SQLplus中默认终止SQL语句。
SQLT[ERMINATOR] {;|c|OFF|ON}|
Set the char used to end and execute SQL commands to c.
OFF disables the command terminator - use an empty line instead.
ON resets the terminator to the default semicolon (;).
您可以更改行为以使用分号而不是空行:
SET SQLTERMINATOR ON