Shell 尝试从Unix脚本加载数据时出错
当我试图从Unix服务器执行SQL脚本时,它会显示错误,但与从SQL navigator运行的SQL相同,它工作正常。。请帮我一下Shell 尝试从Unix脚本加载数据时出错,shell,unix,oracle10g,Shell,Unix,Oracle10g,当我试图从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, ts
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
提前谢谢 我不记得Oracle命令行客户端是否允许额外的空格换行符。删除
WHERE
子句之前的额外换行符
更新
,在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