Trigger the error ORA-06512: in SYS. Line SECURE_DML 5

Hi all
I am trying to create a procedure that is called by a trigger like this:

CREATE or REPLACE PROCEDURE SECURE_DML is
BEGIN
If (TO_CHAR(SYSDATE, 'DY') IN ('SAB', 'DOM')) OR (TO_CHAR (SYSDATE, 'HH24')
NOT FROM 08:00 ' 17:00 ') THEN
RAISE_APPLICATION_ERROR (-20500, ' Insercoes funcionarios only no comercial Monday ');
end if;
end;
/

CREATE OR REPLACE TRIGGER secure_dml2
INSERT BEFORE ON SCOTT. EMP2
BEGIN
exec SECURE_DML procedure;
end;
/
ALTER SESSION set nls_date_format = 'HH24 DY';
insert into SCOTT.emp2 (sal, empno, ename, deptno) values (7935, 'SANDRA', 1203, 10);

The error that is:
ORA-06512: In SYS. Line SECURE_DML 5
ORA-06512: In SYS. SECURE_DML2 line 2

What should I do to remove these erros?
Thank you

SQL * Plus still displays the full error stack. You raise an error in the stored procedure that is propagated to trigger that is propagated to SQL * more.

SY.

Tags: Database

Similar Questions

  • I get the error message like "error - ORA-29273 report: failure of the HTTP ORA-06512: at"SYS. " UTL_HTTP", line 1130 ORA-12535: TNS:operation expired ORA-06512: 37 29273 line. 00000 - "HTTP request failed" * Cause: package UTL_HTTP The Impossible to run

    I have tried the code

    DECLARE

    lv_url VARCHAR2 (1000): = ' http://shenzhoufellowship.org/main2/files/old/SpecialTopics/TheLoveDare.pdf';

    lc_return BLOB;

    lhttp_url httpuritype.

    Varriables - declared to have written the LOB to pdf file-

    l_file UTL_FILE. TYPE_DE_FICHIER;

    l_buffer RAW (32767).

    l_amount directory: = 32767;

    l_pos INTEGER: = 1;

    l_blob BLOB;

    l_blob_len INTEGER.

    BEGIN

    -create URIs

    lhttp_url: = httpuritype.createuri (lv_url);

    -get the PDF document

    lc_return: = lhttp_url.getblob ();

    -Open the destination file.

    l_file: = UTL_FILE. FOPEN ('MBO_INPUT_DIR', 'MBD.zip', 'wb');

    -Get the total length of the BLOB

    l_blob_len: = DBMS_LOB.getlength (lc_return);

    -Pieces of the BLOB to read and write to the file

    -full up.

    While l_pos < l_blob_len LOOP

    DBMS_LOB. READ (lc_return, l_amount, l_pos, l_buffer);

    UTL_FILE.put_raw (l_file, l_buffer, FALSE);

    l_pos: = l_pos + l_amount;

    END LOOP;

    -Closes the file.

    UTL_FILE. FCLOSE (l_file);

    EXCEPTION

    WHILE OTHERS THEN

    -Close the file if something goes wrong.

    IF UTL_FILE.IS_OPEN (l_file) THEN

    UTL_FILE. FCLOSE (l_file);

    END IF;

    LIFT;

    END;

    But make a mistake like:

    Error report-

    ORA-29273: HTTP request failed

    ORA-06512: at "SYS." UTL_HTTP", line 1130

    ORA-12535: TNS:operation expired

    ORA-06512: at line 37 level

    29273 00000 - "the HTTP request failed.

    * Cause: The UTL_HTTP package cannot run the HTTP request.

    * Action: Use get_detailed_sqlerrm to check the detailed error message.

    Correct the error and restart the HTTP request.

    Please suggest a solution. Is it possible to download a zip file with the same code?

    [oracle@localhost ~]$ sqlplus scott/tiger
    
    SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 6 13:59:09 2015
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> --My Database version
    SQL> ----------------------
    SQL> SELECT * FROM v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2        lv_url    VARCHAR2(500) := 'http://shenzhoufellowship.org/main2/files/old/SpecialTopics/TheLoveDare.pdf';
      3        lc_return BLOB;
      4        lhttp_url httpuritype;
      5        ---Varriables declared for writing the LOB to pdf file --
      6        l_file     UTL_FILE.FILE_TYPE;
      7        l_buffer   RAW(32767);
      8        l_amount   BINARY_INTEGER := 32767;
      9        l_pos      INTEGER := 1;
    10       l_blob     BLOB;
    11       l_blob_len INTEGER;
    12     BEGIN
    13       --create uri
    14       lhttp_url := httpuritype.createuri(lv_url);
    15       --get the PDF document
    16       lc_return := lhttp_url.getblob();
    17       -- Open the destination file.
    18       l_file := UTL_FILE.FOPEN('SAUBHIK', 'TheLoveDare.pdf', 'wb');
    19       --Get the total length of the BLOB
    20       l_blob_len := DBMS_LOB.getlength(lc_return);
    21       -- Read chunks of the BLOB and write them to the file
    22       -- until complete.
    23       WHILE l_pos < l_blob_len LOOP
    24         DBMS_LOB.READ(lc_return, l_amount, l_pos, l_buffer);
    25         UTL_FILE.put_raw(l_file, l_buffer, FALSE);
    26         l_pos := l_pos + l_amount;
    27       END LOOP;
    28       -- Close the file.
    29       UTL_FILE.FCLOSE(l_file);
    30     EXCEPTION
    31       WHEN OTHERS THEN
    32         -- Close the file if something goes wrong.
    33         IF UTL_FILE.IS_OPEN(l_file) THEN
    34           UTL_FILE.FCLOSE(l_file);
    35         END IF;
    36         RAISE;
    37*    END;
    38  /
    DECLARE
    *
    ERROR at line 1:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1130
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at line 36
    
    SQL> conn sys as sysdba
    Enter password:
    Connected.
    SQL> ed
    Wrote file afiedt.buf
    
      1  BEGIN
      2    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl         => 'love.xml',
      3                                      description => 'Love ACL',
      4                                      principal   => 'SCOTT',
      5                                      is_grant    => true,
      6                                      privilege   => 'connect');
      7    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl       => 'love.xml',
      8                                         principal => 'SCOTT',
      9                                         is_grant  => true,
    10                                         privilege => 'resolve');
    11    DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl  => 'love.xml',
    12                                      host => 'shenzhoufellowship.org');
    13  commit;
    14* END;
    15  /
    
    PL/SQL procedure successfully completed.
    
    SQL> conn scott/tiger
    Connected.
    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2        lv_url    VARCHAR2(500) := 'http://shenzhoufellowship.org/main2/files/old/SpecialTopics/TheLoveDare.pdf';
      3        lc_return BLOB;
      4        lhttp_url httpuritype;
      5        ---Varriables declared for writing the LOB to pdf file --
      6        l_file     UTL_FILE.FILE_TYPE;
      7        l_buffer   RAW(32767);
      8        l_amount   BINARY_INTEGER := 32767;
      9        l_pos      INTEGER := 1;
    10       l_blob     BLOB;
    11       l_blob_len INTEGER;
    12     BEGIN
    13       --create uri
    14       lhttp_url := httpuritype.createuri(lv_url);
    15       --get the PDF document
    16       lc_return := lhttp_url.getblob();
    17       -- Open the destination file.
    18       l_file := UTL_FILE.FOPEN('SAUBHIK', 'TheLoveDare.pdf', 'wb');
    19       --Get the total length of the BLOB
    20       l_blob_len := DBMS_LOB.getlength(lc_return);
    21       -- Read chunks of the BLOB and write them to the file
    22       -- until complete.
    23       WHILE l_pos < l_blob_len LOOP
    24         DBMS_LOB.READ(lc_return, l_amount, l_pos, l_buffer);
    25         UTL_FILE.put_raw(l_file, l_buffer, FALSE);
    26         l_pos := l_pos + l_amount;
    27       END LOOP;
    28       -- Close the file.
    29       UTL_FILE.FCLOSE(l_file);
    30     EXCEPTION
    31       WHEN OTHERS THEN
    32         -- Close the file if something goes wrong.
    33         IF UTL_FILE.IS_OPEN(l_file) THEN
    34           UTL_FILE.FCLOSE(l_file);
    35         END IF;
    36         RAISE;
    37*    END;
    38  /
    
    PL/SQL procedure successfully completed.
    
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@localhost ~]$ cd saubhik/
    [oracle@localhost saubhik]$ pwd
    /home/oracle/saubhik
    [oracle@localhost saubhik]$ ls -l *.pdf
    -rw-r--r-- 1 oracle oinstall 60055 Apr  6 14:03 TheLoveDare.pdf
    [oracle@localhost saubhik]$
    

    I love this pdf file. I would like to read this and mean while if you get an error then please post in its entirety and also think that it is an Oracle error or network.

  • ORA-06512: In SYS. SECURE_DML, line 5

    Hi all
    I am trying to create a procedure that is called by a trigger like this:

    CREATE or REPLACE PROCEDURE SECURE_DML is
    BEGIN
    If (TO_CHAR(SYSDATE, 'DY') IN ('SAB', 'DOM')) OR (TO_CHAR (SYSDATE, 'HH24')
    NOT FROM 08:00 ' 17:00 ') THEN
    RAISE_APPLICATION_ERROR (-20500, ' Insercoes funcionarios only no comercial Monday ');
    end if;
    end;
    /
    ALTER SESSION set nls_date_format = 'HH24 DY';

    CREATE OR REPLACE TRIGGER secure_dml2
    INSERT BEFORE ON SCOTT. EMP2
    BEGIN
    exec SECURE_DML procedure;
    end;
    /
    ALTER SESSION set nls_date_format = 'HH24 DY';
    insert into SCOTT.emp2 (sal, empno, ename, deptno) values (7935, 'SANDRA', 1203, 10);

    The error that is:
    ORA-06512: In SYS. Line SECURE_DML 5
    ORA-06512: In SYS. SECURE_DML2 line 2

    What should I do to remove these erros?
    Thank you

    Published by: 994323 on 16/03/2013 20:05

    You post in the wrong forum. Mark the correct answer and close this message. Post to {forum: id = 75}

  • Get the error ORA-06512:

    Hello

    When I was running below error code, please suggest solution.

    [code]

    create or replace

    function get_dept_emps (p_deptno in number) of return is sys_refcursor

    v_rc sys_refcursor;

    Start

    Open v_rc for ' select EMPLOYEE_ID, department_id name, SALARY from employee where department_id =: deptno' using p_deptno;

    Return v_rc;

    end;

    declare

    v_ref sys_refcursor;

    -type typ is ref cursor;

    -typ v_ref;

    number of v_eid;

    v_fname varchar2 (50);

    number of v_sal;

    number of v_did;

    Start

    v_ref: = GET_DEPT_EMPS (100);

    -Open v_ref;

    extract the v_ref in v_eid, v_fname, v_ref, v_sal;

    -dbms_output.put_line (v_eid | v_fname | v_sal | v_did);

    close v_ref;

    end;

    [code]

    Thank you

    Brij

    Hold on... WHAT?

    extract the v_ref in v_eid, v_fname,v_ref, v_sal;

    How does make any sense?

    (I guess that's your mistake)

  • dmp Impdp file error: ORA-29283: operation invalid file ORA-06512: at "SYS." UTL_FILE", line 536

    Hi all.

    Sorry to ask this error again, I read a lot of topic in this forum on this subject, but I can't fix it.

    So I create this topic.

    My computer is running oracle database 11 g 2 express edition on ubuntu LTS 14.04.

    I'm trying to import the database of dmp file. That's what I do:


    > sqplus

    opening session with sys as sysdba, then run:

    Hoangnv CREATE USER IDENTIFIED BY hoangnv;

    GRANT CONNECT TO hoangnv;

    GRANT RESOURCE, s/n hoangnv;

    CREATE OR REPLACE DIRECTORY dmpdir AS ' / home/hoangnv/downloads/db ";

    GRANT read, write the DIRECTORY ON dmpdir TO hoangnv;


    my_project.dmp file is stored on /home/hoangnv/Downloads/db folder.

    Finally, I ran the command below in terminal:

    impdp hoangnv/hoangnv@xe directory = dmpdir dumpfile = my_project.dmp logfile = my_project.log


    That's what see the Terminal:

    ORA-39002: invalid operation

    ORA-39070: unable to open the log file.

    ORA-29283: invalid file operation

    ORA-06512: at "SYS." UTL_FILE", line 536

    ORA-29283: invalid file operation

    Any ideas? I run these commands on window and import the database successfully.

    Hello

    Please try the suggestions below:

    1. make sure that the roles granted to the user are 'default' for him.

    SQL > change the user hoangnv the role by default all;

    then try to re-import.

    Note: the DBA role contains the IMP_FULL_DATABASE with it.

    2. try import with the use of the 'System' this time, which is the result then? don't forget to give the system read, write on directory dmpdir.

    3. is the permission to/home/hoangnv/Downloads/db fine OS?

  • ORA-12012: error on auto work 754461 ORA-29279: SMTP permanent error: ORA-29279: SMTP permanent error: 501 Syntax error, command parameters "RCPT TO:" ORA-06512 unrecognized or missing: at "SYS." UTL_SMTP", line 20 ORA-06512: at"SYS." UTL_SMTP.

    Hello


    I get below error frequently in the log database alerts.


    ORA-12012: error on auto work 754461

    ORA-29279: SMTP permanent error: ORA-29279: SMTP permanent error: 501 Syntax error, command parameters ' RCPT TO: ' unrecognized or missing

    ORA-06512: at "SYS." UTL_SMTP", line 20

    ORA-06512: at "SYS." UTL_SMTP", line 98

    ORA-06512: at "SYS." UTL_SMTP", line 240

    ORA-06512: at the 'APPS '. EIS_UTIL_PKG', line 94

    ORA-06512: at the 'APPS '. HKD_PO_ADDON_PKG', line 110

    ORA-06512: at line 1

    The syntax error comes from the SMTP server, not to the job itself, so I disagree with your solution.

  • Invalid operation UTL_SMTP, ORA-06512: at "SYS." UTL_SMTP", LINE 161

    Hello

    I have a requirement to send the data in the table (retrieved via a select clause) through an email.

    Here is the procedure that uses to send email that includes data from the table through trigger.

    I don't find any problem during execution of the procedure and the relaxation.

    but when inserting the data in table 1 (present to SCHEMA1 please refer to line 37 and 55) I get the following error and the message will not be delivered

    ERRORS

    ORA-29277: invalid SMTP Operation

    ORA-06512: at "SYS." UTL_SMTP", LINE 55

    ORA-06512: AT "SYS." UTL_SMTP", LINE 161

    ORA-06512: AT "SYS." UTL_SMTP", LINE 452

    ORA-06512: AT "SYS." UTL_SMTP", LINE 463

    But when I remove the code from line 33 to 44

    am able to send mail.

    That is to say

    / * IMMEDIATE EXECUTION

    "SELECT."

    A.BATCHNO, B.PCSBOX, B.AMOUNT

    Of

    SCHEMA1. Table1: A, SChEMA2.TABLE2 B

    WHERE

    A.BATCHID = B.BATCHNO AND B.PRODOAID =' | PRODOAID

    BULK COLLECT INTO BATCHNO, PCSBOX, AMOUNT;

    FOR indx IN 1.BATCHNO. COUNTY

    LOOP

    UTL_SMTP. WRITE_DATA (A, BATCHNO (indx) |) ' -- '|| PCSBOX (indx) |' --' || Amount (indx) | UTL_TCP. CRLF);

    END LOOP; */

    I checked the sender and recipient addresses that they are fine.

    so, this is my code

    1 CREATE OR REPLACE PROCEDURE SEND_TABLE_DATA (FROMAD IN VARCHAR2: =' <[email protected]> ', )

    TOAD 2 IN VARCHAR2: = ' < [email protected] > ',

    3 under RESERVE IN VARCHAR2: = 'Data Table ',.

    4 MESSAGE IN VARCHAR2: = "Dear all,

    5                                    Docid :    ' ,

    DOCID 6 IN VARCHAR2,

    DOCDT DATE 7.

    8 PRODOAID IN NUMBER)

    9, ACCORDING TO

    10 TYPE NumList IS TABLE OF NUMBER;

    11 TYPE NameList IS TABLE OF THE VARCHAR2 (32767).

    12 BATCHNO NameList;

    13 PCSBOX NumList;

    AMOUNT 14 NumList;

    15 SMTPHOST VARCHAR2 (255): = ' XX. XX. XX. XX ";

    16. A UTL_SMTP. CONNECTION;

    BEGIN 17

    18 A: = UTL_SMTP. OPEN_CONNECTION(SMTPHOST,25);

    19 UTL_SMTP. HELO (A, SMTPHOST);

    20 UTL_SMTP. MAIL (A, FROMAD);

    21 UTL_SMTP. RCPT (A, TOAD);

    22 UTL_SMTP. OPEN_DATA (A);

    UTL_SMTP 23. WRITE_DATA (A, UTL_TCP. CRLF);

    24 UTL_SMTP. WRITE_DATA (A, UTL_TCP. CRLF. UTL_TCP. CRLF. UTL_TCP. CRLF);

    25 UTL_SMTP. WRITE_DATA (, ' Date: ' |) TO_CHAR (SYSDATE, ' DD/MM/YYYY HH24:MI:SS'). UTL_TCP. CRLF);

    26 UTL_SMTP. WRITE_DATA (, ' from: ' |) FROMAD | UTL_TCP. CRLF);

    UTL_SMTP 27. WRITE_DATA (, ' from: ' |) TOAD | UTL_TCP. CRLF);

    28 UTL_SMTP. WRITE_DATA (, ' subject: ' |) TOPIC | UTL_TCP. CRLF);

    UTL_SMTP 29. WRITE_DATA (ONE, MESSAGE |) DOCID | "Documented on ' | DOCDT | UTL_TCP. CRLF);

    30 UTL_SMTP. WRITE_DATA (A, UTL_TCP. CRLF. UTL_TCP. CRLF. UTL_TCP. CRLF);

    UTL_SMTP 31. WRITE_DATA (A, "it's for your information" |) UTL_TCP. CRLF);

    UTL_SMTP 32. WRITE_DATA (, ' BATCHNO ' |) ' -- '||' PCSBOX ' |' --' ||' AMOUNT '. UTL_TCP. CRLF);

    33 IMMEDIATE EXECUTION

    34 ' SELECT

    35 A.BATCHNO, B.PCSBOX, B.AMOUNT

    36 FROM

    37 SCHEMA1. Table1: A, SChEMA2.TABLE2 B

    38. WHERE THE

    39 A.BATCHID = B.BATCHNO AND B.PRODOAID =' | PRODOAID

    40 BULK COLLECT INTO BATCHNO PCSBOX, AMOUNT;

    41 FOR indx IN 1.BATCHNO. COUNTY

    42 LOOP

    UTL_SMTP 43. WRITE_DATA (A, BATCHNO (indx) |) ' -- '|| PCSBOX (indx) |' --' || Amount (indx) | UTL_TCP. CRLF);

    44 END OF LOOP;

    UTL_SMTP 45. WRITE_DATA (A, CHR (13) |) CHR (13) | CHR (13));

    UTL_SMTP 46. CLOSE_DATA (A);

    UTL_SMTP 47. QUIT (A);

    EXCEPTION OF 48

    49 THEN THAN OTHERS THEN

    50 UTL_SMTP. QUIT (A);

    RAISE 51;

    END 52;

    53.

    54, create or replace trigger trg_table_mail_sricity_prodoa

    55 after insertion on SCHEMA1. TABLE1:

    56 for each line

    start at 57

    (58) SENd_table_data

    59 DOCID = >: new.docid,.

    DOCDT 60 = >: new.docdt,.

    PRODOAID 61 = >: new.prodoaid

    (62);

    end 63;

    Can what changes I make to the code to meet my needs?

    Please correct me if am wrong anywhere,

    in the case where if a bad method used to send data (retrieved using a select clause)

    Show me another method to achieve my requirement.

    Thanks in advance,

    Pradeep cordially.

    Line 19 is not going. The HELO command is used to identify the SMTP client. The SMTP server knows its IP address and the host name. No need to tell him that via the HELO command. He wants to know who is the appellant. The order is intended to say "Hello, I am a customer ". "" See the SMTP RFC for more details. (and Yes, examples of the Oracle are wrong)

    Run immediately? Why? There is no true used dynamic SQL.

    Collect in bulk? Why? There is not analysis or the treatment performed. Use a cursor loop FOR and call write data from the inside of the loop.

    Also consider a fall 80's standard mainframe coding style (and abusing capital letters) and use modern standards that are common in Java. .NET, C/C++, etc. Specifically, as PL/SQL is derived and an implementation of the Ada language, look at Ada 95 quality and Style Guide for standards, and good logic.

  • ORA-00600: internal error code, arguments: ORA-06512: at "SYS." DBMS_STATS.

    Hello

    I had an error in my alert.log. The case of the patch?

    My OS: linux x86_64 - Redhat 5.5
    DBMS: 10.2.0.5 - acronym instance - data files


    ERROR:
    ~ ORA-00600: internal error code, arguments: [ORA-00600: internal error code, arguments: [15735], [2176], [2152], [], [], [], [], [] ~ ORA-06512: at "SYS.] [[DBMS_STATS", line 21275 ~], [] [], [], [], [], []]
    TRACK:
    [ORA-00600: internal error code, arguments: [15735], [2176], [2152] [] [] [], [],]
    For this session current SQL statement:
    Select / * + parallel(t,32) parallel_index(t,32) cursor_sharing_exact use_weak_name_resl dynamic_sampling dbms_stats (0) no_monitoring * / count (*), count (distinct "ALIENACAO"), sum (sys_op_opnsize ("ALIENACAO")), substrb (dump (min ("ALIENACAO"), 16.0, 32), 1, 120), substrb (dump (max ("ALIENACAO"), 16.0, 32), 1, 120), count (distinct "PARCELA"), sum (sys_op_opnsize ("PARCELA")), substrb (dump (min ("PARCELA"), 16.0, 32), 1, 120) , substrb (dump (max ("PARCELA") 16.0, 32), 1, 120), count (distinct "NUM_PAGAMENTO"), sum (sys_op_opnsize ("NUM_PAGAMENTO")), substrb (dump (min ("NUM_PAGAMENTO"), 16.0, 32), 1, 120), substrb (dump (max ("NUM_PAGAMENTO"), 16.0, 32), 1, 120), count (distinct "DATA_VENCIMENTO"), substrb (dump (min ("DATA_VENCIMENTO"), 16.0, 32), 1, 120), substrb (dump (max ("DATA_VENCIMENTO"), 16.0, 32), 1, 120), count (distinct "DATA_PAGAMENTO") ,substrb(dump(min("DATA_PAGAMENTO"),16,0,32),1,120),substrb(dump(max("DATA_PAGAMENTO"),16,0,32) ,1,120),count("VALOR_TOTAL_PAGO_10"),count(distinct "VALOR_TOTAL_PAGO_10"),sum(sys_op_opnsize("VALOR_TOTAL_PAGO_10")),substrb(dump(min("VALOR_TOTAL_PAGO_10"),16,0,32),1,120),substrb(dump(max("VALOR_TOTAL_PAGO_10"),16,0,32),1,120),count("VALOR_TAXA_40"),count(distinct "VALOR_TAXA_40"),sum(sys_op_opnsize("VALOR_TAXA_40")) ,substrb(dump(min("VALOR_TAXA_40"),16,0,32) ,1,120),substrb(dump(max("VALOR_TAXA_40"),16,0,32),1,120),count("VALOR_MULTA_60"),count(distinct "VALOR_MULTA_60"),sum(sys_op_opnsize("VALOR_MULTA_60")),substrb(dump(min("VALOR_MULTA_60"),16,0,32),1,120),substrb(dump(max("VALOR_MULTA_60"),16,0,32),1,120),count("VALOR_MULTA_CORRECAO_170"),count(distinct "VALOR_MULTA_CORRECAO_170"),sum(sys_op_opnsize("VALOR_MULTA_CORRECAO_170")) ,substrb(dump(min("VALOR_MULTA_CORRECAO_170") ,16,0,32),1,120),substrb(dump(max("VALOR_MULTA_CORRECAO_170"),16,0,32),1,120),count("SOMA_MULTA_60_170"),count(distinct "SOMA_MULTA_60_170"),sum(sys_op_opnsize("SOMA_MULTA_60_170")),substrb(dump(min("SOMA_MULTA_60_170"),16,0,32),1,120),substrb(dump(max("SOMA_MULTA_60_170"),16,0,32),1,120),count("VALOR_CORRECAO_EXTRA_90"),count(distinct "VALOR_CORRECAO_EXTRA_90") , sum (sys_op_opnsize ("VALOR_CORRECAO_EXTRA_90")), substrb (dump (min ("VALOR_CORRECAO_EXTRA_90"), 16.0, 32), 1, 120), substrb (dump (max ("VALOR_CORRECAO_EXTRA_90"), 16.0, 32), 1, 120), count ("VALOR_RESIDUO_80"), count (distinct "VALOR_RESIDUO_80"), sum (sys_op_opnsize ("VALOR_RESIDUO_80")), substrb (dump (min ("VALOR_RESIDUO_80"), 16.0, 32), 1, 120), substrb (dump (max ("VALOR_RESIDUO_80"), 16.0, 32), 1, 120), count ("VALOR_SEGURO_50") , count (distinct "VALOR_SEGURO_50"), sum (sys_op_opnsize ("VALOR_SEGURO_50")), substrb (dump (min ("VALOR_SEGURO_50"), 16.0, 32), 1, 120), substrb (dump (max ("VALOR_SEGURO_50"), 16.0, 32), 1, 120), count ("VALOR_MORA_70"), count (distinct "VALOR_MORA_70"), sum (sys_op_opnsize ("VALOR_MORA_70")), substrb (dump (min ("VALOR_MORA_70"), 16.0, 32), 1, 120), substrb (dump (max ("VALOR_MORA_70"), 16.0, 32), 1, 120), count ("VALOR_MORA_CORRECAO_160") , count (distinct "VALOR_MORA_CORRECAO_160"), sum (sys_op_opnsize ("VALOR_MORA_CORRECAO_160")), substrb (dump (min ("VALOR_MORA_CORRECAO_160"), 16.0, 32), 1, 120), substrb (dump (max ("VALOR_MORA_CORRECAO_160"), 16.0, 32), 1, 120), count ("SOMA_MORA_70_160"), count (distinct "SOMA_MORA_70_160"), sum (sys_op_opnsize ("SOMA_MORA_70_160")), substrb (dump (min ("SOMA_MORA_70_160"), 16.0, 32), 1, 120), substrb (dump (max("SOMA_MORA_70_160") ,16,0,32),1,120),count("VALOR_AMORTIZACAO_CAP_30"),count(distinct "VALOR_AMORTIZACAO_CAP_30") ,sum(sys_op_opnsize("VALOR_AMORTIZACAO_CAP_30")),substrb(dump(min("VALOR_AMORTIZACAO_CAP_30"),16,0,32),1,120),substrb(dump(max("VALOR_AMORTIZACAO_CAP_30"),16,0,32),1,120),count("VALOR_AMORTIZACAO_JTP_100"),count(distinct "VALOR_AMORTIZACAO_JTP_100"),sum(sys_op_opnsize("VALOR_AMORTIZACAO_JTP_100")),substrb(dump(min("VALOR_AMORTIZACAO_JTP_100") (((, 16,0,32),1,120),substrb(dump(max("VALOR_AMORTIZACAO_JTP_100") 16.0, 32), 1, 120) of "FGAI". "' VALOR_PAG_EXPORTA_SGH ' sample (1.3989586355) t
    -PL/SQL call stack-
    the line object
    serial number of handle
    body 0x11e3be750 1216 package SYS. DBMS_SYS_SQL
    body 0x11e3cc878 334 package SYS. DBMS_SQL
    body 0x11e6c2728 11791 package SYS. DBMS_STATS
    body 0x11e6c2728 13987 package SYS. DBMS_STATS
    body 0x11e6c2728 14454 package SYS. DBMS_STATS
    body 0x11e6c2728 14925 package SYS. DBMS_STATS
    package body 21201 0x11e6c2728 SYS. DBMS_STATS

    Thank you!

    Published by: user13521923 on 02/10/2011 04:42

    Hello

    Refer to Metalink Doc ID 455202.1

    HTH
    Anand

  • Why ORA-06512: at "SYS." DBMS_SCHEDULER', line 1794

    Hi, I do the following

    -creation of a beginning of program
    BEGIN
    () dbms_scheduler.create_program
    program name = > "MAINTAIN_DDI_PROGRAM"
    program_type = > 'procedure_stockee ',.
    program_action = > 'MAINTAIN_DDI ',.
    number_of_arguments = > 1,
    activated = > FALSE,
    Comments = > 'MAINTAIN_DDI');
    END;
    /
    -creation of a program end

    -set the program argument starts
    BEGIN
    () dbms_scheduler.define_program_argument
    program name = > "MAINTAIN_DDI_PROGRAM"
    argument_name = > 'p_User ',.
    argument_position = > 1,
    argument_type = > 'VARCHAR2 ',.
    default_value = > 'SYSTEM');
    END;
    /
    -end of the argument to define program

    -creation of schedules departure
    Start
    () DBMS_SCHEDULER.create_schedule
    schedule_name = > "MAINTAIN_DDI_SCHEDULE"
    start_date = > SYSTIMESTAMP,
    repeat_interval = > ' FREQ = DAILY; BYHOUR = 0',
    End_date = > ",
    Comments = > 'MAINTAIN_DDI_SCHEDULE_COMMENTS');
    end;
    /

    -creation of end times

    -creation of the beginning of the task
    Start

    DBMS_SCHEDULER. () CREATE_JOB
    job_name = > 'MAINTAIN_DDI_JOB ',.
    program name = > "MAINTAIN_DDI_PROGRAM"
    schedule_name = > 'MAINTAIN_DDI_SCHEDULE');

    () DBMS_SCHEDULER.set_attribute
    name = > 'MAINTAIN_DDI_JOB ',.
    attribute = > "job_class"
    value = > "daily_job_class");

    end;
    /
    -activation of the start of work
    SQL > exec DBMS_SCHEDULER. SELECT ("MAINTAIN_DDI_JOB");
    DBMS_SCHEDULER BEGIN. SELECT ("MAINTAIN_DDI_JOB"); END;

    *
    ERROR on line 1:
    ORA-27486: insufficient privileges
    ORA-06512: at "SYS." DBMS_ISCHED', line 2751
    ORA-06512: at "SYS." DBMS_SCHEDULER', line 1794
    ORA-06512: at line 1
    -end of jobs

    ---

    -> Why don't I have this error?

    SQL > select distinct privilege of user_sys_privs;

    PRIVILEGE
    ----------------------------------------
    CREATE JOBS
    UNLIMITED TABLESPACE
    MANAGE SCHEDULER

    = > cannot be doesn't have enough privileges listed in the Administrator's Guide to Oracle database on pg 27-2

    to turn on work, I just need to own.

    SELECT job_name, job_type, job_action, owner, system, activated from all_scheduler_jobs;

    OWNER JOB_NAME J JOB_ACTION SYSTEM ENABL
    -------- ----------------------- - ------------------------------ ----- -----
    PROCMASK MAINTAIN_DDI_JOB_2 TRUE FALSE
    PROCMASK MAINTAIN_DDI_JOB FALSE FALSE

    So I created another job using a program named with the same name of program but no schedule_name

    BEGIN
    DBMS_SCHEDULER. () CREATE_JOB
    job_name = > 'MAINTAIN_DDI_JOB_2 ',.
    program name = > "MAINTAIN_DDI_PROGRAM"
    repeat_interval = > ' FREQ = DAILY; BYHOUR = 12',
    Comments = > "every day at noon");
    END;
    /

    DBMS_SCHEDULER exec. SELECT ("MAINTAIN_DDI_JOB_2");

    Why am I able to allow a job created a program called aid, but not able to allow a job using a program named creation and a calendar of name?

    Thank you very much!

    Published by: oraclewannabe2 on September 23, 2008 20:55

    Hello

    You probably need to grant access to the owner of the task running on the job class.

    Login as SYS or the creator of the category of jobs and

    Grant execute on sys.daily_job_class to job_owner;

    Hope this helps,
    Ravi.

  • Error "ORA-01861: literal does not match the format ORA-06512 string.

    Hello
    I am getting error on EBS page when I click on the button

    I wrote the code in CO to insert values in table when the button is clicked

    but when I click the button it gives an error
    ORA-01861: literal does not match the format ORA-06512 string
    I think that his error of date format

    but I tried many styles of formatting but not yet able to fix it

    KAO

    You are right, that this is due to the error in the data type. Share the code that you have coded for button click here.

    Kind regards
    GYAN

  • Why I don't have the error: ORA-14551: cannot perform a DML operation inside a query

    Hello

    create table table_1 (phone number)

    create or replace function function_a return number
      is
        l_rv number;
      begin
        l_rv := dbms_random.value();
        insert into table_1 values(l_rv);
        return l_rv;
      end;
    
    

    Select double function_a

    Now, I get the error:

    ORA-14551: cannot perform a DML operation inside a query

    ORA-06512: at "FUNCTION_A", line 6

    create the table table_2 (phone number)

    insert into table_2 select function_a from dual
    
    

    Now, I make the same mistake. It is to insert records into table_2

    Can someone please clarify this?

    Database Oracle 12 c Enterprise Edition Release 12.1.0.1.0 - 64 bit Production

    Post edited by: O - O added: (select double function_a)

    O - O wrote:

    To be called from instructions SQL, stored function must obey "purity" following rules, which are intended to control the side effects:

    • rule1) When it is called from a SELECT statement or a parallelized INSERT , UPDATE , or DELETE statement, the function cannot change database tables.
    • rule2) When it is called from a INSERT , UPDATE , or DELETE statement, the function cannot query or modify database tables modified by that statement.

    Can you please explain this? I think that these statements are contradicted with

    insert into select double function_a table_2

    Now, I make the same mistake. It is to insert records into table_2

    When your function is called by a select statement, an error is triggered because of rule1).

    When your function is called in an insert statement, no error is raised. The insert does not work in parallel (this is an insert row after all). So rule1) is also not infringed. The insert is on the table2, change table1. Because it does not modify the same table rule2) is not violated. So no reason to trigger an error.

  • ORA-06512: at "SYS." UTL_HTTP"ORA-29259: end-of-entry available on UTL_HTTP. GET_RESPONSE

    Hi all

    I call using UTL_HTTP and SOAP_API Web services, mentioned below, similarly

    FUNCTION to CREATE or REPLACE add_numbers (p_int_1 in NUMBER, p_int_2 number)

    RETURN NUMBER

    AS

    l_request soap_api.t_request;

    l_response soap_api.t_response;

    l_return VARCHAR2 (32767).

    l_url VARCHAR2 (32767).

    l_namespace VARCHAR2 (32767).

    l_method VARCHAR2 (32767).

    l_soap_action VARCHAR2 (32767).

    l_result_name VARCHAR2 (32767).

    BEGIN

              l_url := ' http://oracle-base.com/webservices/server.php';

    " l_namespace: = ' xmlns =" http://Oracle-base.com/webservices/ "';

    l_method: = 'ws_add ';

    l_soap_action: = ' http://oracle-base.com/webservices/server.php/ws_add';

    l_result_name: = 'back ';

    l_request: = soap_api.new_request (p_method = > l_method,)

    p_namespace = > l_namespace);

    soap_api.add_parameter (p_request = > l_request,)

    p_name = > 'int1 ',.

    p_type = > ' xsd: Integer.

    p_value = > p_int_1);

    soap_api.add_parameter (p_request = > l_request,)

    p_name = > "int2"

    p_type = > ' xsd: Integer.

    p_value = > p_int_2);

    l_response: = soap_api.invoke (p_request = > l_request,)

    p_url = > l_url,

    p_action = > l_soap_action);

    l_return: = soap_api.get_return_value (p_response = > l_response,)

    p_name = > l_result_name,

    p_namespace = > NULL);

    RETURN l_return;

    END;

    It works very well when the number of records is less (the XML output is small), but when the number of records in the source database is passed then I'm not able to get the output XML file.

    I get the error message,

    error code:-29273, msg error: ORA-29273: HTTP request failed

    ORA-06512: at "SYS." UTL_HTTP", line 1369

    ORA-29259: end-of-input reached

    I am gettting error on line,

    L_HTTP_RESPONSE: = UTL_HTTP. GET_RESPONSE (L_HTTP_REQUEST);

    Can someone help me with this problem? Is it possible to increase the size HTTP_RESPONSE?

    Thank you

    Abbas Qureshi

    Hello

    have you checked the end of your XML data? You wrote:

    > Looped it returns two values XML we have a length 32767 and other is 122.
    Perhaps you can see which part of your HTTP response is missing.

    Kind regards

    WoG

  • ORA-06512: at "SYS." DBMS_XMLGEN", (ORA-00942: table or view does not exist)

    Hey guys, it's Xev.

    I decide to use SQL and XML and it works in a scenario, but in another scenario, is not.

    Here's the Code, I'm passing to two variables, first of all, I spend in the table table_name, and then I spend in the schema.

    If I connected it with "user" and that it seeks it's own pattern, he found the results, as for example, but if I try to run this code while not

    connected to the same user I'm looking for more, I get this error.

    ORA-19202: an error has occurred in the processing of XML

    ORA-00942: table or view does not exist

    ORA-06512: at "SYS." DBMS_XMLGEN", line 288

    ORA-06512: at line 1

    19202 00000 - "an error has occurred in the treatment of XML %s.

    * Cause: An error occurred during the processing of the XML function

    * Action: Check the given error message and resolve the problem appropriate

    /*-------------------------------------------------------------------------------

    This code works only you are connected to the user you are looking on.

    But if you're looking for a different user tables, it is kicking up and gives the above XML error...

    */

    SET SERVEROUTPUT ON

    exec DBMS_OUTPUT. ENABLE (1000000);

    Search_string VAR VARCHAR2 (28)

    EXEC: search_string: = ' ^ [0-9]{3}-[0-9]{2}-[0-9]{4}$']

    COLUMN "Keyword" FORMAT A28

    COLUMN 'Table' FORMAT A9

    COLUMN ' column value / "FORMAT A50

    SELECT DISTINCT SUBSTR (: search_string, 1: 28) "keyword."

    SUBSTR (table_name, 1, 14) "table."

    SUBSTR (t.column_value.getstringval (), 1, 50) ' / value of the column.

    OF dba_tab_cols.

    -where owner = ('& SCHEMA_NAME')

    TABLE

    (XMLSEQUENCE

    (DBMS_XMLGEN. GETXMLTYPE

    ("SELECT" | column_name |)

    'FROM ' | table_name |

    "WHERE REGEXP_LIKE.

    (' | column_name |) ','''

    || : search_string. ''')'

    () .extract (' LINES/rowset / * ""))) t

    -WHERE table_name IN ("FIND_TEST")

    WHERE table_name = upper ('& table_name')

    AND the OWNER = upper ('& SCHEMA_NAME')

    ORDER BY "Table".

    /

    Can someone please explain how works (DBMS_XMLGEN) and why it is throwing this error?

    Thank you

    Xev.

    It has nothing to do with DBMS_XMLGEN. GETXMLTYPE. It simply means the user running your SQL has no select privileges on the table & SCHEMA_NAME. & TABLE_NAME.

    SY.

  • Sending a message using UTL_SMTP, get the error ORA-29278: SMTP temporary error

    Hi all

    I try to send mail from oracle plsql. for that I use the below mode operative but unfortunately not able to move forward.
    SQL> select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    procedure is
    CREATE OR REPLACE PROCEDURE send_mail (p_to        IN VARCHAR2,
                                           p_from      IN VARCHAR2,
                                           p_message   IN VARCHAR2)
    AS
      l_mail_conn   UTL_SMTP.connection;
      l_reply utl_smtp.reply;
      l_smtp_host VARCHAR2(50) := 'smtp.gmail.com:25';
      l_smtp_port NUMBER := 25;  
    BEGIN
      l_mail_conn := UTL_SMTP.open_connection(l_smtp_host, l_smtp_port);
      utl_smtp.EHLO(l_mail_conn, l_smtp_host);
      utl_smtp.command(l_mail_conn, 'AUTH LOGIN');
      utl_smtp.command(l_mail_conn, utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('[email protected]'))));
      utl_smtp.command(l_mail_conn, utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('mypwd'))));
      l_reply :=UTL_SMTP.mail(l_mail_conn, p_from);
      dbms_output.put_line( l_reply.code || ' ' || l_reply.text );
      UTL_SMTP.rcpt(l_mail_conn, p_to);
      UTL_SMTP.write_data(l_mail_conn, p_message || UTL_TCP.crlf || UTL_TCP.crlf);
      UTL_SMTP.quit(l_mail_conn);
    END;
    /
    call you as follows
    declare
     conn        utl_smtp.connection;
     smtp_domain VARCHAR2(256) := null;
     BEGIN
     utl_smtp.command(conn,'STARTTLS');
     utl_smtp.helo(conn, smtp_domain);
       send_mail(p_to        => '[email protected]',
                 p_from      => '[email protected]',
                 p_message   => 'can i get message.');
     END;
     /
    and the error
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 159
    ORA-06512: at line 5
    I checked in Control Panel that IIS is installed and also SMTP is configured.
    I am able to ping HOST SMTP thro' TELNET

    and I changed the parameter, SMTP_OUT_SERVER, as
    ALTER SYSTEM SET SMTP_OUT_SERVER= 'smtp.gmail.com:25' scope = both
    I don't get no idea. is this due to use the GMAIL Server?

    Oracle 10 g and Windows version is XP - SP3

    Thanks for any help

    Concerning
    Knockaert

    When I googled for "Gmail PL/SQL" I find a lot of things, including the articles of blog with code examples. How about you?

  • get the error ORA-04088

    Hello

    I created a trigger to trigger the error if a trial off to enter data in a column that is attached to a number sequence.
    This trigger works, but with errors, these errors become after trying to insert values into the table.

    The errors are:

    Insert into test2 values(24,'horse','hyderabad',30); - 30 here is worth attempting to enter the column use
    Error report:
    SQL error: ORA-20101: insertion of the value to enter the not allowed... It will take the auto-numbering
    ORA-06512: at "SCOTT. TRI_UNQID', line 11
    ORA-04088: error during execution of trigger ' SCOTT. TRI_UNQID'


    My trigger is
    create or replace
    trigger tri_unqid
    before insert on test2 
    for each row
    declare
    v_number number(2);
    ins_exp exception;
    begin
    if :new.regid is not null  then
    raise ins_exp;
    else 
    select unqid.nextval into v_number from dual;
    :new.regid:=v_number;
    end if;
    exception
    when ins_exp then
    raise_application_error(-20101,'inserting the regid value not allowed.. it will take auto number');
    end tri_unqid;
    Output:
    It's the execution and throw my exception and other... I am not able to solve...
    and another point is if it is inserted successfully with errors, then it's values are inserted into the table at the front not the end of the records... How is it going...

    can any body explain

    Thank you
    Baba

    Published by: BluShadow on April 11, 2013 10:26
    fixed {noformat}
    {noformat} tags.  The "code" in the tag is enclose in "{" and "}", not "&lt;" and "&gt;"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    It's the execution and throw my exception and other... I am not able to solve...

    This is because there is no problem.

    Check your error message

    
    SQL Error: ORA-20101: inserting the regid value not allowed.. it will take auto number
    ORA-06512: at "SCOTT.TRI_UNQID";, line 11
    ORA-04088: error during execution of trigger 'SCOTT.TRI_UNQID' 
    

    Read from the bottom up. Oracle means

    1. a SCOTT trigger. TRI_UNQID caused an error
    2. the error occurred on line number 11
    3. the error message is ' insertion of the value to enter the not allowed... " It will take auto number.

    Why oracle has to say what trigger or procedure caused the error? Because there might be several trigger or procedure that may generate the same error if a user just need to know what is causing the error. And a line number is always helpful for debugging.

    So everything is good here. There is no problem to solve.

    and another point is if it is inserted successfully with errors, then it's values are inserted into the table at the front not the end of the records... How is it going...

    In a HEAP organized table this is SO forward or back (order of the lines is not relevant). If you want to display the records in an orderly manner use the ORDER BY Clause in the SELECT statement.

    So all is good here as well.

Maybe you are looking for