Oracle Error ORA-06512

后端 未结 3 742
你的背包
你的背包 2021-01-03 00:07

Just can\'t figure out why it gives me ORA-06512 Error

PROCEDURE PX(pNum INT,pIdM INT,pCv VARCHAR2,pSup FLOAT)
AS
    vSOME_EX EXCEPTION;

BEGIN 
    IF ((pN         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-03 00:47

    The variable pCv is of type VARCHAR2 so when you concat the insert you aren't putting it inside single quotes:

     EXECUTE IMMEDIATE  'INSERT INTO M'||pNum||'GR (CV, SUP, IDM'||pNum||') VALUES('''||pCv||''', '||pSup||', '||pIdM||')';
    

    Additionally the error ORA-06512 raise when you are trying to insert a value too large in a column. Check the definiton of the table M_pNum_GR and the parameters that you are sending. Just for clarify if you try to insert the value 100 on a NUMERIC(2) field the error will raise.

提交回复
热议问题