Home > database >  Help: ora - 06502: the pl/SQL: Numbers or value error: the transformation of character to the numeri
Help: ora - 06502: the pl/SQL: Numbers or value error: the transformation of character to the numeri

Time:10-02



Declare
QRQ date;
HRQ date;
SQL1 VARCHAR2 (130);
SQL2 VARCHAR2 (13000);
SQL3 VARCHAR2 (13000);
SQL4 VARCHAR2 (30000);
The begin
Sql4:=';
QRQ:=to_date (' 2016-12-26 ', '- dd yyyy - mm);
HRQ:=to_date (' 2017-01-25 ', '- dd yyyy - mm);
Sql2:='count (CASE WHEN B.T XNDATESN=to_number (to_char (QRQ, "yyyymmdd"), "99999999") THEN p. osseq END) AS substr (to_char (QRQ, "yyyymmdd"), 5, 4) | | to_char (QRQ, "day")';
SQL1:='select a.r yxm as name,';
While QRQ & lt; HRQ
Loop
Sql2:=sql2 + 'count (CASE WHEN B.T XNDATESN=to_number (to_char (QRQ, "yyyymmdd"), "99999999") THEN p. osseq END) AS substr (to_char (QRQ, "yyyymmdd"), 5, 4) | | to_char (QRQ, "day")';
QRQ:=QRQ + 1;
End loop;
SQL3:='from GJZG a, TDCXTXNDETAILTB20170101 b where a.y GKH=biggest ardid and a.t xntype=31 and to_char (b.b usid)=055555 and b.T XNDATESN>=to_number (to_char (QRQ, "yyyymmdd"), "99999999") and b.T XNDATESN<=to_number (to_char (HRQ, "yyyymmdd"), "99999999") group by a.r yxm ';
SQL4:=SQL1 + SQL2 + sql3;
The end;

CodePudding user response:

String concatenation with | | this symbol, do not use +,
Sql2:=sql2 | | '; Like this,

CodePudding user response:

A:=b + c

Such language, I will put the b and c into value, and then to calculate above operations,

Press 1 #, to | |

A: b=| | c

CodePudding user response:

Thank you, have no errors, but does not display the results

CodePudding user response:

No results, of course, you're just a variable assignment, no printing operations, such as before the end with a line of print and see the results

Dbms_output. Put_line (SQL4);

CodePudding user response:

Thank prawn people!!!!!!!!!!
  • Related