我想得到一个列的值,并将其放入该列的相同类型的变量中,如下所示:
select FRI_SEC_TEMP into friday_seconds
from TEMPTABLE
where rownum<2;
DBMS_OUTPUT.PUT_LINE(friday_seconds);
但是当我运行脚本时,它会给我以下错误:
查询运行:查询结果6
Error starting at line : 61 in command -
DBMS_OUTPUT.PUT_LINE(friday_seconds)
Error report -
Unknown Command
当我只运行select语句时,我收到以下错误:
ORA-00905: missing keyword
00905. 00000 - "missing keyword"
*Cause:
*Action:
答案 0 :(得分:0)
只需将脚本作为PL SQL块执行,方法是用begin - end
begin
select FRI_SEC_TEMP into friday_seconds
from TEMPTABLE
where rownum<2;
DBMS_OUTPUT.PUT_LINE(friday_seconds);
end;