How to display the out put of the sql query in a text file using forms

I want to display the out put of the sql query in a text file using forms 6.0.Same could be done using spool command in sqlplus but i want it using forms....Fiaz

Have a look at the text_io package:
http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/oraini/c_text_io.html&vtTopicId=
cheers

Similar Messages

  • Importing the out-put to the exel

    Hi all,
    iam very new to the unix and sql,
    just i want to know how to export the out-put of the query into exel using unix(spool)

    A lot of people rob banks too.
    You can spool an output to a file delimiting columns with commas if you wish. But that is outputting a file not outputting to Excel.
    Personally I'd fire anyone in a data center I caught outputting Oracle into a non-secure unauditable form and putting the organization at risk.

  • How to write the output of an SQL query to a text file?

    I am using Oracle 11g and SQL plus.
    I have a large table called rating.
    Whenever I do
    SQL> select * from rating;
    The output goes much beyond what the SQL Plus screen can show. I want to therefore store the output of this query into a text file.
    How can this be done? Please help. Thanks.

    SQL> SPOOL results.txt
    SQL> select * from rating;
    SQL> SPOOL OFF

  • To get the the out put of the procedure..help needed

    hi all,
    i have a procedure :
    CREATE OR REPLACE PROCEDURE EN_GetCategory
         StaffID IN      VARCHAR2 DEFAULT NULL,
         ResultCategory OUT      VARCHAR2
    AS
    v_exec_tx varchar2(2000);
         Condition VARCHAR2(1000);
         Category VARCHAR2(1);
         SQL_ADV VARCHAR2(2000);
         Cnt          NUMBER(10);
         Cnt1          NUMBER(10);
    CURSOR curCategory IS
    SELECT SMC.Category,SMC.Condition FROM ST_MS_Category SMC ORDER BY OrderRowNo;
         BEGIN
              EXECUTE IMMEDIATE 'TRUNCATE TABLE TMP';
              OPEN curCategory;
              FETCH curCategory INTO Category, Condition;
              while curCategory%FOUND
              LOOP
              BEGIN
                   v_exec_tx:='SELECT COUNT(*) FROM ST_EMPLOYEE WHERE StaffID=''' || EN_GETCATEGORY.STAFFID ||''' AND ' || EN_GETCATEGORY.CONDITION;
                   EXECUTE IMMEDIATE v_exec_tx into Cnt;
    IF Cnt > 0 THEN                              SELECT COUNT(*) INTO CNT1 FROM tmp ;
              IF CNT1> 0     THEN
                                       UPDATE tmp SET CAT = Category ;
              ELSE
                                       INSERT INTO tmp VALUES (Category );
              END IF;
              END IF;
              FETCH curCategory INTO Category, Condition;
                   END;
              END LOOP;
              CLOSE curCategory;
              BEGIN
                   FOR REC IN ( SELECT CAT FROM tmp
                   LOOP
                   EN_GetCategory.ResultCategory := REC.CAT;
                   END LOOP;
              END;
         END;
    i need to execute this procedure..
    i tried EXEC EN_GETCATEGORY('812005','');
    but getting error invalid sql statemnt..
    i think for this we have to write some more code can u please help to to find the output ofthis procedure..
    Thanks In advance

    Hi,
    i tried EXEC EN_GETCATEGORY('812005','');It's execute Procedure_name('Parameters');
    Regds.What tosh! "exec" is perfectly ok to use to call a procedure.
    The problem is with the OUT parameter. You need to declare a variable into which the OUT value can be put.

  • Getting duplication of records in the out put of the report on multipro..

    hai ,
          We are trying to execute a report on a multiprovder.While executing the report  we are getting duplication of records while in case if we are removing the created 'new selection' or 'new fromula' in the query designer we are not getting the duplicate records.
    Now as per our requirement we do not need duplicate records.
    Plz could any one help me out with this problem

    Hi Jvr,
    $server | ($_ -split '=')[1] -replace '}' is working.. :)
    The email doesn't have @{ = }, its only displayed in the output.
    Any help on the REGEX part?

  • Can we able to take the out put have the file into another file in unix

    Hi all ,
    My question is .. we are having one shall fill , we need to take the output of that file to another file ,
    but the output is not printing into another file..
    what am guessing is we have only read and execute permission on that file.. we don't have write permission on that file and the folder where the file is exists .
    my Question is , Do we need all permission on File to copy the output to another file... ?
    because we are redirecting the output to another folder where we can create the another file and read and write permissions .
    -rwxrwxr-x 1 th th 499 Jun 20 01:06 Coverage
    like this we are having the permission on that file
    for the folder we are having the permission
    drwxrwxr-x 6 kpsmith kpsmith 12288 Aug 9 21:59 1.3
    can any one help me out from this problem
    Thanks
    Sreedhar

    Assuming 'shall fil' is shell script , other than dumping even more garbage in this forum, what does this question have to do with Oracle?
    Or can't you type anything in the address bar of your browser and is this URL the only one you can visit?
    Sybrand Bakker
    Senior Oracle DBA

  • Is it possible to display only dynamically selected fields in the out put?

    Is it possible to display only dynamically selected fields in the out put? i need to display set of columns in the selection criteria, but in the output i have display only input given fields. because i need to convert it into .csv file. So i have to display selected fields from internal table. In oracle they are using"execute immediate". is there any equivalent in SAP?
    thanks in advance.

    Hi Remya,
    Are you talking about dynamic programming in ABAP ?
    If yes, there are concepts like RTTS which facilitates it.
    Yes, the select query also supports dynamic selection of fields. ( Please care about ( ) in dynamic sql ).
    Do more research on Field Symbols and statements like ASSIGN COMPONENT OF.
    Regards,
    Philip.

  • How should we get the out put file-name same as in put file-name in file to

    Hi frnds,
    having hundreds of files in the sender system with different names, how should we get the out put file-name  in the receiver system same as the in put file-name in file to file scenario ?
    Thanks in advance.
    truly,
    snrvakiti.

    Hi,
    In Receiver File Adapter you can set under 'Adapter-Specific Message Properties'
    check Use Adapter-Specific Message Properties
    check Fail on Missing Adapter Message Properties
    Check File Name
    Have a look at this link,  [File_to_File|http://allsapnetweavernotes.blogspot.com/2008/09/how-can-i-access-filename-from-fileftp.html]
    Regards,
    P.Rajesh

  • Printing all error messages in the out put report

    Hi all,
    I have MATNR and WERKS data in final internal table now my requirement is ineed to print all the error messages for all the materials (where sy-subrc ne 0) in the out put report. how can i do it for multiple error records will anybody tell me with coding
    The Requirement is like bellow:
    Take material number(s) (MARC-MATNR) from selection screen then check to see if any plants have that material setup as QM active (MARC-QMATV).  If no, then issue message on report.
    Thanks,

    Hi Mythili,
    Hope the attached code helps you...
    TABLES marc.
    TYPE-POOLS: slis.
    TYPES : BEGIN OF g_ty_msg,
            type LIKE sy-msgty,
            msg(120),
           END OF g_ty_msg.
    TYPES: BEGIN OF g_ty_marc,
            matnr TYPE matnr,
            werks TYPE werks_d,
            qmatv TYPE qmatv,
          END OF g_ty_marc.
    DATA: g_t_msg TYPE TABLE OF g_ty_msg,
          g_r_msg TYPE g_ty_msg.
    DATA: g_t_marc TYPE TABLE OF g_ty_marc.
    FIELD-SYMBOLS <fs_marc> TYPE g_ty_marc.
    SELECT-OPTIONS: s_matnr FOR marc-matnr,
                    s_werks FOR marc-werks.
    START-OF-SELECTION.
      SELECT matnr werks qmatv FROM marc
        INTO TABLE g_t_marc
        WHERE matnr IN s_matnr AND
              werks IN s_werks.
      IF g_t_marc IS NOT INITIAL.
        LOOP AT g_t_marc ASSIGNING <fs_marc>.
          IF <fs_marc>-qmatv IS INITIAL.
            g_r_msg-type = 'E'.
            CONCATENATE <fs_marc>-matnr <fs_marc>-werks
              INTO g_r_msg-msg SEPARATED BY space.
            APPEND g_r_msg TO g_t_msg.
            CLEAR g_r_msg.
          ENDIF.
        ENDLOOP.
      ENDIF.
    END-OF-SELECTION.
      PERFORM display_log.
    *&      Form  display_log
          To display error log as an ALV Popup
    FORM display_log .
      CONSTANTS: l_c_type(4)    TYPE c VALUE 'TYPE',
                 l_c_msg(3)     TYPE c VALUE 'MSG'.
      DATA :  l_t_fieldcat TYPE TABLE OF slis_fieldcat_alv,
              l_r_fieldcat TYPE slis_fieldcat_alv.
      DATA :  l_f_line TYPE i.
      CLEAR l_r_fieldcat.
      l_f_line = l_f_line + 1.
      l_r_fieldcat-col_pos    = l_f_line.
      l_r_fieldcat-fieldname  = l_c_type.
      l_r_fieldcat-seltext_m  = 'Type'.
      APPEND l_r_fieldcat TO l_t_fieldcat.
      CLEAR l_r_fieldcat.
      l_f_line = l_f_line + 1.
      l_r_fieldcat-col_pos = l_f_line.
      l_r_fieldcat-fieldname = l_c_msg.
      l_r_fieldcat-seltext_m = 'Message'.
      l_r_fieldcat-outputlen = 120.
      APPEND l_r_fieldcat TO l_t_fieldcat.
    To display the message log as a Popup in the form of ALV List
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
        EXPORTING
          i_title       = 'Message Log'
          i_tabname     = 'G_TY_MSG'
          it_fieldcat   = l_t_fieldcat[]
        TABLES
          t_outtab      = g_t_msg
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " display_log
    Best Regards,
    Suresh

  • How to display Number of Attendees in the BExReport

    Dear Gurus,
    Please let us know how to resolve the issue.
    Master Data : 0TRAINING
    Course    StartDate               
    500001        20.02.2010
    500002        21.02.2010
    500003        22.02.2010
    Cube(transactional data 0LSO_C01) : will get the records if an employee book the course. i.e only 2 records.
    Course   StartDate        Number of Attendees
    500001       20.02.2010        2
    500002       21.02.2010        3
    User requires the REPORT like bellow.
    Course  StartDate        Number of Attendees (0BOOKING_NO)
    500001       20.02.2010        2
    500002       21.02.2010        3
    500003       22.02.2010        0
    How to bring the last record  i.e Course '500003' which is not there in CUBE, but present in Master data.
    I tried Multi provider doesnu2019t help in this senerio.
    Kindly do needful.
    Regards,
    Kiran

    Dear Umesh.Chavan,
    Thanks for your quick response
    For MultiProvider the out put is
    Course StartDate Number of Attendees (0BOOKING_NO)
    500001 20.02.2010 2
    500002 21.02.2010 3
    If i remove the key figure from rows. Number of Attendees (0BOOKING_NO) then it is coming like
    Course StartDate
    500001 20.02.2010
    500002 21.02.2010
    500003 22.02.2010
    But User requires the REPORT like bellow.
    Course StartDate Number of Attendees (0BOOKING_NO)
    500001 20.02.2010 2
    500002 21.02.2010 3
    500003 22.02.2010 0
    Regards,
    Kiran A

  • Run Clear Case command from java and save the out put in to a file.

    Can any one help me out ...
    I want to execute Clear case command from a java and want to save the out put of this command to a file.
    I am naot able to find out how to start..
    Message was edited by:
    chandra_verma

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Need to filter the out put of iw38 reprort

    hello Experts,
    i have requirement like need to filter the out put of iw38 report and after that again i need to filter that output by using department and client code and oreder .ned to show out put with 3 push buttons .
    dertails:
    selection screen fields:
    region
    customer  code
    oreder
    date range
    from these 4 fields i need to pass two(order and date range)   fields to  iw38 report and then what ever output i am getting again that should filter by customer code and region which are there in my program
    , need to display the out put with 3 push buttons .
    plz suggest me  with appraoach and sample code .
    Note : i am using using submit and return export memory but its directly showing iw38 output and not coming back.

    Hi ananta,
    The function module LIST_FROM_MEMORY loads the list from the ABAP Memory to an internal table of the row type ABAPLIST.
    The function module WRITE_LIST inserts the content of an internal table of the row type ABAPLIST in the current list.
    The function module DISPLAY_LIST displays the content of an internal table of the row type ABAPLIST in a separate list screen.
    check the below program..
    REPORT  Z642_TEST2.
    DATA list_tab TYPE TABLE OF abaplist.
    SUBMIT riaufk20 EXPORTING LIST TO MEMORY
                                    AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc = 0.
      CALL FUNCTION 'WRITE_LIST'
        TABLES
          listobject = list_tab.
    ENDIF.
    write: ' This is calling program', sy-repid.
    Edited by: Rammohan Nagam on Apr 8, 2009 4:05 PM

  • I want the out put of number in(10,4)

    I want out put of the number like this formate (10,4). can any one give the syntax for this..
    by using the round function round(38.439494) = 38.439. but how to restrict the integer to 10

    Prem,
    My understnding the below you are expecting.
    select round(38.439494,3) from dual;
    38.439
    If it's not,please make sure post clearly.
    Regards,
    Vissu.....

  • Where we will see the out put of propotional factor

    Hi Experts,
    I have maintained in mc8v (Proportional factor)  after this where is the out put will see for  propotional factor . I have  maintained  in basic proportion is cube ,keyfigure,verion and calculate proportion maintained planning area, keyfiguer in other setting maintained selection profile. Can you tell me output where will see. how it will work. can u elaborate.
    Regards,
    moon

    Moon,
    The keyfigure that is usually updated is APODPDANT.  Find or create a view where this keyfigure is visible (that particular book must have 'manual proportion maintenance' turned on), and you can then review the results of the Prop Factor calculation by opening the planning book using that view. 
    Proportional factor will do nothing unless you have configured your planning area to use it for disaggregation, or you have included this Proportional Factor KF in one of your macros.
    http://help.sap.com/saphelp_scm70/helpdata/EN/66/29fb672fbe11d398240000e8a49608/frameset.htm
    Best Regards,
    DB49

  • How to display properties of dimension on the input form and report in bpc

    Dear Expert,
    Please tell me how to display properties of dimension on the input form and report in bpc. I can only display dimension number.
    thanks so much
    hungth

    Hi Hungh,
    If your are using BPC 10 with EPM add in client, you can use the function:
    EPMDimensionProperty ()
    This function retrieves the properties of a specified dimension in a specified cell range.
    Thanks, Safa

Maybe you are looking for

  • I need my apps, and music back. How do I get it

    I need my Apps, and music back. How do I get them back? I backed them up with ICloud and skipped the get your stuff process.. I need help. I can't restore my iPad again.. Or I'll forget my internet password.

  • Cm:select performance problem with multiple likes query clause

    I have query like <br>           <b>listItem like '*abc.xml*' && serviceId like '*xyz.xml*'</b><br>           Can we have two likes clauses mentioned above in the cm:select. The above is executing successfully but takes too much time to process. <br>

  • Skype for business for Office 365

    Hi Team, I need to upgrade my current Lync 2013 to Skype for business and as per information i got an update released by Microsoft KB2889923 ... this is used to upgrade Lync 2013 to skype for business.......but in case of Office 365 this update dosen

  • Stereo signal on all 5 speakers

    Hi I am thinking of buying the inspire p5800 5.1 speakers for my computer. I have a 5.1 soundcard so I don't have any worries there. However, I am also thinking of connecting the speakers to my TV. The specifications for the p5800 says that there is

  • Cenvat hold account(urgent)

    pl suggest me I run the cycle for procurement of ASEET,accounting document Debited Cenvat hold account with 30000INR(SAY). How i go for taking credit for that account ?Pl explain in detail.