Pro*Cobol and DBMS_OUTPUT.PUT_LINE

I am new to Pro*Cobol and had a simple question (I hope).
I have a stored proc that contains DBMS_OUTPUT.PUT_LINE stmts
and I can see those in SQLPlus (when serveroutput=on), but I do
not see them when I call it from Pro*Cobol. Is there a
precompiler setting or something I need to set?

'Far as I know, you'll have to repeatedly call
dbms_output.get_line in your Pro*Cobol program to
get the server output generated by your stored procedure.
Hope that helps.
All the best
Michael

Similar Messages

  • Print and dbms_output.put_line

    wats the diff between prin and dbms_output.put_line

    BEDE wrote:
    Do not expect that the dbms_output.put or .put_line output show while the procedure or PL/SQL block is running. It will show only after it finished running.Unless something else within that PL/SQL execution reads the dbms_output buffer and directs the output somewhere where it can be read during run-time, such as putting it onto a table using an autonomous transaction or putting it out using a web service to another destination etc. Although generally, people don't do that I agree, but it can be done if required.

  • Environnement with pro-cobol and linux redhat

    Hi,
    I have a linux redhat Linux 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux
    and oracle 11g database where we have installed Pro-cobol with a launcher xframe ( not me !)
    we want to use command-line with pro-cobol :
    exemples :
    export COBOLOPTS="-dy -shared -M -lxconv -L$XFRAMEHOME/lib -I $PWD -WC,""DLOAD"" -WC,""SOURCE"" -WC,""COPY"" -WC,""XREF"" -WC,""FLAG(E)"" -WC,""MODE(STD)"" -WC,""ALPHAL(WORD)"" -WC,""NOTRUNC"" -WC,""NOSDS"" -WC,""SRF(FIX)"" -WC,""MAP"" -do ./ -dp ./ "
    cobol -o OV1SLSP.e OV1SLSP.pre OV1MADR0.o $ORACLE_HOME/precomp/lib/cobsqlintf.o OV1MADR1.pre.o OV1MSNT0.pre.o 2> OV1SLSP.errors
    execution:
    OV1SLSP.e
    results
    Erreur de segmentation
    we have a this error.
    but when we use xframe launcher :
    execution:
    xrun OV1SLSP
    results
    XRUN: STARTING OV1SLSP
    OV1MADR0 PLANTAGE SQL RNVP : -1012
    SQLERRMC ORA-01012: non connecté
    COBOL:rts: HALT: JMP0015I-U [PID:000004A0 TID:B7FFC940] CANNOT CALL PROGRAM 'COBCANC'. xvsamRts: undefined symbol: COBCANC PGM=OV1MADR0
    XRUN: TERMINATED WITH CODE 134
    =>This message is normal because we have connect to database !
    It's working perfect.
    My question is : what is the correct librairies to have to make static compiling pro-cobol's programs?
    hope to be cleared.
    Thanks.
    Edited by: french_dam on 28 janv. 2011 10:07
    Edited by: french_dam on 28 janv. 2011 10:11

    Have you checked the system requirements for using Pro-Cobol with Oracle 11g and Linux? See here:
    Pro*COBOL® Programmer's Guide 11g Release 1 (11.1)
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28428/pcoabops.htm#insertedID1
    Hope this helps,
    Ben

  • Oracle 10.1.0.4.2 SQL Plus dbms_output.put_line not working

    I am using Oracle 10.1.0.4.2 SQL Plus, and dbms_output.put_line is not working. It returns the dbms_output ONLY from outside the procedure. I have dbms_output INSIDE my procedure, and none of it gets returned. Please help!
    Here is what I enter:
    set serveroutput on size 1000000;
    DECLARE
         x number:=0;
    begin
    DBMS_OUTPUT.ENABLE;
    c2reports.c2proc(x,'TEST');
    DBMS_OUTPUT.PUT_LINE('testX');
    END;
    testX
    There should be more besides the 'testX' that gets returned. The first line in my procedure has output code to print testY. Thanks in advance!

    This is the forum for the Oracle's SQL Developer (Not for general SQL/PLSQL questions). You should ask question like this in the PL/SQL forum

  • PRO*COBOL/Oracle 9.2 Error

    I am trying to run a COBOL program using SQL. The program is pre-compiled with PRO*COBOL and the then with Microfocus NET Express. At runtime i get the following error.
    $ ./testsample
    Execution error : file 'sample1'
    error code: 114, pc=0, call=1, seg=0
    114 Attempt to access item beyond bounds of memory (Signal 10)
    HP/MF COBOL Version: B.13.45
    HP-UX hptest B.11.11 U 9000/800
    pid: 22012 gid: 102 uid: 104
    Thu Nov 21 19:03:12 2002
    7:03pm up 36 days, 6:23, 34 users, load average: 0.28, 0.16, 0.13
    Thread mode: No Threads
    RTS Error: COBOL
    Sync Signals: COBOL
    ASync Signals: COBOL
    cobtidy on exception: False
    I get the same error with the sample program. Any idea what the cause may be?

    Hello,
    Reason: Your data might contain some foreign characters [non-english] ie., your server nls_lang settings might be different to the client nls_lang settings, as a result the new nls_lang characters will occupy extra bytes because of which even though it is apparent that you are using around 2000 bytes you may be using more than 4000 bytes. Examples Japanese characters seem to take 2 bytes per character, similarly russian takes 3 bytes per character.
    The ojdbc14.jar seems to be doing some check on this and if the characters are more than 4000 bytes it gives u the ora-01461 error but the new 10G ojdbc14.jar allows this.
    On the other hand you may be genuinely trying to insert more than 4000 bytes characters into varchar [example trying to insert the text values into a varchar()]
    You may want to try this:
    * Please download ojdbc14.jar from
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.htmla>
    * Replace the old $omwb_home/lib/ojdbc14.jar with the ojdbc14.jar that you have downloaded in the step above.
    Try a capture now.
    Thank you.
    Srinivas

  • PRO*COBOL Oracle 9.2

    I am trying to run a COBOL program using SQL. The program is pre-compiled with PRO*COBOL and the then with Microfocus NET Express. At runtime i get the following error.
    $ ./testsample
    Execution error : file 'sample1'
    error code: 114, pc=0, call=1, seg=0
    114 Attempt to access item beyond bounds of memory (Signal 10)
    HP/MF COBOL Version: B.13.45
    HP-UX hptest B.11.11 U 9000/800
    pid: 22012 gid: 102 uid: 104
    Thu Nov 21 19:03:12 2002
    7:03pm up 36 days, 6:23, 34 users, load average: 0.28, 0.16, 0.13
    Thread mode: No Threads
    RTS Error: COBOL
    Sync Signals: COBOL
    ASync Signals: COBOL
    cobtidy on exception: False
    I get the same error with the sample program. Any idea what the cause may be?

    after some research I found out that the Pro Cobol compiler is not available on the HP Itanium for version 9.2.0.1, 9.2.0.2 and 9.2.0.3. I will not be available until 9.2.0.4 or later per Oracle on Metalink

  • Printing messages in Log File and Output File using Dbms_output.put_line

    Hi,
    I have a requirement of printing messages in log file and output file using dbms_output.put_line instead of fnd_file.put_line API.
    Please let me know how can I achieve this.
    I tried using a function to print messages and calling that function in my main package where ever there is fnd_file.put_line. But this approach is not required by the business.
    So let me know how I can achieve this functionality.
    Regards
    Sandy

    What is the requirement that doesn't allow you using fnd_file.put_line?
    Please see the following links.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Dbms_output.put_line+AND+Log+AND+messages&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=%22dbms_output.put_line+%22+AND+concurrent&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • BUG : DBMS_OUTPUT.put_line and tabs in sqldeveloper 1.2.1 - build 32.00

    Hi Guys.
    I upgraded from 1.2 and it appears that dbms_output.put_line is now broken.
    Consider the following:
    begin
       dbms_output.put_line('hello world');
    end;Process:
    1. Load SQL Developer
    2. Open a connection to DB
    3. Go to DBMS Output tab
    4. Enable server output
    5. Type in the code (as above)
    6. Hit F5
    The bug/new feature:
    After hitting f5, the DBMS Output tab switches to Script output where by I am presented with "anonymous block completed". In 1.2 (and previous versions) I used to see
    anonymous block completed
    hello world
    in the Script Output tab.
    Now I have to switch back to the DBMS Output tab. My problem with this is that there is far too much clicking. Why redirect me away from the tab that is going to actually display the script output only for me to have to click back into that tab? I just don't get it.
    Regards
    Kristian Jones
    http://kristianjones.blogspot.com
    Message was edited by:
    Kris Jones

    Hi,
    I also have the problem with the new Released.
    SQL Dev 1.2.0.29.98 upgraded with Check for Updates to 1.2.1.32.00
    On Windows XP.
    I did exactly as Kris Jones post, using Run Script
    but, it seems that my SQL Developer doesn't do anything.
    The progress bar is active like processing somthing, well, it processes forever.
    I tried to cancel the process (button Cancel), but the panel shows that it is still trying to cancel the process (all buttons are disabled except Cancel), although I can do another select (use CTRL + Enter because F9 doesn't work) within the same SQL Worksheet and the panel goes back to the active panel again.
    Well, there must be something wrong with the Run Script.
    Since any query or pl/sql block seems running forever if I use Run Script.
    I try on the SQL Developer 1.2.0.29.98 (luckily, I still keep the backup, just in case) and it shows the result as wanted.
    Is there something wrong within my SQL Developer 1.2.0.32.00?
    Or there is some patches which I should download?
    Is it another bug?
    Many thanks,
    Buntoro

  • Output from dbms_output.put_line splits and move to next line

    Hi All,
    I am printing out a list using dbms_output.put_line its like
    One or more of following Required Parameters are missing:
    1. Primary Field
    2. Structure Field
    3. Structure
    Table
    4. List File Name
    5. Query Directory
    6. Query String
    but I don't know why third option is splitting and moving to second line. any idea? its not that long even then.
    thanks

    set linesize 150
    or set it as per your requirement

  • Dbms_output.put_line  and sqlplus : output truncated to 100 Characters.

    HI all,
    please see the following script where the variable length is more than a 100 charecters...
    When i run this in sqlplus with SERVEROUTPUT ON, i see the ouput being truncated to 100 charecters.
    sql> ed
    Wrote file afiedt.buf
      1  declare
      2     l_var varchar2(400);
      3  begin
      4     l_var := 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
      5     dbms_output.put_line(length(l_var));
      6     dbms_output.put_line(l_var);
      7* end;
      8  /
    130
    abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvI think I am looking for a sqlplus "SET XXXX..." command, but my search has been futile so far.
    Please advice.
    Thanks,
    John.

    Thanks for your reply .. Frank.
    Sorry... I Previewed the post but did not notice my code being truncated in my sqlplus sesssion.
    The actual script has the output to 130 charecters. but when i close the edit (afeidt.buf) and execute it, the display only shows 100 charecters...
    My SQLPLUS version is 9.2.0.1.
    I am using the "WE8ISO8859P1" charecter set.
    declare
        l_var varchar2(500) := 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz';
    begin
        dbms_output.put_line(length(l_var));
        dbms_output.put_line(l_var);
    end;
    130
    abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
      1  declare
      2      l_var varchar2(500) ;
      3  begin
      4      for i in 1 .. 5 loop
      5          l_var := l_var || 'abcdefghijklmnopqrstuvwxyz';
      6      end loop;
      7      dbms_output.put_line(length(l_var));
      8      dbms_output.put_line(l_var);
      9* end;
    sql> /
    130
    abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv

  • Pro*COBOL precomp and .pco demos not installed

    Hi,
    I am new to the Oracle database.
    Installing Oracle 9.2, Standard Edition - downloaded Disk1, Disk2 and Disk3 for Windows NT/2000/XP from the OTN downloads.
    I have COBOL programmes with embedded SQL - I need the Pro*COBOL precompiler (procob).
    It seems like Pro*COBOL did not get installed and I do not have the \procob\ demos folder under %ORACLE_HOME%\precomp\demo\. In fact, the only folder in the \demo\ folder is \sql\.
    I have tried compiling my own COBOL programs, which use the COBSQL preprocessor to call the Oracle procob precompiler. I get the error message:
    * CSQL-I-018: Invoking ORACLE8 Precompiler/Translator
    'procob' is not recognized as an internal or external command,
    operable program or batch file.
    * CSQL-F-021: Precompiler did not complete -- Terminating
    Are Pro*COBOL precompiler and the procob demos installed with the download version of Oracle 9.2? Where can I get them from?
    Many thanks

    Hi, me again.
    The procob demos are not installed by default -- Standard installation.
    With a Custom installation, Pro*COBOL is found under 'Oracle 9i Development Kit 9.x > Oracle Programmer 9.x > Optional Dependencies'. You have to check the box 'Show all components including required dependencies' on the Custom install dialog to be able to expand the components and see the Pro*COBOL precompiler under Optional Dependencies.
    I will get to testing the procob demos now and post back the success/failure of the Pro*COBOL precompiler installation.

  • Oracle 9i and Pro*Cobol

    We are in the process of Database upgrades and a pro*cobol program which was working in HP UX 11 / Oracle 7.3.4 was not working in HP UX 11 / Oracle 9i. We are getting the following error when trying to compile it (make) -
    sh: 11139 Memory fault(coredump)
    *** Error exit code 139
    Can anybody help me with this issue.

    We are able to fix this core dump problem. There were some extra "tabs" in the program, when removed the program compiled perfect.

  • DBMS_OUTPUT.PUT_LINE multi records from PL/SQL procedure to Java web page.

    Hello
    I will explain the scenario:
    In our java web page, we are using three text boxes to enter "Part number,Description and Aircraft type". Every time the user no need to enter all these data. The person can enter any combination of data or only one text box. Actually the output data corresponding to this input entries is from five Oracle table. If we are using a single query to take data from all the five tables, the database will hang. So I written a procedure "SEARCH1",this will accept any combination of values (for empty values we need to pass NULL to this procedure) and output data from all the five tables. When I executing this procedure in SQL editor, the execution is very fast and giving exact result. I used "dbms_output.put_line" clause for outputing multiple records in my procedure. The output variables are "Serial No, part Number, Description, Aircraft type,Part No1,Part No2,Part No3,Part No4". I want to use the same procedure "SEARCH1" for outputing data in java web page.The passing argument I can take from the text box provided in java web page. I am using jdbc thin driver to connect our java web page to Oracle 9i database.
    Note1 : If any combination of search item not available, in procedure itself I am outputing a message like "Part Number not found". Here I am using four words ("Part" is the first word,"Number" is the second,"Not" s the third, and "found" is the fourth) for outputing this message.Is it necessary to equalise number of words I am using here to the record outputing eight variable?
    Our current development work is stopped because of this issue. So any one familier in this field,plese help me to solve our issue by giving the sample code for the same scenario.
    My Email-id is : [email protected]
    I will expect yor early mail.
    With thanks
    Pramod kumar.

    Hello Avi,
    I am trying to solve this issue by using objects. But the following part of code also throwing some warning like "PLS-00302: component must be declared". Plese cross check my code and help me to solve this issue.
    drop type rectab;
    create or replace type rectype as object(PartNo varchar2(30),Description varchar2(150),AIrcraft_type varchar2(15),status_IPC varchar2(30),status_ELOG varchar2(30),status_SUPCAT varchar2(30),status_AIRODWH varchar2(30));
    create or replace type rectab as table of rectype;
    create or replace package ioStructArray as
    procedure testsch2(pno in varchar2,pdes in varchar2,air in varchar2,orec in out rectab);
    end ioStructArray;
    create or replace package body ioStructArray as
    procedure testsch2(pno in varchar2,pdes in varchar2,air in varchar2,orec in out rectab) is
    mdescription varchar2(150);
    mpartnum varchar2(30);
    mpno varchar2(30);
    mdes varchar2(150);
    mair varchar2(15);
    mstat varchar2(1);
    cursor c1 is select partnum,description,aircraft_type from master_catalog where partnum=mpno and aircraft_type=mair and description like ltrim(rtrim(mdes))||'%';
    cursor c2 is select partnum from ipc_master where partnum=mpartnum;
    cursor c3 is select partnum from fedlog_data where partnum=mpartnum;
    cursor c4 is select partnum from superparts where partnum=mpartnum;
    cursor c5 is select part_no from supplier_catalog where part_no=mpartnum;
    mpno1 varchar2(30);
    mpno2 varchar2(30);
    mpno3 varchar2(30);
    mpno4 varchar2(30);
    mpno5 varchar2(30);
    maircraft_type varchar2(15);
    mstat1 varchar2(30);
    mstat2 varchar2(30);
    mstat3 varchar2(30);
    mstat4 varchar2(30);
    begin
    mstat:='N';
    mpno:=pno;
    mdes:=pdes;
    mair:=air;
    if mpno is not null and mdes is not null and mair is not null then
    begin
    mstat:='N';
    mpno:=pno;
    mdes:=pdes;
    mair:=air;
    for i in c1 loop
    mstat:='N';
    mstat1:='N';
    mstat2:='N';
    mstat3:='N';
    mstat4:='N';
    mpno1:=i.partnum;
    mpartnum:=i.partnum;
    mdescription:=i.description;
    maircraft_type:=i.aircraft_type;
    for j in c2 loop
    mpno2:=j.partnum;
    end loop;
    for k in c3 loop
    mpno3:=k.partnum;
    end loop;
    for l in c4 loop
    mpno4:=l.partnum;
    end loop;
    for m in c5 loop
    mpno5:=m.part_no;
    end loop;
    if mpno2=mpartnum then
    mstat1:=mpno2;
    end if;
    if mpno3=mpartnum then
    mstat2:=mpno3;
    end if;
    if mpno4=mpartnum then
    mstat3:=mpno4;
    end if;
    if mpno5=mpartnum then
    mstat4:=mpno5;
    end if;
    if mpno1=mpartnum then
    mstat:='Y';
    orec.PartNo:=mpno1;
    orec.Description:=mdescription;
    orec.AIrcraft_type:=maircraft_type;
    orec.status_IPC:=mstat1;
    orec.status_ELOG:=mstat2;
    orec.status_SUPCAT:=mstat3;
    orec.STATUS_AIRODWH:=status_AIRODWH;
    end if;
    end loop;
    end;
    end if;
    end testsch2;
    end ioStructArray;
    Expecting your early reply.
    With thanks
    Pramod kumar.

  • Dbms_output.put_line not printing in inner for loop using a parameter

    I cannot get the inner loop to print output. I can run both loops independent (hardcoding a value for the inner loop) Any help is apprecicated... Listed is the code
    set serveroutput on
    DECLARE
    cursor ACCNO_CUR is
    select accession_number from didb_studies where insert_time > to_date('02-JUN-12');
    cursor PATH_CUR (p1_accno VARCHAR2) is
    select distinct l.FILE_SYSTEM || '/' ||
    substr(LPAD(s.PATIENT_DB_UID, 12, '0'),1,3) || '/' ||
    substr(LPAD(s.PATIENT_DB_UID, 12, '0'),4,3) || '/' ||
    substr(LPAD(s.PATIENT_DB_UID, 12, '0'),7,3) || '/' ||
    substr(LPAD(s.PATIENT_DB_UID, 12, '0'),10,3) || '/' ||
    s.STUDY_DB_UID || '/' || i.SERIES_DB_UID || '/'||
    i.RAW_IMAGE_DB_UID || '.img' as FULLY_QUALIFIED_IMAGE_NAME
    , l.image_size
    , i.image_need_backup
    , i.sop_class_uid
    from medistore.didb_studies s
    , medistore.didb_raw_images_table i
    , medistore.didb_image_locations l
    where s.accession_number = 'p1_accno'
    and s.study_db_uid = i.study_db_uid
    and i.raw_image_db_uid = l.raw_image_db_uid
    and l.file_system is not null and INSTR(l.file_system, '.img') = 0
    UNION
    select distinct(l.FILE_SYSTEM) as FULLY_QUALIFIED_IMAGE_NAME
    , l.image_size
    , i.image_need_backup
    , i.sop_class_uid
    from medistore.didb_studies s, medistore.didb_raw_images_table i,
    medistore.didb_image_locations l
    where s.accession_number = 'p1_accno'
    and s.study_db_uid = i.study_db_uid
    and i.raw_image_db_uid = l.raw_image_db_uid
    and l.file_system is not null and INSTR(l.file_system, '.img') > 0
    order by 1;
    BEGIN
    FOR accno_rec in accno_cur LOOP
    DBMS_OUTPUT.put_line('ACCESSION_NUMBER is: '|| accno_rec.accession_number);
    FOR path_rec in path_cur(accno_rec.accession_number) LOOP
    DBMS_OUTPUT.put_line('Inner loop accession_number is :'||accno_rec.accession_number);
    DBMS_OUTPUT.put_line('Full path is : ' || path_rec.FULLY_QUALIFIED_IMAGE_NAME);
    END LOOP;
    END LOOP;
    END;

    Maybe
    DECLARE
      cursor ACCNO_CUR is
        select accession_number
          from didb_studies
         where insert_time > to_date('02-JUN-12');
      cursor PATH_CUR (p1_accno VARCHAR2) is
        select distinct
               l.FILE_SYSTEM || '/' ||
               substr(LPAD(s.PATIENT_DB_UID, 12, '0'),1,3) || '/' ||
               substr(LPAD(s.PATIENT_DB_UID, 12, '0'),4,3) || '/' ||
               substr(LPAD(s.PATIENT_DB_UID, 12, '0'),7,3) || '/' ||
               substr(LPAD(s.PATIENT_DB_UID, 12, '0'),10,3) || '/' ||
               s.STUDY_DB_UID || '/' || i.SERIES_DB_UID || '/'||
               i.RAW_IMAGE_DB_UID || '.img' as FULLY_QUALIFIED_IMAGE_NAME,
               l.image_size,
               i.image_need_backup,
               i.sop_class_uid
          from medistore.didb_studies s,
               medistore.didb_raw_images_table i,
               medistore.didb_image_locations l
         where s.accession_number = to_number(p1_accno) /* to_char(s.accession_number) = p1_accno */
           and s.study_db_uid = i.study_db_uid
           and i.raw_image_db_uid = l.raw_image_db_uid
           and l.file_system is not null
           and INSTR(l.file_system, '.img') = 0
        UNION
        select distinct
               l.FILE_SYSTEM as FULLY_QUALIFIED_IMAGE_NAME,
               l.image_size,
               i.image_need_backup,
               i.sop_class_uid
          from medistore.didb_studies s,
               medistore.didb_raw_images_table i,
               medistore.didb_image_locations l
         where s.accession_number = to_number(p1_accno) /* to_char(s.accession_number) = p1_accno */
           and s.study_db_uid = i.study_db_uid
           and i.raw_image_db_uid = l.raw_image_db_uid
           and l.file_system is not null and INSTR(l.file_system, '.img') > 0
         order by 1;
    BEGIN
      FOR accno_rec in accno_cur
      LOOP
        DBMS_OUTPUT.put_line('ACCESSION_NUMBER is: '|| accno_rec.accession_number);
        FOR path_rec in path_cur(accno_rec.accession_number)
        LOOP
          DBMS_OUTPUT.put_line('Inner loop accession_number is :'||accno_rec.accession_number);
          DBMS_OUTPUT.put_line('Full path is : ' || path_rec.FULLY_QUALIFIED_IMAGE_NAME);
        END LOOP;
      END LOOP;
    END;Regards
    Etbin

  • How to Populate a table with DBMS_OUTPUT.put_line

    Hey Guys, it's Xev.
    Please only pleasant people reply to this.
    I have a PL/SQL Program that searches for strings and then at the end of it it prints out to DBMS_OUTPUT.put_line.
    I have the owner, the table_name, the column name and the count, then it goes to DBMS_OUTPUT.put_line
    What i want to do, is take the results of DBMS_OUTPUT.put_line and insert it into a table.
    Here is the script I am talking about, as you can see it's simple, yet for me it works.  I want to take the results of this and insert it into a table. How can i do  that??
    set serveroutput on size unlimited
    execute DBMS_OUTPUT.ENABLE (buffer_size => NULL);
    DECLARE
       FND_GOVIDS       INTEGER;
       BEGIN
    FOR t  IN (SELECT owner, table_name, column_name
                FROM all_tab_columns
                WHERE owner = upper('&SCHEMA_NAME'))
    LOOP
      BEGIN
        EXECUTE IMMEDIATE 'with a as ( select  case when REGEXP_LIKE(' || t.column_name ||
    --This searches for 8 Alpha Digits
    ',''^([[:alpha:]]{2}|[[:alpha:]]{4})?[ ]?[0-9]{8}[ ]?([[:alpha:]]{2}|[[:alpha:]]{4})?$'')
    then ''Match Found''
    else ''No Match Found'' end as output from ' || t.owner || '.' || t.table_name || ')
    select count(*) from a where a.output=''Match Found'' '
          INTO FND_GOVIDS ;
    IF FND_GOVIDS > 0         THEN
    DBMS_OUTPUT.put_line (
    t.owner
    || '.'
    || t.table_name
    || ' '
    || t.column_name
    || ' '
    || FND_GOVIDS);
      END IF;
      EXCEPTION
        WHEN OTHERS
          THEN
          DBMS_OUTPUT.put_line (
          'Generic Error '
          || t.column_name
          || ' from '
          || t.owner
          || '.'
          || t.table_name);      
          END;
       END LOOP;
    END;

    Nope, the table is empty....
    But it ran without error??!?! Wait a minute, I think i have to commit right? Since it's not straight sql, ok, that's what I am going to try..
    set serveroutput on size unlimited
    execute DBMS_OUTPUT.ENABLE (buffer_size => NULL);
    DECLARE
       FND_GOVIDS       INTEGER;
       BEGIN
    FOR t  IN (SELECT owner, table_name, column_name
                FROM all_tab_columns
                WHERE owner = upper('&SCHEMA_NAME'))
    LOOP
      BEGIN
        EXECUTE IMMEDIATE 'with a as ( select  case when REGEXP_LIKE(' || t.column_name ||
    --This searches for 6 Alpha Digits
    ',''^([[:alpha:]]|[[:alpha:]]{3})[0-9]{6}$'')
    then ''Match Found''
    else ''No Match Found'' end as output from ' || t.owner || '.' || t.table_name || ')
    select count(*) from a where a.output=''Match Found'' '
          INTO FND_GOVIDS ;
    /*Table insert for resulting */
    IF FND_GOVIDS > 0 THEN
    INSERT INTO "SMEG"."DYNAMIC_COUNTS" (T_OWNER, T_TABLE_NAME, T_COLUMN_NAME, FND_GOVIDS) VALUES
    ('t.owner','t.table_name','t.column_name','FND_GOVIDS');
      END IF;
    /* dbms_output */
    IF FND_GOVIDS > 0 THEN
    DBMS_OUTPUT.put_line (t.owner || '.' || t.table_name || ' ' || t.column_name || ' ' || FND_GOVIDS);
      END IF;
    /* Exception Handeling */
      EXCEPTION
        WHEN OTHERS
          THEN
          DBMS_OUTPUT.put_line (
          'Generic Error '
          || t.column_name
          || ' from '
          || t.owner
          || '.'
          || t.table_name);     
          END;
       END LOOP;
    END;

Maybe you are looking for

  • MSI X48C Platinum Long Boot Time

    Hi, When i start my computer it take about a minute and a half to TWO minutes until it moves on and start to boot the OS. in the Bios i set "quick boot" but its the same. What can i do? MOBO: MSI X48C Platinum CPU: [email protected] MEM: 2GB Corsair

  • HTTP Server High Availability

    Hello All. I have a question regarding OC4J and HTTP server High Availability. I want to do something like the Figure 3-1 of the Oracle Application Server High Availability Guide 10.1.2. See this link http://download-east.oracle.com/docs/cd/B14099_11

  • Set system time in both unix and NT

    i need to write a software to be run on the 2 platforms to set the system time if anyone know how to go about doing it please guide me along and provide me some code. thanks in advance

  • F4 help in Web Dynpro

    Hi, I have a requirement wherein I need to have  F4 help on a field (Storage location- LGORT) based on the plant . I do not have this filed Plant on the screen but can fetch that in the code. I have created a Ztable which will have all the data relat

  • DVD burner jerking me around

    When I burn home movies with my iMac - either through iDVD or Toast - for some reason in the last couple days the results are awful. The playback DVD jerks movement consistently, not randomly. Almost like we are looking at the action with every other