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

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

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

  • 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

  • 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

    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.

  • Srw.run_report problem with distribute=yes

    srw.run_report distribute=yes is not working for me. When running the report in rwbuilder or using command line rwrun, the distribution works fine.
    The problem is eg. a report on employee, with a group on Dept_no. Dept_no is used as distribution list &<dept_no> i the distriubution Dialog in the Report and repeat on G_dept.,
    The report wil generate a number of reports e.g. Dept_no_10.pdf, Dept_no_20.pdf and so on.
    BUT, the file name Dept_no_10.pdf is containing data from Dept 20, and the file name4d Dept_no_20.pdf contains data from Dept 20.
    So the question is, if the report can distinguish the number of files to generate and the correct name, how come the data is corrupt ?
    Any ideas is wellcome.
    Our installation is 11.2.0.2 and I'm using Reports 9.0.4.0.33.
    The use of srw.run_report distribute=no is working fine.
    The setup is to run from pl/sql calling srw.run_report
    claus
    try for a better example at this link : https://technology.amis.nl/wp-content/uploads/images/Reports%20Bursting.pdf
    This explains classic distribution/bursting of reports, and it works with rwbuilder/rwrun, bur not through srw.run_report

    Hello,
    If you copy the parameters displayed by srw.message and create a BAT file with these parameters
    and rwrun60 :
    rwrun60 <the paremeters displayed by srw.message>
    Does the report run correctly ?
    Regards

  • Password Recovery SRW Switch problem - SRW224G4P

    Hi,
    i have a problem with an SRW224G4P.
    I have lost my admin password. And yes i have read the "Linksys SRW series Switch Password Recovery Procedure".
    My problem is that the message "Autoboot in 2 seconds - press RETURN or Esc. to abort and enter prom." don't appear.
    So what can i do?
    Thanks for your help.

    After many reboots, many hours and several terminal software, i get never a message like "Autoboot in 2 seconds - press RETURN or Esc. to abort and enter prom."
    Below an Log-File with all Bytes coming from the switch after reboot till then Logon-Screen appears.
    So what can i do????? Any idea ??
    Thanks for your help.
    Image Loader 1.0.1
    Loading Diagnostic Image File : SRW224G4P_SRW248G4P_boot.bix
    Diagnostic 1.0.1
    User Mode
    --- Performing Power-On Self Tests (POST) ---
    DUMMY Test 1 ................. PASS
    UART Loopback Test ........... PASS
    POE UART Loopback Test ....... PASS
    DRAM Test .................... PASS
    Timer Test ................... PASS
    Done All Pass.
    ------------------ DONE ---------------------
    Loading Runtime Image File : SRW224G4P_SRW248G4P_image.bix
    Runtime 1.0.2
    Pass
    root init done
    Set Transition mode ...
    [get stackingMac done ret_val] = 1
    Assigned Unit ID:[1]
    stacking DB: unit = 0, module type = 0
    Finish Set Transition mode ...
    Enter Transition mode ...
    Finish Transition mode ...
    Enter Master mode ...
    Load certificate files : Starting
    Load certificate files : Finished
    Finish Master mode ...
    Performing startup provision ...
    CLI enter main (PROVISION)
    Press [P] to print out the detail provision message
    !<stackingDB>00</stackingDB>
    !<stackingMac>01_00-1c-10-ee-ac-fc_00</stackingMac>
    phymap 00-1c-10-ee-ac-fc
    hostname SRW224G4P_01
    SNTP server 192.168.1.1 0.0.0.0 0.0.0.0
    SNTP client
    clock timezone UTC hours 1 minute 0 after-UTC
    ^
    Invalid input detected at '^' marker.
    SNMP-server location [cleaned]
    SNMP-server contact [cleaned]
    clock timezone-predefined GMT+0100-Amsterdam,Berlin,Bern,Rome,Stockholm,Vienna
    clock summer-time predefined EUROPE
    ^
    Invalid input detected at '^' marker.
    power mainpower maximum allocation 180 unit 1
    snmp-server community public ro
    snmp-server community private rw
    username admin access-level 15
    username admin password 7 1fe56bbd74eacf7[cleaned]
    enable password level 15 7 1b3231655cebb7[cleaned]
    VLAN database
    VLAN 1 name DefaultVlan media ethernet state active
    spanning-tree MST configuration
    interface ethernet 1/1
    switchport allowed vlan add 1 untagged
    switchport native vlan 1
    ![REDUCED] interface ethernet 1/24
    switchport allowed vlan add 1 untagged
    switchport native vlan 1
    interface ethernet 1/25
    switchport mode trunk
    switchport allowed vlan add 1 untagged
    switchport native vlan 1
    interface ethernet 1/26
    switchport mode trunk
    switchport allowed vlan add 1 untagged
    switchport native vlan 1
    interface ethernet 1/27
    switchport mode trunk
    switchport allowed vlan add 1 untagged
    switchport native vlan 1
    interface ethernet 1/28
    switchport mode trunk
    switchport allowed vlan add 1 untagged
    switchport native vlan 1
    interface VLAN 1
    IP address 192.168.1.111 255.255.255.0
    no ip name-server auto
    no IP HTTP server
    ip dhcp hostname SRW224G4P_01
    line console
    silent-time 0
    line VTY
    end
    Notify provision complete
    CLI provision has been completed
    Provision Complete ...
    Finish Provision Complete ...
    [get stackingMac done ret_val] = 1
    XFER: End of config sync.
    [0m[0m[24;0H
    Please press <Enter> to start Menu session!

  • Srw.run_report problem

    Hi all,
    i'm trying to run a report inside another report using srw.run_report routine, but i get the following error:
    REP-0110: Impossible to open file 'app/OA11i/NOCE/software.ds/noceappl/xxene/11.5.0/reports/I/XXENE_PROPACCPDRNOINT.rdf'
    the full command that i use is: srw.run_report('report=app/OA11i/NOCE/software.ds/noceappl/xxene/11.5.0/reports/I/XXENE_PROPACCPDRNOINT.rdf desname=DL006345.pdf destype=file desformat=pdf batch=yes P_PDR_ID=10015 P_DATA_ATTIVAZIONE=20-FEB-07 P_USE_SITE=LEGAL');
    Thanks for the help,
    bye
    Simona

    Hello Simona,
    Below is the definition of the error you are getting:
    Cause:     Report Builder tried to open the file shown and could not.  The possible causes of this error include the following:       
            Case 1:     The file was not found under the specified name in the specified location. 
            Case 2:     You lacked the necessary privileges to open the file. 
            Case 3:     A system error made it impossible to open the file. 
    Action:     You can take the following actions to correct this error:       
            If Case 1:     Make sure the file is stored in the specified directory under the specified name.  If it is not, change the directory and/or filename as appropriate. 
            If Case 2:     Make sure that you have the privileges necessary to open the file.  If you do not, change your privileges accordingly. 
            If Case 3:     Consult your operating system documentation or contact your system administrator.Hope this helps.
    -Marilyn

  • Srw.run_report problem. Help needed...Urgent

    Hi,
    I am very new to Oracle Reports. I need some help in using the srw.run_report
    I am having two reports. Rep_A and Rep_B
    I will always invoke the Rep_A first...Rep_B should always be invoked in Rep_A
    In Rep_A, i need to check a parameter P_Param1 and based upon the value i need to proceed as follows
    If P_Param1 = 1 then
    --Rep_A should be generated and returned as stream(cache)
    --Rep_B shouldnt be invoked
    If P_Param1 = 2 then
    --Rep_B should be generated and returned as stream.
    --Rep_A should not be generated
    If P_Param1 = 3 then
    --Rep_A and Rep_B should be generated and returned as stream
    --(Rep_A followed by Rep_B)
    If P_Param1 = 4 then
    --Rep_A and Rep_B should be generated and saved as files in a specified location.(this location is in another machine)
    This is my requirement. I hope I am clear with my requirement.
    How can we achieve these.
    Are there any technical issues?
    Please guide me
    thanks...
    siva

    Hi all,
    just to keep this thread active.
    can anyone help me in using srw.run_report.
    its an urgent requirement.
    thanks...
    siva

  • Srw 2008 problem

    hello i need some help    i  was following   this tutoriol to configured a vlan on my switch , but a made a mistake and i lock my self out of the switch ,i changed the default vlan 1
    for vlan 2 whit out seting the pvid and now i cant get access to the switch is there a way resseting it
    ps i have try  by telnet with no luck so far
    any help will be  much appreciable
    i got stuck on image 12 here i did not completed the steps
    http://www.smallnetbuilder.com/lanwan/lanwan-howto/30071-vlan-how-to-segmenting-a-small-lan?start=4
    hola nesecito ayuda con el srw 2008 estaba siguiendo este tutorial , pero cometi un error al intentar cambiar  la vlan 1 que viene por defecto por una que yo habia creado vlan 2 pero que todabia no le habia asignado el pvid , por lo cual no puedo aceder al switch , ni por telnet , y si le doy ping me sale destination host unreachable , y quisiera resetearlo de alguna manera
    gracias de antemano

    Hi Juan,
    Thank you for participating in the Small Business support community. My name is Nico Muselle from Cisco Sofia SBSC.
    The console cable is the cable that was delivered with the switch when you purchased it, it should be a normal serial cable. You have to connect using putty or hyperterminal with a speed of 38400 baud.
    Then you log on to the console using your normal login and password. In the menu you will have the option to reset the switch to factory defaults. This will erase the startup configuration and set the switch back to it's standard configuration, the management vlan will be VLAN 1.
    To learn how to connect through the console cable, you can take a look here and look for chapter 4. If you are not really sure on how to do it or you need any assistance, you can always contact your nearest Small Business Support Center, contact phone numbers can be found here
    Hope this helps
    Best regards,
    Nico Muselle
    Sr. Network Engineer - CCNA

  • Reports 6 using SRW.RUN_REPORT - problem with transferring variable to new report.

    I have one report "analyse" that calls another report "pdf".
    In "analyse" i have a function pdf_rep:
    FUNCTION PDF_Rep(c_proevenummer varchar2) RETURN boolean IS
    msg char(150);
    BEGIN
    SRW.Run_Report
    ('BATCH=YES
    REPORT=PDF
    DESTYPE=file
    DESFORMAT=PDF
    desname=test1.pdf
    p_proevenummer='||(c_proevenummer) );
    return(true);
    exception
         when srw.run_report_failure then
         msg := srw.geterr_run;
         srw.message(1,'err msg: '||msg);
         return(false);
    END;
    This function is called from BeforeReport-trigger. (or AfterParameterForm-trigger)
    The "pdf" query:
    select proevenummer
    from View_Analyse
    where proevenummer= :p_proevenummer;
    The "pdf" report is run and a test1.pdf file is made BUT the where-clause is NOT performed.
    What do i do wrong ?

    Hello,
    If you copy the parameters displayed by srw.message and create a BAT file with these parameters
    and rwrun60 :
    rwrun60 <the paremeters displayed by srw.message>
    Does the report run correctly ?
    Regards

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

  • Reports 10g problem: Before parameter form trigger(BPFT) problem

    In report bilder there is no problem - I get parameter form wit all the parameters, I initialized in BPFT
    function BeforePForm return boolean is
    s_date date;
    begin
    s_date := Trunc(SYSDATE);
    if :PAR_TEM_OD is null then
         :PAR_TEM_OD := '1';
    end if;     
    if :PAR_TEM_DO is null then
         :PAR_TEM_DO := '9';
    end if;     
    if :PAR_DAT_OD is null then
         :PAR_DAT_OD := s_date ;
    end if;     
    if :PAR_DAT_Do is null then
         :PAR_DAT_Do := s_date ;
    end if;     
    return (TRUE);
    end;
    PAR_DAT_... is data type DATE wit input mask DD.MM.YYYY.
    REPORT crashes when I run it from forms - no parameter form is displayed. When I initialize only CHAR PARAMETERS IN BPFT then I get result - parameter form is displayed. . The problem is when I want to initailize DATE parameters.
    Any idea?
    Gordan

    Why are you using srw.do_sql here? You are just performing some sql and pl/sql statements here. This is an explanation of do_sql in the Report Builder Help:
    "Since you cannot perform *DDL statements* in PL/SQL, the SRW.DO_SQL packaged procedure is especially useful for performing them within Report Builder, instead of via a user exit."
    So, your code would simply be:
    function BeforePForm return boolean is
      segment2 varchar2(10);
    begin
      select segment1
      into segment2
      from xxmssl_po_headers_all
      where rownum<2;
    ... etc. ...
    end;

Maybe you are looking for

  • Need to run 3 DVI Displays from my Mac Pro

    Hello, I have a 30 inch Display (the first gen, with the DVI connector), an old 23 inch Cinema Display (easel stand), and a 17 inch flat screen display (easel stand). I'd like to hook up all 3 to a Mac Pro. Does anyone have an idea of what graphic ca

  • How can i install adobe reader in my nokia lumia 510 with window 7

    how can i install adobe reader in my nokia lumia 510... Without it my phone is useless..... Its of great important to me..

  • SAPScript print out Margin problem

    Hi Gurus, I have configured a printer already existing to one of my storage location. When I am taking print out of material document, it is not coming correctly. Text is getting wrapped up on right hand side. But the preview of same material documen

  • LMS 3.2 gives Application error during Campur User tracking

    Hi All, As per the subject during Campus User Tracking following error comes. Application error: URN_NOT_FOUND : urn "ogs_server_urn" : Not found !!.. Please let me know if anybody has solution for this. Thanks in advance. Samir

  • What  new line character in string is needed to show new line

    If i need to show java string in a html text area with new lines(that is 2 -3 lines of text ) what new line character i need to add. I tried \n and /n but these are not working fine. Can anyone help me.