Oracle Error ORA-06512?

ORA-06512 is part of the error stack. It gives us the line number where the exception occurred, but not the cause of the exception. That is usually indicated in the rest of the stack (which you have still not posted) In a comment you said still, the error comes when pNum is not between 12 and 14; when pNum is between 12 and 14 it does not fail Well, your code does this: IF ((pNum 14)) THEN RAISE vSOME_EX That is, it raises an exception when pNum is not between 12 and 14.So does the rest of the error stack include this line?

ORA-06510: PL/SQL: unhandled user-defined exception If so, all you need to do is add an exception block to handle the error. Perhaps: PROCEDURE PX(pNum INT,pIdM INT,pCv VARCHAR2,pSup FLOAT) AS vSOME_EX EXCEPTION; BEGIN IF ((pNum 14)) THEN RAISE vSOME_EX; ELSE EXECUTE IMMEDIATE 'INSERT INTO M'||pNum||'GR (CV, SUP, IDM'||pNum||') VALUES('||pCv||', '||pSup||', '||pIdM||')'; END IF; exception when vsome_ex then raise_application_error(-20000 , 'This is not a valid table: M'||pNum||'GR'); END PX The documentation covers handling PL/SQL exceptions in depth Find out more.

ORA-06512 is part of the error stack. It gives us the line number where the exception occurred, but not the cause of the exception. That is usually indicated in the rest of the stack (which you have still not posted).

In a comment you said "still, the error comes when pNum is not between 12 and 14; when pNum is between 12 and 14 it does not fail" Well, your code does this: IF ((pNum 14)) THEN RAISE vSOME_EX; That is, it raises an exception when pNum is not between 12 and 14. So does the rest of the error stack include this line? ORA-06510: PL/SQL: unhandled user-defined exception If so, all you need to do is add an exception block to handle the error.

Perhaps: PROCEDURE PX(pNum INT,pIdM INT,pCv VARCHAR2,pSup FLOAT) AS vSOME_EX EXCEPTION; BEGIN IF ((pNum 14)) THEN RAISE vSOME_EX; ELSE EXECUTE IMMEDIATE 'INSERT INTO M'||pNum||'GR (CV, SUP, IDM'||pNum||') VALUES('||pCv||', '||pSup||', '||pIdM||')'; END IF; exception when vsome_ex then raise_application_error(-20000 , 'This is not a valid table: M'||pNum||'GR'); END PX; The documentation covers handling PL/SQL exceptions in depth. Find out more.

Thank's a lot! – Tililin Tin Tin Oct 19 at 16:17.

I see that the variable pCv is of type VARCHAR2 so whern you concat your insert you aren't putting it inside sigle quotes: EXECUTE IMMEDIATE 'INSERT INTO M'||pNum||'GR (CV, SUP, IDM'||pNum||') VALUES('''||pCv||''', '||pSup||', '||pIdM||')'; Aditionally the error ORA-06512 is because you are trying to insert a value too large in a column. You need to check the definiton of your 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.

– Ernesto Campohermoso Oct 19 at 2:36 CREATE TABLE "DB"."M12GR" ("IDM12GR" NUMBER(10,0) NOT NULL ENABLE, "CV" VARCHAR(5) NOT NULL ENABLE, "SUP" FLOAT(126) NOT NULL ENABLE, "IDM12" NUMBER(10,0) NOT NULL ENABLE, CONSTRAINT "PRIMARY_30" PRIMARY KEY ("IDM12GR") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "DB" ENABLE, CONSTRAINT "M12SUELORM12" FOREIGN KEY ("IDM12") REFERENCES "DB". "M12" ("IDM12") ENABLE) – Tililin Tin Tin Oct 19 at 2:48 Also, there are 3 tables; with the same structure – Tililin Tin Tin Oct 19 at 2:51.

ORA-06512 is part of the error stack. It gives us the line number where the exception occurred, but not the cause of the exception. That is usually indicated in the rest of the stack (which you have still not posted).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions