SRW.DO_SQL

Hi to everyone:
When I generate a report. What can I do to avoid the creation of the following line?
SRW.DO_SQL('alter session set NLS_DATE_FORMAT=''YYYY/MM/DD HH24:MI:SS''');

In the module definition of report, open the "Windows" branch to display the defined Window for report. In this definition you can create a "BeforeReport" event in "Application Logic/Events" branch. In the event creation wizard you can override the preset logic that causes generation of the line you want to omit.

Similar Messages

  • In Reports6i is "srw.do_sql" still applicable?

    Hi guys,
    I just want to know if in Oracle Reports6i the "srw.do_sql" still applicable? In report trigger afterform i have problem with this line.
    srw.do_sql('create table owner.tablename (column1 char(6), column2 (varchar2(50))');
    Can anyone help me solve this problem. Thank you.
    Regards,
    Lala

    I think you forgot to write tha actual owner name !!
    or does your user has the rights for DDL statements ??
    SRW.DO_SQL ('CREATE TABLE ' || :owner||'.'||:tname || ' (COL1 NUMBER
    NOT NULL, COL2 NUMBER (10,2))' );
    Edited by: Dora on Dec 7, 2009 12:42 PM

  • Controling Date Parameters using SRW.DO_SQL in Reports!

    Hello Friends,
    I Need to Control the Date Parameters in Reports.
    (Dev/2000 rel2.1) In SRW.Do_SQL package
    For Example:
    'Insert into x
    select * from Y
    where Y.date between f_date and t_date';
    Here: X,Y are two tables
    f_date and t_date are two different date parameters in
    format (dd-mm-yyyy).
    NOTE: Without these two date parameters, the Query is working
    fine. But I need to Use these Parameters. Could You Please find a
    solution for Me. Thanks in advance.
    Regards
    Manoj (India)
    (Dt:18thNov'99)
    null

    Manoj (guest) wrote:
    : Hello Friends,
    : I Need to Control the Date Parameters in Reports.
    : (Dev/2000 rel2.1) In SRW.Do_SQL package
    : For Example:
    : 'Insert into x
    : select * from Y
    : where Y.date between f_date and t_date';
    : Here: X,Y are two tables
    : f_date and t_date are two different date parameters
    in
    : format (dd-mm-yyyy).
    : NOTE: Without these two date parameters, the Query is working
    : fine. But I need to Use these Parameters. Could You Please
    find a
    : solution for Me. Thanks in advance.
    : Regards
    : Manoj (India)
    : (Dt:18thNov'99)
    Hi Manoj
    your goal is to supply all three as dates (y.date, f_date,
    t_date). if some of them are not date but char, varchar, ...
    then use to_date conversion function with proper format mask.
    hope this helps.
    null

  • Question about SRW.DO_SQL

    This is my problem..
    I cannot insert a record when I run the report.
    I used the before report trigger.
    Please help. What do you think is the problem?
    Thanks. Really appreciate all the help.
    function BeforeReport return boolean is
    begin
    srw.do_sql('CREATE table RUNREPORT_VLC
         (DATE_RUN DATE,
         USER_RUN VARCHAR2(10),
         COMMENTS VARCHAR2(80))');                              
    srw.do_sql('INSERT INTO RUNREPORT_VLC (DATE_RUN,USER_RUN,COMMENTS)
         VALUES(SYSDATE,USER,'STARTING POINT')');
    commit;
    return (TRUE);
    EXCEPTION
    WHEN SRW.DO_SQL_FAILURE then
         srw.message(100,'Table already exist!');
         raise srw.program_abort;     
    end;
    ERROR
    Line 9, column 30
    Encountered the symbol "STARTING" when expecting one of the following:
    .(),*@%&|=.+</> in mod not range rem =>..
    an exponent (**)<>or!=or~=>=<=<> and or like between
    using is null is not || is dangling

    I think its because the entire doSQL clause is a string, and when you type in 'STARTING VALUES', Oracle thinks you are ending the string.
    You need to put STARTING VALUES in 2 single quotes on each side. Do this for each string inside a string.
    IE: (note 2 single quotes, not 1 double quote)
    ....''STARTING POINT''

  • How to use nvl to parameter in SRW.DO_SQL  in oracle report

    Hi all,
    I am creating view runtime where i want to pass parameter to which i need to handle NVL
    below is my code
    SRW.DO_SQL('create view '||view_name11||' as
    select moqv.subinventory_code subinv,
    moqv.inventory_item_id item_id,
    moqv.item_cost item_cost,
    0 source_type1,
    0 source_type2,
    0 source_type3,
    0 source_type4,
    0 source_type5,
    0 other,
    --decode('||selection||',1,sum(transaction_quantity),sum(transaction_quantity * NVL(moqv.item_cost,0)))                           cur_qty_val,
    sum(transaction_quantity) cur_qty,
    sum(transaction_quantity) target_qty,
    moqv.organization_id
    from mtl_onhand_qty_cost_v moqv
    where moqv.organization_id = ''nvl'||'('||var_org||','||'moqv.organization_id'||')''
    group by moqv.subinventory_code, moqv.inventory_item_id, moqv.item_cost' );
    thanks in advance

    And your problem is?
    I see a lot of quotes, so I guess that is your problem. Just fix it with the right amount of quotes.

  • Report6i is getting hanged when i am using truncate command in srw.do_sql

    Hi All,
    I am using Reports 6.0.8.18.0 and oracle 9.2.0.1 on Windows XP with SP1.
    I am having a report in which i have used "truncate table <tablename>" command using SRW.do_sql command. some times report is getting hanged and some times it is giving an error as given below
    18:26:52 ERR REP-1425: 'afterpform': Error running DO_SQL package - 'Error parsing the SQL statement.
    ORA-04021: timeout occurred while waiting to lock object <object name >
    When i checked with the Oracle 8.1.7 database it is working fine.
    is there any patches are requried at database side ?
    Can any body help me in this.
    Regards,
    Gouri

    First: you should get a new keyboard. Seems your shift-key is stuck.
    Second: A header of a post is a header and not for a summary of your question
    Third: This is the forum for the tool SQL Developer. Please mark this question as answered and post again in Forms
    Forth: When you expect an answer, the least would be to include the errormessage and your forms version.
    Regards
    Marcus

  • SRW.DO_SQL PROBLEM

    Hi All,
    Can i use SRW.DO_SQL package like this :
    SRW.DO_SQL('@xyz.sql')
    if 'YES' then where shell i keep the sql file ? i mean in orant\bin directory or in the directory where my report file exists.
    And if 'No' then how can i run a batch file in my report ?
    TIA
    Manish

    hello,
    srw.do_sql ( sql_stmt varchar2 )
    so it only takes a string as parameter not a filename.
    regards,
    the oracle reports team

  • REP-1425 report formula DO_SQL error putting value into column

    Hi all
    I have opened a report 2.5 in Oracle9i Reports Developer and, it converted ok. However, when I run the report (paper layout), the message
    rep-1425 report formula DO_SQL error putting value
    into column. Column may not be referenced by parameter
    triggers
    appears. There are several report level formula columns and corresponding placeholder columns that are the cause of this error. The formula has the following :
    SRW.DO_SQL('SELECT RPAD(''DAILY TABLE AUDIT REPORT'',60,''.'')||TO_CHAR(SYSDATE,''DD-MON-YYYY'') INTO :REPORT_TIT FROM DUAL');
    COMMIT;
    RETURN('');
    I can't work out what this error message really means as the column, report_tit is a placeholder column and, the formula column is not a parameter trigger!! The report_tit placeholder is used as a source for a layout field. I noticed that the layout field is defined as a placeholder column in the converted report but in the reports 2.5 version, it is defined as a layout field.
    I can do a work around by replacing the SRW.DO_SQL statement with a normal PL/SQL SELECT statement. However, I wonder if anyone else has had the same problem and, if anyone can help provide an answer as to what this error really means and, also, how I can retain the SRW.DO_SQL statement and/or an alternative work around to the one that I have described.
    Thanks.
    Therese Hughes
    Forest Products Commision

    Hi again
    The firewall proved to be the problem after all! The firewall set in Reports config-files is not used for WebServices, it has to be set within the stub:
    Properties prop = System.getProperties();
    prop.put("http.proxyHost","yourProxyServer");
    prop.put("http.proxyPort","youProxyServerPort");
    I inserted this in my java-code and after some problems (see below), restarting Report Builder turned the trick, the report works now.
    Cheers
    Tino
    Here there mail I set up before I found that restarting Report Builder helped:
    Thanks for your answer, putting in the proxy-settings actually helped some - the same error message is
    popping up, but instantly and not after 10 seconds like before:
    My proxy lines look like this, I also tried "http://proxy.ch.oracle.com", but "proxy.ch.oracle.com" proved to
    be the correct syntax:
    public Float getRate(String country1, String country2) throws Exception
    Float returnVal = null;
    Properties prop = System.getProperties();
    prop.put("http.proxyHost","proxy.ch.oracle.com");
    prop.put("http.proxyPort","8080");
    URL endpointURL = new URL(endpoint);
    Call call = new Call();
    I tested the new proxy-entries by disabling the proxy preference in JDeveloper, so I could verify the added
    proxy-lines in the code work - they do. If I change the proxy to some incorrect value like
    "proxyy.ch.oracle.com", they fail.
    After unsuccessfully trying recompile and re-import of Java classes, I rebuild the report from scratch and
    stumbled over the same problem. Now the question is, whether I'm still doing something wrong with the
    proxy or whether there is another problem after passing the firewall....
    -------------------------------------------------------------------------------------------------------------

  • Oracle report 10g srw package.

    hi,
    i want to know about srw package in that srw.do_sql where it should be placed?

    you can check for SRW.DO_SQL built-in procedure in Reports online help.

  • SRW package with Forms11g

    Hi,
    Is it possible that SRW package doesn't work with Oracle Forms 11g Release 1?
    For exemple, when I compile a library with "srw.do_sql" comande, the Forms 11g compiler told me that this function is not defined.
    What is wrong?

    SRW package is a reports package I believe ..
    I couldn't see this even in Forms 10g . But I have seen this in Reports ..
    Do you think it was in Forms also ..

  • Can we use Dynamic SQL in Oracle Reports ?

    Hi ,
    Can we use Dynamic SQL in Oracle Reports ?
    If yes please give some examples .
    Thanx
    srini

    I believe the built-in package SRW.Do_Sql is what you are looking for
    Example from the document:
    /* Suppose you want to create a "table of contents" by getting the
    ** first character of a columns value, and page number on which its
    ** field fires to print. Assume that you want to put the "table of
    contents"
    ** into a table named SHIP. You could write the following construct:
    DECLARE
    PAGE_NO NUMBER;
    PAGE_FOR INDEX NUMBER;
    SORT_CHAR CHAR(1);
    CMD_LINE CHAR(200);
    BEGIN
    SORT_CHAR := :SORT_NAME ;
    IF :CALLED = Y THEN
         SRW.GET_PAGE_NUM(PAGE_FOR_INDEX);
         SRW.USER_EXIT(RWECOP PAGE_FOR_INDEX
         P_START_PAGENO);
         SRW.MESSAGE(2,TO_CHAR(:P_START_PAGENO));
    END IF;
    SRW.GET_PAGE_NUM(PAGE_NO);
    CMD_LINE := INSERT INTO SHIP VALUES
                          (||SORT_CHAR||,||TO_CHAR(PAGE_NO)||);
    SRW.MESSAGE(2,CMD_LINE);
    SRW.DO_SQL(CMD_LINE);
    COMMIT;
    EXCEPTION
      WHEN DUP_VAL_ON_INDEX THEN
            NULL;
      WHEN SRW.DO_SQL_FAILURE THEN
            SRW.MESSAGE(1,FAILED TO INSERT ROW INTO SHIP TABLE);
      WHEN OTHERS THEN
           COMMIT;
    END;

  • AP Cheque Printing Report

    Hi All,
    Can anybody help me out to do the AP cheque printing report using XML Publisher.
    Followings are the steps I did.
    1. Create rdf and register in APPS.
    Executable is defined in Customization AP application
    Concurrent Program is in Payables application.
    2. Create Data Definition and Template in XML Publisher administrator in Payables.
    3. Attached the Concurrent program in AP Format set up.
    4. Make the Payment, The report is calling and showing completed normal but the output is not coming.
    5. Then I run the XML report Publisher and pass the request id then the output is coming as PDF.
    But the requirement is when we make the payment , The output should come and it will go to the printer for printing..
    Please help me where I made the mistake.
    or please guide me what approach I should follow.
    Thanks in Advance.
    Pradipta

    Here is my code:
    function AfterReport return boolean is
    vrequest_id number;
    v_success BOOLEAN;
    v_printer fnd_concurrent_requests.printer%TYPE;
    v_print_style fnd_concurrent_requests.print_style%TYPE;
    begin
    -- Set up printer for the following reports
    -- Get the printer and style for this report for use with the following reports select printer, print_style
    into v_printer, v_print_style
    from fnd_concurrent_requests
    where request_id = :P_CONC_REQUEST_ID;
    srw.message(999, 'Print options: ' || v_printer || '/' || v_print_style);
    v_success := fnd_request.set_print_options (v_printer
    ,v_print_style
    ,1
    ,TRUE
    ,'N'
    ,'SKIP'); IF NOT v_success THEN
    srw.message(999, 'Failure to set print options'); ELSE
    srw.message(999, 'Print options set'); end if;
    -- Submit the XML Report Publisher request to complete the printed Dunning Letters
    vrequest_id := FND_REQUEST.SUBMIT_REQUEST('XDO',
    'XDOREPPB',
    NULL,
    NULL,
    FALSE,
    :P_CONC_REQUEST_ID,
    222, -- Receivables
    'XX_ARDLPPRT_RPT',
    'en', 'N', 'RTF', 'PDF', NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
    -- commit to submit request
    commit;
    IF vrequest_id = 0 THEN -- if request id
    srw.message(999, 'Failure to submit Concurrent Request to Print Dunning Letters');
    ELSE
    srw.message(999, 'request id ' || to_char(vrequest_id) || ' submitted');
    end if;
    -- Original Afterreport trigger stuff
    SRW.DO_SQL('alter session set sql_trace false');
    return (TRUE);
    end;

  • Update a table in the database from a report

    The user needs to print a report multiple times for the day but needs to knwo whether or not the data was already printed so that it is not printed again...therefore I have a y/n/all field on the report to allow the user to choose what subsets of data to print...
    Problem is, how do I actually update the data base table and the subset of records currently printed as printed from the report runtime....how do I code this ...
    Please help......

    oyu can use the following to insert or update in data base from reports
    CMD_LINE := 'insert into Table values
    ('''||:toDate||''','||a||')';
    SRW.DO_SQL(CMD_LINE);
    CMD_LINE := 'update Table set net = '||a||'
    where ddate ='''||:todate||'''';
    commit ;

  • How can i create a temporary table in my report

    hi
    how to create temporary tables in reports
    please tell me detailed procedure with an example
    thanks in advance
    prasanth

    in before parameter form or before report trigger or in any triger where u want just pass u r query as..
    SRW.DO_SQL('CREATE TABLE MYTABLE....')
    hope it will solve your porb.
    Thanks

  • Changing the format mask of a numberic field in a  report

    Hi,
    I'm fethcing some numeric values from the DB and displaying them in the report. I'd like to use comma as the decimal separator but I can't get it to work. I'm very lost with all the NLS settings. I've tried using the format mask ad '9999990D00' but it still displays as dot as the decimal separator. What do I have to do in order to use comma as the decimal separator?
    Thanks

    Try putting
    SRW.DO_SQL('alter session set NLS_NUMERIC_CHARACTERS='', ''');
    in the Before Report Trigger.
    The setting might be reused for the next report if Reports is set to reuse the database connection.
    To avoid this, I guess you change it back to default in the After Report Trigger.
    Hope this helps!
    Morten

Maybe you are looking for

  • Please tell me the Plugins (Struts) for eclipse

    I am new in struts, so please anyone tell the name of plugins i have to download. and please tell me the process of run my application in eclipse.

  • Malware/Virus

    I just picked up a 2nd user ipod nano 2nd Gen from Cash Converters.. its fine but i took a look at what was on the ipod by exploring drive and found a file called gifodybul.exe which my avast anti virus checker tells me is malware/trojan horse.... i

  • Do you know , what is Double level domain in ABAP ?

    1. Do you know , what is Double level domain in ABAP ? 2. Have  you heard of any concept called " loggi " or simillar ...?

  • Apple vs Adobe

    When is Apple and Adobe going to sort out the flash player problems that are now  occurring with Lion some target date would be nice to see.

  • Deployment without using enterprise etl options

    I've been burnt by Oracle again! After happily upgrading to 10.2 and shooting off "several toes" creating multiple control centers and configurations, I'm now ready to start deploying from dev to test to qa to prod. While fighting several bugs in OWB