Home > database >  How said the stored procedure name followed by YYYYMM joining together
How said the stored procedure name followed by YYYYMM joining together

Time:10-10

Debug the code, found that the SQL command prompt for the correct end, and the query command from the back of the table name with variable format is tsalpludetailyyyymm, which is suitable for variable yyyymm year + month, how can joining together to correct, as shown in the figure below, I am a novice small white, please great god answer,,, how to fix it, a detailed oh

CodePudding user response:

Ask god to help me this small white thanks!

CodePudding user response:

V_sql varchar2 (2000);

V_sql:='select depcode, sum () from t where RTP date between: and 1:2'.
The open result_set for v_sql using v_beginDate v_endDate;

CodePudding user response:

The table name cannot be directly assembled, dynamic statement can be used to realize,

CodePudding user response:

The table name cannot be directly assembled, can use dynamic statement,
SJ_SQL varchar2 (2000);
SJ_SQL:='your SQL statements;
The EXECUTE IMMEDIATE SJ_SQL;
COMMIT;
  • Related