1
我需要在需要使用常量的位置運行查詢(以便我們可以更改其值並直接影響查詢中使用的值)。聲明要在查詢中使用的常量
declare
QTY_TRESHOLD CONSTANT NUMBER(10,0) := 1;
begin
select * from FD111200_DBF where M_NB = QTY_TRESHOLD
end;
如果我嘗試運行上面,我得到的第一個語句以下錯誤:
An error occurred when executing the SQL command:
declare
QTY_TRESHOLD CONSTANT NUMBER(10,0) := 1
ORA-06550: line 2, column 39:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
* & = - + ; </> at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset [SQL State=65000, DB Errorcode=6550]
Execution time: 0.01s
1 statement(s) failed.
我在做什麼錯?看看Oracle的the sample,看起來這應該是好的語法。 任何人都可以幫助我理解?
a選擇塊中需要一個INTO。你錯過了一個;在選擇聲明 – Aleksej
@Aleksej嘗試過,但它沒有解決問題。該請求在第一條語句中仍然失敗。 –
你從哪裏運行?它看起來像是第一個分號被看作是語句分隔符。這看起來像一個客戶問題。 [[如此處所示](http://stackoverflow.com/q/33617220/266304),但其他客戶端不處理PL/SQL或需要配置來處理它)。 –