我想将选择查询结果存储在 PLSQL 中的变量中。
SQL>var v_storedate VARCHAR2(19);
SQL>exec :v_storedate := 'select cdate from rprt where cdate between cdate AND TO_CHAR(sysdate, 'YYYY/MM/DD-HH24-MI-SS-SSSSS') and ryg='R' and cnum='C002'';
作为
SQL>select cdate from rprt where cdate between cdate AND TO_CHAR(sysdate, 'YYYY/MM/DD-HH24-MI-SS-SSSSS') and ryg='R' and cnum='C002';
返回 : 2013/04/27-10:06:26:794
但它会引发错误:
ERROR at line 1: ORA-06550: line 1, column 121: PLS-00103: Encountered
the symbol "YYYY" 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_ The symbol "*" was substituted for "YYYY"
to continue. ORA-06550: line 1, column 148: PLS-00103: Encountered the
symbol ") and ryg=" when expecting one of the following: . ( * @ % & =
- + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between