开发者

SQLPLus waits... why?

I am new to SQL Plus. I am trying to update a record using SQL Plus in a batch file. Can this be done?

When I try this, it just waits and waits and waits... I do not know why.

This is my test.sql file:

CONNECT scott/tiger@server
SPOOL ./ResetTable.status
SET LINESIZE 100
SET PAGESIZE 50
UPDATE MY_DBO.ControlTable SET TriggerFlag = 1;
COMMIT;
SPOOL OFF
EXIT;

This is my test.bat file

sqlplus /nolog @"C:\test.sql"
exit

However, this works...

This is my tes开发者_C百科t.sql file:

CONNECT scott/tiger@server
SPOOL ./ResetTable.status
SET LINESIZE 100
SET PAGESIZE 50
select * from  MY_DBO.ControlTable ;
SPOOL OFF
EXIT;

This is my test.bat file

sqlplus /nolog @"C:\test.sql"
exit


I would wager that some other session has locked one or more of the rows in MY_DBO.ControlTable where the TriggerFlag is 1.

From a different session, can you query DBA_BLOCKERS and DBA_WAITERS? If you're seeing rows in those tables, can you post the results?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜