ora-06512

CREATE Oracle Procedure

好久不见. 提交于 2020-01-10 05:16:38
问题 I am trying to create a procedure and it created without error. However when I try to run it then I will get following error. Please advise SQL> begin 2 Update_STUD_Fin ( '1011'); 3 end; 4 / begin * ERROR at line 1: ORA-06511: PL/SQL: cursor already open ORA-06512: at "ORAIN.UPDATE_STUD_FIN", line 3 ORA-06512: at "ORAIN.UPDATE_STUD_FIN", line 8 ORA-06512: at line 2 The Procedure is SQL> CREATE OR REPLACE PROCEDURE Update_STUD_Fin ( AIDY_CODE IN VARCHAR2 ) IS 2 CURSOR PublicationC IS 3 SELECT

PlSQL trigger error ORA-0000 ORA-06512:

☆樱花仙子☆ 提交于 2019-12-24 12:29:21
问题 create or replace TRIGGER "SUP" AFTER INSERT ON "EMP_REPORT" REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW DECLARE miclaim_supervisor_count number; employee_company_code VARCHAR2(10); employee_businessunit number; projMgrs NUMBER; supId NUMBER; cursor projMgrsCursor is select b.BU_MEMBER_ID from BU_MEMBER b, EMP_SUB_DIV s where s.EMP_NO = :NEW.EMP_NO and s.SUB_DIVISION_CODE = '01' and s.DIV_CODE = '2' and b.BU_ID IN (select BU_ID from BU_MEMBER where BU_MEMBER_ID = :NEW.EMP_NO); BEGIN

ORA-29283: invalid file operation ORA-06512: at “SYS.UTL_FILE”, line 536

别说谁变了你拦得住时间么 提交于 2019-12-12 10:40:45
问题 Below is the code i use to extract data from a table to a flat file. BEGIN DECLARE file_name VARCHAR2(50); file_handle utl_file.file_type; BEGIN file_name := 'table.txt'; file_handle := utl_file.fopen('SEND',file_name,'W'); FOR rec in( SELECT column 1 ||'~'||column 2 ||'~'||column 3 out_line FROM table1)LOOP UTL_FILE.PUT_LINE(file_handle,rec.out_line); UTL_FILE.FFLUSH(file_handle); END LOOP; UTL_FILE.FCLOSE(file_handle); END; end; This code is working fine in our development database but its

Searching data from a table using stored procedure in oracle by passing tablename as a parameter

有些话、适合烂在心里 提交于 2019-12-02 22:13:31
问题 This procedure is not working properly. create or replace procedure bank_search_sp ( p_tablename in varchar2, p_searchname in varchar2, p_bankcode out varchar2, p_bankname out varchar2, p_dist_code out number ) as v_tem varchar2(5000); begin v_tem :='select bankcode,bankname,dist_code from ' || UPPER (p_tablename) || ' where bankname like '''|| p_searchname||''; execute immediate v_tem into p_bankcode,p_bankname,p_dist_code using p_searchname ; commit; end bank_search_sp; the Procedure is

Searching data from a table using stored procedure in oracle by passing tablename as a parameter

大兔子大兔子 提交于 2019-12-02 09:56:53
This procedure is not working properly. create or replace procedure bank_search_sp ( p_tablename in varchar2, p_searchname in varchar2, p_bankcode out varchar2, p_bankname out varchar2, p_dist_code out number ) as v_tem varchar2(5000); begin v_tem :='select bankcode,bankname,dist_code from ' || UPPER (p_tablename) || ' where bankname like '''|| p_searchname||''; execute immediate v_tem into p_bankcode,p_bankname,p_dist_code using p_searchname ; commit; end bank_search_sp; the Procedure is getting created but i dont know what actually happens when it was executed ,This is the error shown ORA

run string as query in oracle

落爺英雄遲暮 提交于 2019-12-01 07:49:02
问题 i got a little problem in Oracle. I try to create a sequence for generating IDs in a table that already has data in it. I try to use the following anonymous block. declare y varchar2(2000); BEGIN SELECT 'CREATE SEQUENCE ID_SEQ MINVALUE 1 MAXVALUE 9999999999 START WITH ' || (max(ID)+1) || ' INCREMENT BY 1 CACHE 20;' INTO y FROM TEST_TABLE; --dbms_output.put_line(y); execute immediate y; end; I get the following error: Error report: ORA-00911: invalid character ORA-06512: at line 5 00911. 00000

Oracle Error ORA-06512

ぐ巨炮叔叔 提交于 2019-11-30 23:18:31
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 ((pNum < 12) OR (pNum > 14)) THEN RAISE vSOME_EX; ELSE EXECUTE IMMEDIATE 'INSERT INTO M'||pNum||'GR (CV, SUP, IDM'||pNum||') VALUES('||pCv||', '||pSup||', '||pIdM||')'; END IF; END PX; The structure base for the table where the insert is made: 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 (

Oracle Error ORA-06512

Deadly 提交于 2019-11-30 16:01:04
问题 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 ((pNum < 12) OR (pNum > 14)) THEN RAISE vSOME_EX; ELSE EXECUTE IMMEDIATE 'INSERT INTO M'||pNum||'GR (CV, SUP, IDM'||pNum||') VALUES('||pCv||', '||pSup||', '||pIdM||')'; END IF; END PX; The structure base for the table where the insert is made: CREATE TABLE "DB"."M12GR" ( "IDM12GR" NUMBER(10,0) NOT NULL ENABLE, "CV" VARCHAR(5) NOT NULL ENABLE, "SUP"

CREATE Oracle Procedure

跟風遠走 提交于 2019-11-29 14:52:40
I am trying to create a procedure and it created without error. However when I try to run it then I will get following error. Please advise SQL> begin 2 Update_STUD_Fin ( '1011'); 3 end; 4 / begin * ERROR at line 1: ORA-06511: PL/SQL: cursor already open ORA-06512: at "ORAIN.UPDATE_STUD_FIN", line 3 ORA-06512: at "ORAIN.UPDATE_STUD_FIN", line 8 ORA-06512: at line 2 The Procedure is SQL> CREATE OR REPLACE PROCEDURE Update_STUD_Fin ( AIDY_CODE IN VARCHAR2 ) IS 2 CURSOR PublicationC IS 3 SELECT SGidm from SGB 4 WHERE SGCODE_EFF ='201030'; 5 BEGIN 6 OPEN PublicationC; 7 8 FOR PublicationR IN