在PL/SQL匿名塊中使用替換字符串有什麼辦法嗎?我試圖在PL/SQL匿名塊內使用我的替換字符串DATE_DIFF
作爲&DATE_DIFF.
但它給出了以下錯誤。在PL/SQL匿名塊中使用替換字符串
ORA-06550: line 13, column 18: PLS-00103: Encountered the symbol "&" when expecting one of the following: (- + all case mod new null <an identifier> <a double-quoted delimited-identifier> <a bind variable> continue any avg count current max min prior some sql stddev sum variance execute forall merge time timestamp interval date <a string literal with character set specification> <a number> <a single-quoted SQL string> pipe <an alternatively-quoted string literal with character set s
我怎樣才能解決這個問題?
更新PL/SQL匿名塊使用替換字符串的
示例代碼。
DECLARE
v_date_diff NUMBER;
BEGIN
v_date_diff := &DATE_DIFF.; // this didn't work
END;
替換變量是SQLP * PLUS相關功能。其他一些工具可能會或可能不支持它們。 –
@NicholasKrasnov對替換字符串的Oracle APEX支持。 – Bishan
如果我沒有在PL/SQL塊中的APEX中弄錯,替換變量的語法將是':DATE_DIFF'或使用'V'函數'V('DATE_DIFF')'。 –