2006-4-7 14:34
liufei134
一个SQL语句的问题
小弟写了一个shell,如下:
#!/usr/bin/ksh
sqlplus rtcuser/password << sqlend
insert into t_reportcopy (internal_id, version, update_time, report_id, name, report_unit, unit_name, dept_id, report_origin, report_type, report_date ) select internal_id, version, update_time, report_id, ort_name, report_unit, unit_name, dept_id, report_origin, report_type, report_date from portindex where (report_unit='0892' and date=to_date('20060402','yyyy-mm-dd')) or (report_unit='0894' and report_date=to_date('20060402','yyyy-mm-dd')) ;
exit
sqlend
执行,到了sql部分时候就僵死在那里,但是把sql语句单独放在pl/sql工具下执行就可以迅速成功,而采取在neterm登陆sqlplus执行,又僵死,急的跳墙,在线等,感谢感谢
2006-4-7 23:14
charly
#!/usr/bin/ksh
echo "start sqlplus"
sqlplus rtcuser/password << sqlend
!echo "start insert";
insert into t_reportcopy (internal_id, version, update_time, report_id, name, report_unit, unit_name, dept_id, report_origin, report_type, report_date ) select internal_id, version, update_time, report_id, ort_name, report_unit, unit_name, dept_id, report_origin, report_type, report_date from portindex where (report_unit='0892' and date=to_date('20060402','yyyy-mm-dd')) or (report_unit='0894' and report_date=to_date('20060402','yyyy-mm-dd')) ;
!echo "end insert";
exit
sqlend
看看死在哪里?