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:

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;

  • To get the the out put of the needed

    hi all,
    i have a procedure :
         StaffID IN      VARCHAR2 DEFAULT NULL,
         ResultCategory OUT      VARCHAR2
    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;
              OPEN curCategory;
              FETCH curCategory INTO Category, Condition;
              while curCategory%FOUND
                   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 ;
                                       INSERT INTO tmp VALUES (Category );
              END IF;
              END IF;
              FETCH curCategory INTO Category, Condition;
              END LOOP;
              CLOSE curCategory;
                   FOR REC IN ( SELECT CAT FROM tmp
                   EN_GetCategory.ResultCategory := REC.CAT;
                   END LOOP;
    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

    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

    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.

  • 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.

    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|]

  • 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.

    Hi Mythili,
    Hope the attached code helps you...
    TABLES marc.
    TYPE-POOLS: slis.
    TYPES : BEGIN OF g_ty_msg,
            type LIKE sy-msgty,
           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.
      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.
      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
          i_title       = 'Message Log'
          i_tabname     = 'G_TY_MSG'
          it_fieldcat   = l_t_fieldcat[]
          t_outtab      = g_t_msg
          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.
    ENDFORM.                    " display_log
    Best Regards,

  • 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.

    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
    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:

  • 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 .
    selection screen fields:
    customer  code
    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.
                                    AND RETURN.
        listobject = list_tab
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc = 0.
          listobject = list_tab.
    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

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

  • 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.

    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.
    Best Regards,

  • 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

    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