我需要在序列值增加後,爲變量分配一個序列值。我試過這個,但它給出了一個錯誤:你如何給一個變量賦值一個序列值?
variable imageID number;
select SEQ_IMAGE_ID.CURRVAL into :imageID from dual;
select * from IMAGES where IMAGE_ID = :imageID;
Error starting at line 2 in command:
select SEQ_IMAGE_ID.CURRVAL into :imageID from dual
Error report:
SQL Error: ORA-01006: bind variable does not exist
01006. 00000 - "bind variable does not exist"
我有三重檢查,序列名稱是正確的,任何想法?
這是SQL * Plus還是PL/SQL環境? – Ollie