Hi ,
I've the following piece of code with a simple EXECUTE IMMEDIATE usage . PFb code :
-----------------------
declare
v_a varchar2(10);
begin
/*EXECUTE IMMEDIATE 'SELECT TRUNC(EVT_DTTM), COUNT(*) FROM ' || v_tabr || ' GROUP BY TRUNC(EVT_DTTM) '
INTO v_date, v_received;
*/ ( This works fine )
EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM temp_manto'|| into v_a; --- This is the new line where I'm facing the error .
EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM'|| temp_manto into v_a; --- Same line with quotes in different place throwing error.
Exception
when NO_DATA_FOUND then
dbms_output.put_line(v_a);
end;
/
-----------------------------
Error :
Error report:
ORA-06550: line 11, column 55:
PLS-00103: Encountered the symbol "INTO" when expecting one of the following:
( - + case mod new null <an identifier>
<a double-quoted delimited-identifier> <a bind variable>
continue avg count current max min prior 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 specification>
<an alternatively-quoted
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
My question is : Which parts of the query we need to put in quotes and which not. Pl suggest what should be the correct statement .
Thanks in advance