The output is always 'anonymous block completed.

Hello

I wrote a simple stored procedure as shown:

create or replace procedure display
*(*
Ename on emp.ename%type
*)*
is
Start
Select ename ename from emp where empno = '7369';
end;

I tried to run the help above this block

declare
Ename emp.ename%type;
Start
Display (ename);
dbms_output.put_line (ename);
end;

I always get the output as "anonymous block filled" and nothing else.

Help, please. Thank you.

I tried myself and her work.
In any case, environment in which you work: DB, OS version and software...

Saad,

Tags: Database

Similar Questions

  • Assistant of the output instrument always 0.0 without input series, where's the trigger? -Noob question

    Guys keep with me, I'm another PLCs and VB/C programmer, there are still the old paradigms of locking my head.

    See attached vi. After that I disconnected the entry in the series, the wizard exits still instrument 0,0 to its terminal at regular intervals about 1 hz. Now how does the wizard output always inst 0.0 without a trigger entry series? There must be a timer somewhere... but I searched everywhere there is no timer, including by opening the front panel of the wizard of the instrument. I watch the whole bulk of the loop and block VISA etc, there is no synchronization setting.

    So my question is, if there is no entry of series by using the instrument, which is the parameter object that triggers the instrument Wizard still out 0,0 at regular intervals? Where the object/setting?

    Thanks in advance

    Great big thank you! I can sleep tonight! Muahahahahahha!

  • How to use a button to fire the stored procedure or anonymous block PLSQL

    I am converting an application forms at the APEX, and which was easy became almost unbelievably difficult. I have a page that represents a record with an element called "history_rec". It is an element of the checkbox. Clicking on it causes the column for this record to be filled with the letter 'H', indicating that this recording is now historical and not assets. I also have this page a button that says "Renew Record." This button redirects to the current page and sets the value of 5 elements of the page on the values of the record being replaced with the new record.

    (This, incidentally, is an insurance system of follow-up to the loan guarantees. The insurance must be renewed annually, and this system is used to ensure that it is.)

    I also want the button to trigger a process that updates the old record by filling in the history_rec column. To do this, I created a process called "make_history" that contains the following SQL code:

    "Ensure the update
    Set history_rec = "H".
    "where insureseq =: P22_INSURESEQ.

    I chose for the 'process' Point ' on demand: run this process when requested by AJAX. "

    Is it possible my button 'Renew the Record' and if so, how? If this is not the case, how should I proceed?

    Doug,

    I'm glad you've made any progress.

    What process throws the error, it is the last process?

    "Error Unable to fetch row ' with this code ORA" ORA-01403: no data found. "

    Is page 21 page that you develop?

    I want to make is that demand for return on page 21

    What you already have for the branches Page?

    Jeff

  • Help by calling the dynamic columns in anonymous blocks

    my code:

    DECLARE
    col1 VARCHAR2 (20): = "City";

    BEGIN
    I'm in (select * from xbd.cus_ord where rownum < 10)
    LOOP
    - I would call col1 dynamically here in my outings DBMS.
    DBMS_OUTPUT. Put_line (i.col1);
    END LOOP;
    END;
    /


    The code above I tried to call a dynamic column. How can I do that.
    I Heve been tried differently using EXECUTE IMMEDIATE. It still does not work.

    THX,
    VI
    DECLARE
       col1        VARCHAR2(30)   := 'object_name';
    
       TYPE REF_CURSOR IS REF CURSOR;
    
       refCursor   REF_CURSOR;
       text        VARCHAR2(4000);
    BEGIN
       OPEN refCursor FOR 'SELECT ' || col1 || ' FROM all_objects WHERE ROWNUM < 10';
    
       LOOP
          FETCH refCursor
           INTO text;
    
          EXIT WHEN refCursor%NOTFOUND;
          DBMS_OUTPUT.PUT_LINE(text);
       END LOOP;
    END;
    /
    
  • Works of anonymous block - failure of the procedure

    Hi guys,.

    I am new to PL/SQL, and right now, I have problems with a new procedure.

    If I execute the instructions of an anonymous block, then everything works fine.
    As a stored procedure, it fails: PLS-00306: wrong number or types of arguments.

    I don't understand - could you please help me?


    Oracle Database 10 g Express Edition Release 10.2.0.1.0 - product
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE 10.2.0.1.0 Production."
    AMT for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production


    The procedure inserts data in multiple tables - so the original procedure has 800 lines.
    I tested it with a shorter version, but it still does not work as a procedure.


    Here is the execute statement:
    begin
    P_P5020_test (
      i_GespAnrede_tx                   => 'Herr',
      i_GespName_tx                     => 'GespName',
      i_GespVorname_tx                  => 'GespVorname',
      i_GespTitel_tx                    => 'GespTitel',
      i_GespStelle_tx                   => 'GespStelle',
      i_GespFunktion_isn                => 1,
      i_GespBereich_isn                 => 1,
      i_GespTelNr_nr                    => '1111',
      i_GespTelNrArt_isn                => 1,
    -- Daten vom Ansprechpartner:
      i_ApAnrede_tx                     => 'Frau',
      i_ApName_tx                       => 'ApName',
      i_ApVorname_tx                    => 'ApVorname',
      i_ApTitel_tx                      => 'Aptitel',
      i_ApStelle_tx                     => 'ApStelle',
      i_ApFunktion_isn                  => 2,
      i_ApBereich_isn                   => 2,
      i_ApTelNr_nr                      => '2222',
      i_ApTelNrArt_isn                  => 1,
    -- Allgemeine Parameter:
      i_UN_nr                           => 110532,
      i_TelNr_isn                       => 54,
      i_hiber_isn                       => 4,
      i_AnlVon_tx                       => 'SMY',
      i_TaskArt_isn                     => 12,
      i_Bemerkung_tx                    => 'Bemerkung'
             );
    END; 
    and here is the procedure:

    create or replace
    PROCEDURE p_P5020_test
    --
    -- Parameter:
    --
      (
    -- Daten vom Gesprächspartner:
      i_GespAnrede_tx varchar2,
      i_GespName_tx varchar2,
      i_GespVorname_tx varchar2,
      i_GespTitel_tx varchar2,
      i_GespStelle_tx varchar2,
      i_GespFunktion_isn number,
      i_GespBereich_isn number,
      i_GespTelNr_nr varchar2,
      i_GespTelNrArt_isn number,
    -- Daten vom Ansprechpartner:
      i_ApAnrede_tx varchar2,
      i_ApName_tx varchar2,
      i_ApVorname_tx varchar2,
      i_ApTitel_tx varchar2,
      i_ApStelle_tx varchar2,
      i_ApFunktion_isn number,
      i_ApBereich_isn number,
      i_ApTelNr_nr varchar2,
      i_ApTelNrArt_isn number,
    -- Allgemeine Parameter:
      i_UN_nr number,
      i_TelNr_isn number,
      i_hiber_isn number,
      i_anlVon_tx varchar2,
      i_TaskArt_isn number,
      i_sonstGrund_tx varchar2,
      i_Bemerkung_tx varchar2,
    -- für die Task:
      i_BeginnDatum_dt date,
      i_BeginnZeit_ts timestamp,
      i_FaelligVonDatum_dt date,
      i_FaelligVonZeit_ts timestamp,
      i_FaelligBisDatum_dt date,
      i_FaelligBisZeit_ts timestamp,
      i_TaskPrio_isn number
      )
    --
    --------------------------------------------------------------------------------
    --
    IS
    --
    -- Variablen:
    --
      v_MA_nr number := 4;
      v_GespBez_nr number;                -- return BezNr vom Gesprächspartner
      v_ApBez_nr number;                  -- return BezNr vom Ansprechpartner
      v_Task_nr number;                   -- return TaskNr für die Kon
      v_TaskThema_tx varchar2(40);            -- anhand taskart ermitteln
    -- für die Beziehung:
      v_BezGueltigVon_dt date := sysdate;
      v_BezGueltigBis_dt date := to_date('31.12.2099', 'DD.MM.YYYY');
    -- für die Notiz / Kon:
      v_KonThema_tx varchar2(40);
      v_KonArt_isn number;
      v_KonWeg_isn number := 2;           -- 2 = Telefon
      v_KonDatum_dt date := sysdate;
      v_KonUhrzeit_ts timestamp := systimestamp;
    --
    --
    --------------------------------------------------------------------------------
    --
    BEGIN
    -- select into für variablen durchführen
    --
    --
    -- v_taskThema_tx füllen
      IF i_taskArt_isn != 999999
      THEN
        SELECT
          TASK_ART_NAME
        INTO v_taskThema_tx
        FROM T_TASK_ART
        WHERE task_art_isn = i_taskArt_isn;
    
    --
    --
    -- v_KonArt_ISN füllen
        IF i_TaskArt_isn = 10    -- Nennung verweigert
        THEN v_KonArt_ISN := 13;
        END IF;
        IF i_TaskArt_isn = 11    -- krank 
        THEN v_KonArt_ISN := 7; 
        END IF;
        IF i_TaskArt_isn = 12    -- Urlaub
        THEN v_KonArt_ISN := 8;
        END IF;
        IF i_TaskArt_isn = 13    -- nicht am Platz
        THEN v_KonArt_ISN := 9;
        END IF;
        IF i_TaskArt_isn = 14    -- Feierabend
        THEN v_KonArt_ISN := 10;
        END IF;
        IF i_TaskArt_isn = 15    -- Besprechung
        THEN v_KonArt_ISN := 11;
        END IF;
        IF i_TaskArt_isn = 16    -- zu Tisch
        THEN v_KonArt_ISN := 12;
        END IF;
        IF i_TaskArt_isn = 17    -- sonstiger Grund
        THEN v_KonArt_ISN := 14;
        END IF;
    --
    --
    -- v_konThema_tx füllen
        SELECT
          kon_art_name
        INTO v_konThema_tx
        FROM T_KON_ART
        WHERE kon_art_isn = v_konArt_isn;
    --
    --
      END IF; -- i_taskArt_isn != 999999
    --
    --
    --------------------------------------------------------------------------------
    --
    --
    --
        IF i_ApName_tx IS NOT NULL      -- AP gefüllt? 
     -- dann Gesp anlegen
        THEN
          INSERT INTO t_bez
            (
            bez_un_nr,
            bez_anrede,
            bez_titel,
            bez_name,
            bez_vorname,
            bez_stelle,
            bez_funktion_isn,
            bez_bereich_isn,
            bez_bemerkung,
            bez_gueltig_von,
            bez_gueltig_bis,
            bez_anlvon
            )
          VALUES
            (
            i_un_nr,              -- bez_un_nr
            i_GespAnrede_tx,      -- bez_anrede
            i_GespTitel_tx,       -- bez_titel
            i_GespName_tx,        -- bez_name
            i_GespVorname_tx,     -- bez_vorname
            i_GespStelle_tx,      -- bez_stelle
            i_GespFunktion_isn,   -- bez_funktion_isn
            i_GespBereich_isn,    -- bez_bereich_isn
            'Als Gesprächspartner angelegt, '||           -- bez_bemerkung 
            to_char(sysdate, 'DD.MM.YYYY - hh24:mi')||
            ' '||
            i_AnlVon_tx||
            ' ',                  
            v_BezGueltigVon_dt,   -- bez_gueltig_von
            v_BezGueltigBis_dt,   -- bez_gueltig_bis
            i_AnlVon_tx           -- bez_anlvon        
            )
          RETURN t_bez.bez_nr INTO v_GespBez_nr;
      -- telefonnummer anlegen
          INSERT INTO t_telnr
            (
            telnr_von,
            telnr_vonnr,
            telnr_nr,
            telnr_art_isn,
            telnr_anlvon
            )
          VALUES
            (
            'BEZ',                  -- telnr_von
            v_GespBez_nr,           -- telnr_vonnr
            i_GespTelNr_nr,         -- telnr_nr
            i_GespTelNrArt_isn,     -- telnr_art_isn
            i_AnlVon_tx             -- telnr_anlvon        
            )
          ;
    --
    --
    -- jetzt AP anlegen
          INSERT INTO T_BEZ
            (
            bez_un_nr,
            bez_anrede,
            bez_titel,
            bez_name,
            bez_vorname,
            bez_stelle,
            bez_funktion_isn,
            bez_bereich_isn,
            bez_bemerkung,
            bez_gueltig_von,
            bez_gueltig_bis,
            bez_anlvon        
            )
          VALUES
            (
            i_un_nr,            -- bez_un_nr
            i_ApAnrede_tx,      -- bez_anrede
            i_ApTitel_tx,       -- bez_titel
            i_ApName_tx,        -- bez_name
            i_ApVorname_tx,     -- bez_vorname
            i_ApStelle_tx,      -- bez_stelle
            i_ApFunktion_isn,   -- bez_funktion_isn
            i_ApBereich_isn,    -- bez_bereich_isn
            'Als Ansprechpartner angelegt, '||           -- bez_bemerkung 
            to_char(sysdate, 'DD.MM.YYYY - hh24:mi')||
            ' '||
            i_AnlVon_tx||
            ' ',                  
            v_BezGueltigVon_dt,   -- bez_gueltig_von
            v_BezGueltigBis_dt,   -- bez_gueltig_bis
            i_AnlVon_tx           -- bez_anlvon          
            )
          RETURN t_bez.bez_nr INTO v_ApBez_nr;
    -- jetzt TelNr anlegen
          INSERT INTO t_telnr
            (
            telnr_von,
            telnr_vonnr,
            telnr_nr,
            telnr_art_isn,
            telnr_anlvon
            )
          VALUES
            (
            'BEZ',                -- telnr_von
            v_ApBez_nr,           -- telnr_vonnr
            i_ApTelNr_nr,         -- telnr_nr
            i_ApTelNrArt_isn,     -- telnr_art_isn
            i_AnlVon_tx           -- telnr_anlvon        
            )
          ;  
        END IF; -- i_ApName_tx IS NOT NULL
    --
    ---------------------------------------
    --
    --
    -- AP nicht gefüllt:
    --
        IF i_ApName_tx IS NULL
        THEN
      -- Gesprächspartner als Ansprechpartner anlegen
          INSERT INTO t_bez
            (
            bez_un_nr,
            bez_anrede,
            bez_titel,
            bez_name,
            bez_vorname,
            bez_stelle,
            bez_funktion_isn,
            bez_bereich_isn,
            bez_bemerkung,
            bez_gueltig_von,
            bez_gueltig_bis,
            bez_anlvon
            )
          VALUES
            (
            i_un_nr,              -- bez_un_nr
            i_GespAnrede_tx,      -- bez_anrede
            i_GespTitel_tx,       -- bez_titel
            i_GespName_tx,        -- bez_name
            i_GespVorname_tx,     -- bez_vorname
            i_GespStelle_tx,      -- bez_stelle
            i_GespFunktion_isn,   -- bez_funktion_isn
            i_GespBereich_isn,    -- bez_bereich_isn
            'Als Ansprechpartner angelegt, '||           -- bez_bemerkung 
            to_char(sysdate, 'DD.MM.YYYY - hh24:mi')||
            ' '||
            i_AnlVon_tx||
            ' ',                  
            v_BezGueltigVon_dt,   -- bez_gueltig_von
            v_BezGueltigBis_dt,   -- bez_gueltig_bis
            i_AnlVon_tx           -- bez_anlvon        
            )
          RETURN t_bez.bez_nr INTO v_ApBez_nr;    -- Achtung: wird als AP angelegt!
      -- telefonnummer anlegen
          INSERT INTO t_telnr
            (
            telnr_von,
            telnr_vonnr,
            telnr_nr,
            telnr_art_isn,
            telnr_anlvon
            )
          VALUES
            (
            'BEZ',                  -- telnr_von
            v_ApBez_nr,           -- telnr_vonnr ACHTUNG: vom AP!
            i_GespTelNr_nr,         -- telnr_nr
            i_GespTelNrArt_isn,     -- telnr_art_isn
            i_AnlVon_tx             -- telnr_anlvon        
            )
          ;      
        END IF; -- i_ApName_tx IS NULL
    --------------------------------------------------------------------------------
    --
    END;
    Here are the variables of the anonymous block work - the instructions are the same:
    declare
      i_GespAnrede_tx varchar2(4)       := 'Herr';
      i_GespName_tx varchar2(60)        := 'GespName';
      i_GespVorname_tx varchar2(30)     := 'GespVorname';
      i_GespTitel_tx varchar2(10)       := 'GespTitel';
      i_GespStelle_tx varchar2(60)      := 'GespStelle';
      i_GespFunktion_isn number         := 1;
      i_GespBereich_isn number          := 1;
      i_GespTelNr_nr varchar2(20)       := '111111';
      i_GespTelNrArt_isn number         := 1;
    -- Daten vom Ansprechpartner:
      i_ApAnrede_tx varchar2(4)         := 'Frau';
      i_ApName_tx varchar2(60)          := 'ApName';
      i_ApVorname_tx varchar2(30)       := 'ApVorname';
      i_ApTitel_tx varchar2(10)         := 'ApTitel';
      i_ApStelle_tx varchar2(60)        := 'ApStelle';
      i_ApFunktion_isn number           := 2;
      i_ApBereich_isn number            := 2;
      i_ApTelNr_nr varchar2(20)         := '222222';
      i_ApTelNrArt_isn number           := 1;
    -- Allgemeine Parameter:
      i_UN_nr number                    := 110532;
      i_TelNr_isn number                := 54;
      i_hiber_isn number                := 4;
      i_AnlVon_tx varchar2(5)           := 'SMY';
      i_TaskArt_isn number              := 12;
      i_sonstGrund_tx varchar2(15);
      i_Bemerkung_tx varchar2(50);
      --
      v_MA_nr number := 4;
      v_GespBez_nr number;                -- return BezNr vom Gesprächspartner
      v_ApBez_nr number;                  -- return BezNr vom Ansprechpartner
      v_Task_nr number;                   -- return TaskNr für die Kon
      v_TaskThema_tx varchar2(40);            -- anhand taskart ermitteln
    -- für die Beziehung:
      v_BezGueltigVon_dt date := sysdate;
      v_BezGueltigBis_dt date := to_date('31.12.2099', 'DD.MM.YYYY');
    -- für die Notiz / Kon:
      v_KonThema_tx varchar2(40);
      v_KonArt_isn number;
      v_KonWeg_isn number := 2;           -- 2 = Telefon
      v_KonDatum_dt date := sysdate;
      v_KonUhrzeit_ts timestamp := systimestamp;
    Why is - it works for anonymous block - bute the procedure fails with PLS-00306: wrong number or types of arguments?

    Thank you

    Sven

    Edited by: 923182 the 25.03.2012 06:38

    Welcome to the forum!

    Thank you for providing your information to Oracle version. You must provide this whenever you post a new question.

    All parameters for procedures and functions must be listed in the method call unless the parameter has a DEFAULT value.

    You said a procedure with 32 settings but have listed only 24 in the method call.
    It's ok if the 8 other parameters have default values, but they do not. You can use NULL by DEFAULT, if a parameter does not need to have a value or cannot be used.

    Your anonymous block does not call the procedure, there is no 'settings', that's why you don't see the problem there.

    See specification of default values for the parameters of subprogramme in the PL/SQL language reference
    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/subprograms.htm#i23202

    >
    By initializing formal IN the settings to the default values, you can pass a different number of actual parameters to a subprogram, accepting the default values to the actual parameters is omitted. You can also add new formal parameters without having to change all calls to the subprogramme.

    If a real parameter is omitted, the default value of the corresponding formal parameter is used.

    You can't ignore a formal parameter by omitting its actual parameter. To omit the first parameter and specify the second, use named notation (see passing parameters real subprogramme positional, Named or mixed Notation).

    You cannot assign NULL to an uninitialized formal parameter by omitting its actual parameter. You must assign NULL as default or explicitly pass null.
    >
    You can also use nototation "Named" when you specify parameters by name

    See passing parameters real subprogramme positional, Named or mixed Notation in the same doc.

    raise_salary(amount => bonus, emp_id => emp_num);
    
  • Anonymous block Source code

    How can I request/access to the source code of an anonymous block? For example, if I want the source of a particular procedure, it is accessible from the table 'all_source. Even if she throws the source for an anonymous block after it is done with her, always store it somewhere while it's executing analysis, it should at least be accessible as part of the package as follows:
    declare
        src_code varchar2;
    begin
        select source
        into   src_code
        from   wherever the DB stores it;
    
        dbms_output.put_line(src_code);
    end;

    How can I request/access to the source code of an anonymous block

    If you give the anonymous block a unique label, you might be able to query v$ sql:

    SQL> col guid new_val guid
    SQL>
    SQL> select sys_guid() guid from dual
      2  /
    
    GUID
    --------------------------------
    C418F340066DF07FE04017AC25922063
    
    SQL>
    SQL> declare
      2    sql_text   long;
      3    label      long := '&&guid';
      4  begin
      5    select sql_fulltext
      6      into sql_text
      7      from v$sql
      8     where sql_fulltext like '%' || label || '%';
      9
     10    dbms_output.put_line ('SQL of anonymous block:');
     11    dbms_output.put_line (sql_text);
     12  end;
     13  /
    old   3:   label      long := '&&guid';
    new   3:   label      long := 'C418F340066DF07FE04017AC25922063';
    SQL of anonymous block:
    declare
      sql_text   long;
      label      long := 'C418F340066DF07FE04017AC25922063';
    begin
      select sql_fulltext
        into sql_text
        from v$sql
    
    where sql_fulltext like '%' || label || '%';
    
      dbms_output.put_line ('SQL of anonymous block:');
      dbms_output.put_line (sql_text);
    end;
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
  • Unexpected result with select max (colmn) in anonymous block

    Hello

    The following query gives me 28 800 like sum (sal)
    SELECT SUM(salary)
    FROM employees 
        WHERE department_id =60
    O/P is :  28800
    But when I use the above query in anonymous block, it gives me 684400
    DECLARE
     v_sum_sal NUMBER;
     department_id employees.department_id%TYPE := 60;
    BEGIN
        dbms_output.put_line ('The department_id is'||department_id);
       SELECT SUM(salary)
          into v_sum_sal 
        FROM employees 
        WHERE department_id = department_id ;
       dbms_output.put_line ('The sum of sal is'||v_sum_sal);
    END;
    Exit instructions above gives me 684400 as output... But the grounds are 28800

    You can me why the output differs block anonymous reference please

    Hello

    What about prefixing all your PL/SQL variables so that they do not match a column_name :

    DECLARE
     v_sum_sal NUMBER;
     v_department_id employees.department_id%TYPE := 60;
    BEGIN
        dbms_output.put_line ('The department_id is'||v_department_id);
       SELECT SUM(salary)
          into v_sum_sal
        FROM employees
        WHERE department_id = v_department_id ;
       dbms_output.put_line ('The sum of sal is'||v_sum_sal);
    END;
    

    Because, with the first names, where clause was equivalent to:

    where 1=1
    
  • How to set the default CMYK Simulation profile in the output preview window

    I've just upgraded to Adobe PDF X Pro since Acrobat 6 Pro. In Acrobat 6, I could just go to advanced options > overview of the separation and it let me check colors in CMYK mode, it was useful for me to check that blacks were pitch black and no registration. I work in the media newspapers and check always that if ads are using the colors in the ads they provide us.

    Now here's my problem, everytime I open a new pdf clients Ad will preview the output it always shows me the colors in Adobe RGB default. It is very annoying, especially when I need to check a ton of ads by clicking and scrolling to say 'Photoshop 5 CMYK default' just so that I could check the black. Is it possible to have as if it was in Acrobat 6? And just always show me the overview of the default CMYK output?

    Edit: typos.

    OK, after fiddling around I figured it. Edit > preferences > color management > under work spaces change CMYK: PhotoShop 5 CMYK default. Now, all of the PDF files appear as CMYK when I click Exit preview.

  • Unable to display the output in the next block

    Hello
    I tried the next block... But unable to see the output
    Could you suggest me in this...
    0-----)
    
    PL/SQL procedure successfully completed.
    Although made setserverout

    but of no use

    Please help me

    Published by: josh1612 on April 5, 2010 12:14 AM

    Hello

    Check if the script given below will print something...

    DECLARE
      ..
    BEGIN
       DBMS_OUTPUT.PUT_LINE('START OF ANONYMOUS BLOCK');
      ..
       DBMS_OUTPUT.PUT_LINE('END OF ANONYMOUS BLOCK');
    END;
    

    If so, check your logic for the results expected, if not... Check the settings of sqlplus

    * 009 *.

    Edited to take off your real script :) forums

    Published by: 009 April 5, 2010 12:18 AM

  • Debug the anonymous block

    Hello
    DBMS_METADATA. GET_DDL package can be used to extract any database object DDL script. I use it to extract the tablespace script. I want to write all the script maps to file. for this I use UTL. FILE to write the file. She run but write a single tablespace file in script. here my Code
    create or replace
    PROCEDURE dpr_clobToFile(p_clob IN CLOB ) 
       IS
    
      c_amount         CONSTANT BINARY_INTEGER := 32767;
      l_buffer         VARCHAR2(32767);
      l_chr10          PLS_INTEGER;
      l_clobLen        PLS_INTEGER;
      l_fHandler       UTL_FILE.FILE_TYPE;
      l_pos            PLS_INTEGER    := 1;
    
    BEGIN
    
      l_clobLen  := DBMS_LOB.GETLENGTH(p_clob);
      l_fHandler := UTL_FILE.FOPEN('DATA_PUMP_DIR', 'MY_FILE','W',c_amount);
    
      WHILE l_pos < l_clobLen LOOP
        l_buffer := DBMS_LOB.SUBSTR(p_clob, c_amount, l_pos);      
        EXIT WHEN l_buffer IS NULL;
        l_chr10  := INSTR(l_buffer,CHR(10),-1);
        IF l_chr10 != 0 THEN
          l_buffer := SUBSTR(l_buffer,1,l_chr10-1);
        END IF;
        UTL_FILE.PUT_LINE(l_fHandler, l_buffer,TRUE);
        l_pos := l_pos + LEAST(LENGTH(l_buffer)+1,c_amount);
      END LOOP;
    
      UTL_FILE.FCLOSE(l_fHandler);
    
    EXCEPTION
    WHEN OTHERS THEN
      IF UTL_FILE.IS_OPEN(l_fHandler) THEN
        UTL_FILE.FCLOSE(l_fHandler);
      END IF;
      RAISE;
    
    END;
    the call of this block anonymous sp
       declare c clob;
    --fHandle  UTL_FILE.FILE_TYPE;
       begin
       -- fHandle := UTL_FILE.FOPEN('DATA_PUMP_DIR', 'MYFILE.TXT', 'w');
        for t in( select tablespace_name from dba_tablespaces where tablespace_name like 'ECP01V1_B010_DATA%')
        loop
         select dbms_metadata.get_ddl('TABLESPACE', t.tablespace_name) into c from dual;
        
         *dpr_clobToFile(c);*
        end loop;
       end;
    There are nearly 100 spaces of tables in my database where the above script write a single script of tablespace to output file. any idea? How can I debug this scenario through SQL DEVELOPER

    Published by: user10858330 on April 2, 2012 02:42

    Hello

    user10858330 wrote:
    There are nearly 100 spaces of tables in my database where the above script write a single script of tablespace to output file. any idea?

    Well, you open the output mode 'w' file each time, take a look at [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/u_file.htm#i1003526] UTL_FILE documentation:

    * open_mode *.

    Specifies how the file is opened. Modes include:
    r - read the text
    w - write text
    to add text
    RB - reading bytes
    World Bank - in mode writing bytes
    AB - append mode bytes

    Therefore, for a loop of 100 case, you replace the DDL 99 times past.

    I see 3 lines of resolution that:
    -Open the file in Add mode (a or ab). But you have to make sure that it contains no tricks of previous test cycles. (ideally, first open the file in mode 'w', then all subsequent occurrences in Add mode ("a" or "ab"))
    -Open outside of the loop (in mode 'w') and close the file when the loop ends
    -Open a different DDL file for each tablespace (perhaps by adding the nom_tablespace in the output file)
    I would prefer #2 or #3 +(depending on how you will be re-using those DDLs) solution.

  • What are the PCI ANALOG OUTPUT PORTS Terminal 6024E block CB-68LP

    Dear all

    I want to get the analog output on the physical output signal. In my LabVIEW diagram, I develop the DAQ assistant and configure ao0 as analog output. The tension I want hovel is analog - 5v to + 5 volts. Terminal block, what will be the output port analog physical that I measure this voltage.

    Waiting for ypur response.

    Kind regards

    Irfan

    In MAX, you can simply right-click on the device and select 'device pinouts. The DAQ Assistant will also show pinout.

  • inhibit the output always active

    On axis 2 of a UMI-7764, inhibition of is constantly active, disabling third party motor driver.  I have 1 configured identically axis in MAX and it works very well with identical equipment.  I traced the problem back at the UMI, otherwise the card controller PCI-7330.  INHOUT2 is constantly on - either high or low according to the polarity switch.  MAX will always the UMI generate command for step and Direction pulses as long as it believes that the axis is not killed.  I do not use of encoders or limit switches at the moment.

    Parameters are the following:

    Enabled, no feedback, step & direction, active high polarity, with disabilities limit output filters and switches, off limits software and available to inhibit the output active high.

    Axis 1 has the same parameters and works very well.

    Cable problem was a PIN that was not connect... resolved.

  • Dbms_metadata in a stored procedure. If the table is in the schema, run the stored procedure the procedure works very well.  If I try to get the table ddl to a different scheme it can't find table in a schema.  I run as an anonymous blocks and it works

    create or replace FUNCTION get_table_md (p_owner in varchar2, p_table IN VARCHAR2) RETURN CLOB IS
    -Define local variables.
    / * declare
    p_owner varchar2 (30): = "AVTYM";
    p_table IN VARCHAR2 (30): = "TRANSACTION_HEADER";
    */
    h NUMBER; -handle returned by OPEN
    e NUMBER; -handle returned by ADD_TRANSFORM
    p_tableref varchar2 (30);
    doc CLOB.
    Doc2 CLOB.
    BEGIN

    -Specify the type of object.
    h: = DBMS_METADATA. OPEN ('TABLE');

    -Use filters to specify the desired object.
    DBMS_METADATA. SET_FILTER (h, 'SCHEMA', p_owner);
    DBMS_METADATA. SET_FILTER (h, 'NAME', p_table);

    -Request that the metadata be transformed into creation DDL.
    th: = DBMS_METADATA. ADD_TRANSFORM (h, 'DDL');

    -Retrieves the object.
    doc: = DBMS_METADATA. FETCH_CLOB (h);


    -Free resources.
    DBMS_METADATA. Close (h);
    p_tableref: = substr (p_table, 1, 25). ' $RDEF';
    Doc2: is REGEXP_replace(doc,p_table,p_tableref,1,1,'im');.
    doc: = REGEXP_replace(doc2,'"CREATE_DT"','"EXCHANGE_DT"',1,2,'im');
    -dbMS_OUTPUT. Put_line (doc);
    RETURN doc;

    END;

    Hello

    check the privilege you may have granted by a role that you need direct access to the object and not by the role. You can test if you are granted by a role, by running the SET command role no and see if you can still run the anonymous block.

    Thank you

  • How to install the output in bridge CC module using an apple OSX 10.9.5 and a miss apple OSX 10.11 this point completely in CC bridge!

    How to install the output in bridge CC module using an apple OSX 10.9.5 and a miss apple OSX 10.11 this point completely in CC bridge!

    Hi abev41080082

    Greetings.

    Concerning

    Rohit

  • Always replace the output file for serial port.

    Hello, I use Workstation 7 on Linux and use the option "Output to a file" serial port for the logging of messages to the client for debugging.

    It works perfectly, however, if the file exists already workstation asking what to do (crush, add, etc.). It works, but I would like to have the option to auto restart, restore, instant, etc. and this message gets in the way.

    Is he a .vmx parameter I can apply to my computer always replace the output file without asking?

    Yep - found

    you need these two lines:

    msg.autoAnswer = 'TRUE '.

    Msg. Serial.file.Open = 'Add '.

    _________________________

    VMX-settings- WS FAQ -[MOAcd | http://sanbarrow.com/moa241.html]- VMDK-manual

    You find me also in the PhD Virtual Backup support team

Maybe you are looking for