Executing procedure for period

Hi all,
My need is to execute procedure with parameter date for period from 01.03.2011 till 31.03.2011.
One way is to type dates one per line:
EXEC schemename.pkg_name.procedure_name date '2011-03-01';
EXEC schemename.pkg_name.procedure_name date '2011-03-02';
EXEC schemename.pkg_name.procedure_name date '2011-03-30';
EXEC schemename.pkg_name.procedure_name date '2011-03-31';But how do I execute it using more simple code?

Hello
It kind of depends what you mean by simpler. If you want to avoid having 31 separate calls to the procedure listed on 31 lines, you can use a loop like so...
SQL> DECLARE
  2
  3      ldt_StartDate       DATE := TO_DATE('01/03/2011','dd/mm/yyyy');
  4      ldt_EndDate         DATE := TO_DATE('31/03/2011','dd/mm/yyyy');
  5
  6  BEGIN
  7
  8      FOR lc_Dates IN (   SELECT
  9                              ldt_StartDate + (rownum -1) dt
10                          FROM
11                              dual
12                          CONNECT BY
13                              LEVEL <= CEIL(ldt_EndDate - ldt_StartDate) + 1
14                      )
15      LOOP
16          dbms_output.put_line(lc_Dates.dt);
17      END LOOP;
18
19  END;
20  /
01-MAR-11
02-MAR-11
03-MAR-11
04-MAR-11
05-MAR-11
06-MAR-11
07-MAR-11
08-MAR-11
09-MAR-11
10-MAR-11
11-MAR-11
12-MAR-11
13-MAR-11
14-MAR-11
15-MAR-11
16-MAR-11
17-MAR-11
18-MAR-11
19-MAR-11
20-MAR-11
21-MAR-11
22-MAR-11
23-MAR-11
24-MAR-11
25-MAR-11
26-MAR-11
27-MAR-11
28-MAR-11
29-MAR-11
30-MAR-11
31-MAR-11
PL/SQL procedure successfully completed.HTH
David

Similar Messages

  • Error while executing procedure for excel upload

    Hi Friends
    Pl. find below error while executing procedure for loading excel data. pl. verify and suggest for any changes in the format of data.
    Rgds
    SriG

    If reading Excel as a database you would use "Access LSLINK"
    Access external means you are reading a file. I don't think it is possible to treat Excel as a file because the internal structure is complex.
    In the past I have saved the Excel as a CSV or as a Tab delimeted file. Then I use something like
    ACCESS External
      USE &filename
      BEGIN
        DESCRIPTION free ,
        Variables text 20
        Organisation text 20
        'July 2008' numeric 20
        'August 2008' numeric 20
        'September 2008' numeric 20
        'October 2008' numeric 20
        'November 2008' numeric 20
        'December 2008' numeric 20
        'January 2009' numeric 20
        'February 2009' numeric 20
        'March 2009' numeric 20
        'April 2009' numeric 20
        'May 2009' numeric 20
        'June 2009' numeric 20
      END
      peek
      read
    ... quit the access sub system
    END

  • Run procedure for period

    Hi all,
    my need is to run procedure with one input parameter (date), for example
    exec ZOO.PKG_Z60over.prepare(date '2012-01-27')1) this procedure accepts only 1 date, but I need period, for example
    exec ZOO.PKG_Z60over.prepare(date '2012-01-27');
    exec ZOO.PKG_Z60over.prepare(date '2012-01-28');
    exec ZOO.PKG_Z60over.prepare(date '2012-01-29');2) my dates are stored in table calendar1, I'd like to select dates from table instead of typing
    3) how do I run it without "exec" ?
    Thanks ahead.

    marco wrote:
    Hi all,
    my need is to run procedure with one input parameter (date), for example
    exec ZOO.PKG_Z60over.prepare(date '2012-01-27')1) this procedure accepts only 1 date, but I need period, for example
    exec ZOO.PKG_Z60over.prepare(date '2012-01-27');
    exec ZOO.PKG_Z60over.prepare(date '2012-01-28');
    exec ZOO.PKG_Z60over.prepare(date '2012-01-29');2) my dates are stored in table calendar1, I'd like to select dates from table instead of typing
    3) how do I run it without "exec" ?
    Thanks ahead.You can write a PL/SQL block like this where you will query the table calender and loop through it and call the procedure for each row.
    begin
      for i in (select <date_column> from calender1)
      loop
        ZOO.PKG_Z60over.prepare(i.<date_column>);
      end loop;
    end;
    /

  • Error while executing procedure for FTP

    Hi all,
    I am facing error while copying l the csv files from FTP to local directory on my machine.
    I have created a procedure & selected technology jython . please find the code below.
    import snpsftp
    ftp = snpsftp.SnpsFTP('ftp://noid-misa-01-pp/', 'indiaftp', 'PWD')
    ftp.setmode('ASCII')
    ftp.mget('INT/GPInput(AU)/', '*.csv', 'C:\D_DRIVE_NEERAJ\reading')
    ftp.close()
    The error i am receiving is :
    org.apache.bsf.BSFException: exception from Jython: Traceback (innermost last):
    File "<string>", line 2, in ?
    File "C:\OraHome_1\oracledi\bin\..\lib\scripting\Lib\snpsftp.py", line 50, in __init__
    File "C:\OraHome_1\oracledi\bin\..\lib\scripting\Lib\snpsftp.py", line 58, in connect
    File "C:\OraHome_1\oracledi\bin\..\lib\scripting\Lib\ftplib.py", line 118, in connect
    File "C:\OraHome_1\oracledi\bin\..\lib\scripting\Lib\socket.py", line 135, in connect
    java.net.UnknownHostException: ftp://noid-misa-01-pp/

    If reading Excel as a database you would use "Access LSLINK"
    Access external means you are reading a file. I don't think it is possible to treat Excel as a file because the internal structure is complex.
    In the past I have saved the Excel as a CSV or as a Tab delimeted file. Then I use something like
    ACCESS External
      USE &filename
      BEGIN
        DESCRIPTION free ,
        Variables text 20
        Organisation text 20
        'July 2008' numeric 20
        'August 2008' numeric 20
        'September 2008' numeric 20
        'October 2008' numeric 20
        'November 2008' numeric 20
        'December 2008' numeric 20
        'January 2009' numeric 20
        'February 2009' numeric 20
        'March 2009' numeric 20
        'April 2009' numeric 20
        'May 2009' numeric 20
        'June 2009' numeric 20
      END
      peek
      read
    ... quit the access sub system
    END

  • Return code for EXECUTE PROCEDURE (native SQL)

    Hi Experts,
    I've seen in the Note 364707 that the field %_ERRCODE is no longer supported since WAS 6.10 for stored procedures like this:
    EXEC SQL.
      EXECUTE PROCEDURE proc [(parameter list)] %_ERRCODE INTO :rc
    ENDEXEC.
    So an Upgrade to WAS 7.00 gives this programms an error.
    Has anybody an idea for an alternative?
    Regards,
    Stefan

    Hello Peluka,
    i have seen you have worked with 'execute procedure'.
    I want to execute a procedure with two Parameters and one structure. Example:
    EXECUTE PROCEDURE test.p_getdata ( in :i_ls_nr , in :vdatum , out :vtest ).
    vtest has the simple structure with field lieferscheinnr (char25).
    When i execute the procedure, i get the error <b>wrong number or types of arguments in call</b>.
    Do you know, whether execute procedure with structures is not possible?
    Thank you in advance.

  • Execute any procedure for developers

    Hello,
    our developers want the privilege "execute any procedure" because the self-programmed application needs execute on unknown procedures. (Oracle 10.2) It's the application-administrator-user on which the development has full access.
    On AskTom I read, that "execute any procedure" is extremely powerful an should not be granted to normal users.
    I would like to know, if this is only not recommended for O7_DICTIONARY_ACCESSIBILITY=true or under any circumstances.
    Any ideas how we can find out, which procedures are used by this user? Or on the other hand, which are the risky elements from "execute any procedure"?
    Any arguments against giving this privilege are welcome, I have to give a statement on this.
    Thanks,
    M.Hannibal

    Ok. I just browsed through Asktom for this issue and it is true that there are NO risks highlighted over there after granting "EXECUTE ANY PROCEDURE" to a user.
    Though, I would like to put forth following points.
    1. Some of procedures/functions in SYS as not supposed to be used by the normal database users (results can be unpredictable)
    2. Upon grant of this privilege, the user can execute procedure of any schema in the database. This can be problematic if an user of PAYROLL schema starts executing procedures of FINANCE schema and change all accounts (kind of) related information.
    In your situation, you can handle this by creating a DDL trigger in the schema where the procedure will be created. Via trigger, grant execute on this procedure to the user under which the application is going to run.
    Thus you will have control over the procedure execution and you can easily track down the problem if somehting goes wrong (as will then you know who all can execute a particular procedure).

  • Step-by step procedure for INBOUND IDOC (VENDOR CREATE / CHANGE)

    Hi ,
    Can any body provide me the step-by-step procedure for Inbound IDOCS.
    As i'm new to this i need the the clarification between Inbound & outbound idocs.
    How can we differentiate both?
    where to define outbound & where to define Inbound?
    ( If possible Please explain me the procedure for  Vendor Create through INBOUND IDOCS )
    Thanks in advance..

    Hi,
    Ale Technology is SAPu2019s technology to support distributed yet integrated processes across several SAP systems.
    Outbound Process:
    ALE Outbound Process in SAP sends data to one or more SAP Systems. It involves four steps.
    1. Identify the need of IDoc: This step starts upon creating a application document, can relate to a change to a master data object.
    2. Generate the Master IDoc: The document or master data to be sent is read from the database and formatted into an IDoc format. This IDoc is called as a Master IDoc.
    3. Generate the Communication IDoc: The ALE Service layer generates a separate IDoc from the Master IDoc for each recipient who is interested in the data. Separate IDocs are generated because each recipient might demand a different version or a subset of the Master IDoc. These recipient-specific IDocs are called Communication IDocs and are stored in the database.
    4. Deliver the Communication IDoc: The IDoc is delivered to the recipients using an asynchronous communication method. This allows the sending system to continue its processing without having to wait for the destination system to receiver or process the IDoc.
    Inbound Process:
    The inbound process receives an IDoc and creates a document in the system.
    1. Store the IDoc in the database: The IDoc is received from the sending system and stored in the database. Then the IDoc goes through a basic integrity check and syntax check.
    2. Invoke the Posting Module: The control information in the IDoc and configuration tables are read to determine the posting program. The IDoc is then transferred to its posting program.
    3. Create the Document: The posting program reads the IDoc data and then creates a document in the system. The results are logged in the IDoc.
    Over view of IDocs:
    IDoc is a container that is used to exchange data between any two processes. The document represented in an IDoc is independent of the complex structure SAP uses to store application data. This type of flexibility enables SAP to rearrange its internal structure without affecting the existing interface.
    IDoc interface represents an IDoc Type or IDoc data. IDoc Type represents IDocu2019s definition and IDoc Data is an instance of the IDoc Type.
    IDoc Types:
    IDoc type structure can consist of several segments, and each segment can consist of several data fields. The IDoc structure defines the syntax of the data by specifying a list of permitted segments and arrangement of the segments. Segments define a set of fields and their format.
    An IDoc is an instance of an IDoc Type and consists of three types of records.
    i. One Control record: each IDoc has only one control record. The control record contains all the control information about an IDoc, including the IDoc number, the sender and recipient information, and information such as the message type it represents and IDoc type. The control record structure is same for all IDocs.
    ii. One or Many Data records: An IDoc can have multiple data records, as defined by the IDoc structure. Segments translate into data records, which store application data, such as purchase order header information and purchase order detail lines.
    iii. One or Many Status records: An IDoc can have multiple status records. Status record helps to determine whether an IDoc has any error.
    Message in IDoc Type:
    A Message represents a specific type of document transmitted between two partners.
    Outbound Process in IDocs:
    Outbound process used the following components to generate an IDoc. A customer model, and IDoc structure, selection programs, filter objects, conversion rules, a port definition, an RFC destination, a partner profile, service programs, and configuration tables.
    The Customer Model:
    A customer model is used to model a distribution scenario. In a customer model, you identify the systems involved in a distribution scenario and the message exchanged between the systems.
    Message control:
    Message control is a cross application technology used in pricing, account determination, material determination, and output determination. The output determination technique of Message control triggers the ALE for a business document. Message control separates the logic of generating IDocs from the application logic.
    Change Pointers:
    The change pointers technique is based on the change document technique, which tracks changes made to key documents in SAP, such as the material master, customer master and sales order.
    Changes made to a document are recorded in the change document header table CDHDR, and additional change pointers are written in the BDCP table for the changes relevant to ALE.
    IDoc Structure:
    A message is defined for data that is exchanged between two systems. The message type is based on one or more IDoc structures.
    Selection Program:
    Is typically implemented as function modules, are designed to extract application data and create a master IDoc. A selection program exists for each message type. A selection programu2019s design depends on the triggering mechanism used in the process.
    Filter Objects;
    Filter Objects remove unwanted data for each recipient of the data basing on the recipients requirement.
    Port Definition:
    A port is used in an outbound process to define the medium in which documents are transferred to the destination system. ALE used a Transactional RFC port, which transfers data in memory buffers.
    RFC Destination:
    The RFC destination is a logical name used to define the characteristics of a communication link to a remote system on which a function needs to be executed.
    Partner Profile:
    A partner profile specifies the components used in an outbound process(logical name of the remote SAP system, IDoc Type, message type, TRFC port), an IDocu2019s packet size, the mode in which the process sends an IDoc (batch versus immediate), and the person to be notified in case of error.
    Service Programs and Configuration Tables:
    The outbound process, being asynchronous, is essentially a sequence of several processes that work together. SAP provides service programs and configuration tables to link these programs and provide customizing options for an outbound process.
    Process flow for Distributing Transactional Data:
    Transactional data is distributed using two techniques: with Message control and without message control.
    Process flow for Distributing Master Data:
    Master data between SAP systems is distributed using two techniques: Stand alone Programs and Change Pointers.
    Triggering the Outbound Process via Stand-Alone Programs:
    Stand-Alone programs are started explicitly by a user to transmit data from one SAP system to another. Standard Programs for several master data objects exist in SAP. Ex. The material master data can be transferred using the RBDSEMAT program or transaction BD10.
    The stand-alone programs provide a selection screen to specify the objects to be transferred and the receiving system. After the stand-alone program is executed, it calls the IDoc selection program with the specified parameters.
    Triggering the Outbound Process via Change Pointers:
    The change pointer technique is used to initiate the outbound process automatically when master data is created or changed.
    A standard program, RBDMIDOC, is scheduled to run on a periodic basis to evaluate the change pointers for a message type and start the ALE process for distributing the master data to the appropriate destination. The RBDMIDOC program reads the table TBDME to determine the IDoc selection program for a message type.
    Processing in the Application Layer:
    The customer distribution model is consulted to make sure that a receiver has been defined for the message to be transmitted. If not, processing ends. If at least one receiver exists, the IDoc selection program reads the master data object from the database and creates a master IDoc from it. The master IDoc is stored in memory. The program then calls the ALE service layer by using the function module MASTER_IDOC_DISTRIBUTE, passing the master IDoc and the receiver information.
    Processing in the ALE Interface Layer:
    Processing in the ALE Layer consists of the following steps:
    u2022 Receiver Determination: The determination of the receiver is done through Customer Distribution Model.
    u2022 IDoc Filtering: if an IDoc filter is specified in the distribution model for a receiver, values in the filter are compared against the values in the IDoc data records. If a data record does not meet the filter criteria, it is dropped.
    u2022 Segment Filtering: For each sender and receiver combination, a set of segments that are not required can be filtered out.
    u2022 Field conversion: Field values in data records are converted by using the conversion rules specified for the segment.
    u2022 Version change for segments: Segments are version-controlled. A new version of a segment always contains fields from the preceding version and fields added for the new version. Release in IDoc type field of the partner profile to determine the version of the segment to be generated.
    u2022 Version change for IDocs: IDocs are also version controlled. The version is determined from the Basic Type field of the partner profile.
    u2022 Communication IDocs generated: The final IDoc generated for a receiver after all the conversions and filtering operations is the communication IDoc. One master IDoc can have multiple communication IDocs depending on the number of receivers identified and the filter operations performed. IDoc gets the status record with a status code of 01 (IDoc Created).
    u2022 Syntax check performed: IDoc goes through a syntax check and data integrity validation. If errors found the IDoc get the status of 26 (error during syntax check of IDoc u2013 Outbound). If no errors found the IDoc gets the status 30 (IDoc ready for dispatch u2013 ALE Service).
    u2022 IDoc dispatched to the communication Layer: In the ALE process, IDocs are dispatched using the asynchronous RFC method, which means that the sending system does not await for data to be received or processed on the destination system. After IDocs have been transferred to the communication layer, they get a status code 01 (Data Passed to Port OK).
    Processing in the Communication Layer:
    To dispatch an IDoc to a destination system, the system reads the port definition specified in the partner profile to determine the destination system, which is then used to read the RFC destination. The RFC destination contains communication settings to log o to the remote SAP system. The sending system calls the INBOUND_IDOC_PROCESS function module asynchronously on the destination system and passes the IDoc data via the memory buffers.
    Inbound Process in IDocs:
    An inbound process used IDoc structure, posting programs, filter objects, conversion rules, a partner profile, service programs, and configuration tables to post an application document from an IDoc.
    Posting Program:
    Posting programs, which are implemented as function modules, read data from an IDoc and create an application document from it. A posting program exists for each message. Each posting program is assigned a process code. A process code can point to a function module or a work flow. In the standard program process codes always point to a function module.
    Ex. The posting program for message type MATMAS is IDOC_INPUT_MATMAS which has a process code MATM.
    Workflow:
    A workflow represents a sequence of customized steps to be carried out for a process. The workflow management system is used to model the sequence, identify information required to carry out the steps and identify the person responsible for the dialog steps.
    Partner Profile;
    A partner profile specifies the components used in an inbound process (partner number, message type, and process code), the mode in which IDocs are processed (batch versus immediate), and the person to be notified in case of errors.
    Process flow for the Inbound process via a Function Module:
    In this process, IDocs are received from another system and passed to the posting function module directly.
    1. Processing in the communication Layer:
    The IDOC_INBOUND_ASYCHRONOUS program, triggered as a result of an RFC from the sending system, acts as the entry point for all inbound ALE processes. The IDoc to be processed is passed as an input parameter. Control is transferred to the ALE/EDI layer.
    2. Processing in the ALE/EDI Interface Layer:
    u2022 Basic integrity check: A basic integrity check is performed on the control record.
    u2022 Segment Filtering and conversion: Filtering out unwanted segments and carry out any required conversion of field values.
    u2022 Creation of Application IDoc: The application IDoc is created and stored in the database and a syntax check is performed. If there are errors it gets status code of 60 (Error during Syntax check of IDoc u2013 Inbound). At this point a tangible IDoc, which can be monitored via one of the monitoring transactions, is created and the IDoc gets status code 50 (IDoc Added).
    u2022 IDoc Marked ready for Dispatch: IDoc gets the status code 64 (IDoc ready to be passed to application).
    u2022 IDoc is passed to the posting program: The partner profile table is read. If the value of the Processing field is set to Process Immediately, the IDoc is passed to the posting program immediately using the program RBDAPP01.
    3. Processing in the Posting Module:
    The process code in the partner profile points to a posting module for the specific message in the IDoc. The posting program implemented as a function module either calls a standard SAP transaction by using the Call Transaction command for posting the document or invokes a direct input function module.
    The results of execution are passed back via the function moduleu2019s output parameters. If the posting is successful IDoc gets the status code 53 (Application Document Posted) or it gets status code 51 (Error: Application Document Not Posted).

  • How to execute procedure in SQL Worksheet ?

    Hi, anybody know, how I can execute procedure here?
    I try EXEC sec_roles, EXEC security_admin.sec_roles, EXECUTE - there is a SQL statement error. When I use CALL - there is no such procedure (I have execute previleges).
    Although in SQLPlus EXEC works, but there are problems with standard SQL commands (all of them returns "2" no matter what content is).
    Any ideas?
    Regards
    Krzysztof

    exec procedure(parameters) is a sql plus (and a few others) shortcut for
    BEGIN
       procedure(parameters);
    END;So try that then pressing/clicking whatever it is in sql worksheet that makes a statement run.
    Note that if your procedure has parameters defined as OUT or IN OUT, you will need to supply a variable to accept the returned value(s).
    John

  • Execute PROCEDURE in ORACLE

    I try to execute procedure on ORACLE(8i) but get err SQLException ..
    but for SELECT UPDATE INSERT statements all is OK!!
    for SELECT, UPDATE, INSERT I wrote such code:
    Statement stmt = conn.createStatement();
    String strExec="SELECT ...."
    stmt.executeQuery(strExec); (OR stmt.executeUpdate(strExec);)for proceure I wrote
    strExec = " my_proc() ";
    stmt.execute(strExec);what is wrong here??

    Try like this,
    CallableStatement cstm = con.prepareCall("{ call my_proc }");
    cstm.executeUpdate();
    Sudha

  • How to execute KISR for multiple cycles in one step?

    CO Experts,
    I have a business reqirement to reverse the previous month assessments into the next period. I am planning to use KISR, but I could not find any way to execute KISR for multiple cycles, similar to the RKGALKSU5
    program ? Is there any program available to makes possible the above ?
    Thanks and Regards
    Peter

    Hi Samir,
    Please feel free to take a look at Liaison Messenger EDD, www.liaisonsc.com
    Messenger EDD automates business form and report distribution and uses your existing SAP reports. The end user selects either a batch or a single document through your normal print process in SAP but now uses our Messenger EDD print driver and Messenger will then distribute the documents selected based on rules you set up at initial configuration.
    For example, through the single print selection:
    - Distribute Invoices to the customers preference (print, fax, or email) if email, it attaches a PDF of the document
    - Archive a copy to desired folder
    - Print a hard copy to attach to other paperwork
    - Attach a static or variable attachment like terms and conditions, marketing PDF, or supporting variable documents.
           * PDF creation is included with the product.
    Set up similar rules for Sales Orders, PO's, Statements or even shipping documents like Packing Slips, Picking Tickets, Bills of Lading and
    International docs, etc.
    Please reach me at [email protected] or 714.543.9877x201 if you have any questions or would like to view an on-line demonstration.
    Best Regards,
    Tom Nielsen
    Liaison Software

  • Stored Procedure For Web Service in Visual Composer 7.1

    Hello,
    I want to use stored procedure for Webservice in Visual Composer 7.1
    I can find this Web service but not supported. ( ex) prcreleased_test - Not supported )
    Log.
    Message: Error in connection - Can' t execute Web service.
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.processExecution: 
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb
    Log2
    Message: Stopped further execution since the interpreter is unusable
    Date: 2008-07-01
    Time: 16:41:43:906
    Category: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent
    Location: com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.XGLInterpreter
    Application: sap.com/test~kmshim_wf_impl
    Thread: HTTP Worker [1]
    Data Source: j2ee\cluster\server0\log\defaultTrace_00.trc
    Correlator ID: 240496500000034715
    Argument Objects: 
    Arguments: 
    DSR Component: n.a.
    DSR Transaction: cb4b3560473711dd9fb4001e4f3b8fcb '
    Help me^^ plz..

    Hi Tanna.
    Thanks for your reply^^
    I create webservice that access my stored procedure.
    But not supported.
    http://dmp.humaxdigital.com/HumaxCmdwService/Service1.asmx?wsdl
    There are two service. (Hello World - Test, prcrelease_test - Stored Procedure )
    'Hello World' is supported but prcrelease_test is not supported. I can't drag to storyboard.
    Our company's DB is MSSQL2005.
    please help me^^

  • ORA-06550 error while executing procedure

    HI Friends,
    I have written a proc for the below process.
    SP_Control (table)
    sno     campgn_id     campgn_typ     campgn_no     current_wave
    1     ET07001     ONB     ONB01     1
    2     ET07001     ONB     CNB01     1
    3     ET03053     IAL     IAL1A     A
    4     ET03053     IAL     IAL2A     A
    5     ET03053     IAL     IAL3A     A
    6     ET03053     IAL     IAL4A     A
    After calling the procedures with bellow parameters
    Get_next_campgn(‘ONB01’,’ONB’);
    Get_next_campgn(‘CNB01’,’ONB’);
    Get_next_campgn(‘IAL1A’,’IAL’);
    Get_next_campgn(‘IAL2A’,’IAL’);
    Get_next_campgn(‘IAL3A’,’IAL’);
    Get_next_campgn(‘IAL4A’,’IAL’);
    …………… it should update the table with below data.
    sno     campgn_id     campgn_typ     campgn_no     current_wave
    1     ET07001     ONB     ONB02     2
    2     ET07001     ONB     CNB02     2
    3     ET03053     IAL     IAL1B     B
    4     ET03053     IAL     IAL2B     B
    5     ET03053     IAL     IAL3B     B
    6     ET03053     IAL     IAL4B     B
    I have written a procedure like this and its compliled successfully.
    But throws error while executing like
    execute Get_next_campgn(‘ONB01’,’ONB’);
    create or replace procedure Get_next_campgn(p_campgn varchar2,p_type varchar2)
    as
    begin
    update SP_Control set campgn_no = substr(p_campgn,1,length(p_campgn)-1)||to_char(ascii(substr(p_campgn,-1,1))+1) ,
    curr_wave = to_char(ascii(curr_wave)+1)
    where campgn_type = p_type
    and campgn_no = p_campgn ;
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end Get_next_campgn;
    Error::::
    Error starting at line 15 in command:
    execute Get_next_campgn(‘ONB01’,’ONB’)
    Error report:
    ORA-06550: line 1, column 24:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    ( ) - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable>
    table continue avg count current exists max min prior sql
    stddev sum variance execute multiset the both leading
    trailing forall merge year month day hour minute second
    timezone_hour timezone_minute timezone_region timezone_abbr
    time timestamp interval date
    <a string literal with character set specification>
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Please suggest....

    The procedure executed successfully for me.
    drop table sp_control;
    create table sp_control
      campgn_no varchar2(20),
      curr_wave varchar2(20),
      campgn_type varchar2(20)
    insert into sp_control values ('ONB01', '1', 'ONB');
    insert into sp_control values ('IAL1A', 'A', 'IAL');
    create or replace procedure Get_next_campgn(p_campgn varchar2,p_type varchar2)
    as
    begin
    update SP_Control set campgn_no = substr(p_campgn,1,length(p_campgn)-1)||to_char(ascii(substr(p_campgn,-1,1))+1) ,
    curr_wave = to_char(ascii(curr_wave)+1)
    where campgn_type = p_type
    and campgn_no = p_campgn ;
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end Get_next_campgn;
    begin
      Get_next_campgn('ONB01','ONB');
    end;
    select * from sp_control;
    --Output as Follows:
    drop table sp_control succeeded.
    create table succeeded.
    1 rows inserted
    1 rows inserted
    procedure Get_next_campgn(p_campgn Compiled.
    anonymous block completed
    CAMPGN_NO            CURR_WAVE            CAMPGN_TYPE         
    ONB050               50                   ONB                 
    IAL1A                A                    IAL                 
    2 rows selectedJust a hunch, in the Procedure call
    execute Get_next_campgn(‘ONB01’,’ONB’);the "Single Quotes" does not appear correct. They were probably typed into some other editor.
    When executed as
    execute  Get_next_campgn(‘ONB01’,’ONB’);
    Error starting at line 1 in command:
    begin
      Get_next_campgn(‘ONB01’,’ONB’);
    end;
    Error report:
    ORA-06550: line 2, column 19:
    PLS-00103: Encountered the symbol "‘" when expecting one of the following:
       ( ) - + case mod new not null <an identifier>
       <a double-quoted delimited-identifier> <a bind variable>
       table continue avg count current exists max min prior sql
       stddev sum variance execute multiset the both leading
       trailing forall merge year month day hour minute second
       timezone_hour timezone_minute timezone_region timezone_abbr
       time timestamp interval date
       <a string literal with character set specification>
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:So, just replace them in any SQL editor and your Invoker block shall work properly.
    Regards,
    P.

  • While executing procedure it is giving Error in the TT IMD

    Hi Chris,
    Main User Cacheuser (Cache Admin User)
    Other User Interchange (TimesTen User - Same name as Oracle 11g Database User)
    Normally we are connecting through cacheuser to create any objects in the Interchange user.
    I have created procedure in the Interchange user from cacheuser cache admin user.
    Procedure is created in the Interchange user. but when i am executing that same procedure in the cacheuser user
    -- Pl/Sql block executing from cacheuser
    declare
    sOutPut varchar2(4000);
    begin
    interchange.#procedurename# ('123456', sOutPut);
    end;
    After executing we are getting error:
    failed,[TimesTen][TimesTen 11.2.1.3.0 ODBC Driver][TimesTen]TT5227: Insufficient privileges error occurred while performing an Oracle operation in OCIStmtExecute(): ORA-01031: insufficient privileges rc = -1. -- file "bdbStmt.c", lineno 3868, procedure "ttBDbStmtExecute()"
    then we have issued following command for privilege, but still it is coming same error.
    grant execute on interchange."procedurename" to cacheuser;

    Hi Chris,
    Previously PassThrough=1 (we have kept this parameter to access oracle objects from TT IMD) it was there in our sys_odbc.ini file, but after that we have created procedure in the TimesTen and also created all objects related to that procedure in the TimesTen database. and due to that we have removed passthrough entry from sys_odbc.ini file because all object we created in the TimesTen database.
    Purpose of creating all objects related to that procedure in the TimesTen database was we tried to compiled procedure in the TimesTen IMD and the some obejcts inside procedure refered from Oracle 11G database that time it was shown error "table does not exist".
    Note : That time PassThrough parameter set was "1".+
    Currently we are executing procedure through TimesTen Database only. we have not yet checked through application.
    Can i have list of passthrough and the purpose of the same.

  • Error when executing statement for table/stored proc

    Hi All,
          I am getting this error when executing IDOC to JDBC (Stored Procedure) Scenario.
         In my stored procedure I have three insert statements to insert rows in to 3 tables.
        This stored procedure is working fine for two insert statements i.e, 
             For this I have created data type for stored procedure with 10 elements and executed the scenario and was successfully running.
        when I added 3rd insert statement to stored procedure ie., when i added 5 more elements to the datatype (totally 15 elements) it starts giving the bellow error in Message Monitoring.
    <i><b>Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
    <i><b>Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
       Note:- I have run the stored procedure  with three insert statements in Sql Server, and also by calling an external program also, and was working fine.
    <i><b> Note : Is there any structure needs to be follow when working with IDOC to Stored procedure.</b></i>
    I am struck up with the error, can any body resolve this issue.
    Thanks in Advance,
    Murthy

    Hi narasimha,
                      This seems to be any error due to incorrect query formation.In your receiver jdbc channel set the parameter logSQLstatement = true.you can find this parameter in the advanced mode. Using this parameter you will be able to see the sql query which is generated at runtime in the audit log in RWB.
    Regards,
    Pragati

  • Error in Release procedure for PO

    Hi
    I have created a release procedure for Purchase groups and plants. But now I want to add a new Purchasing group to the same strategy. How to do this.

    Hi Garapati,
    Release strategy is configuration in customisation screen. Do not merely do assignment of object via CL20N or CL24N. Though assigning the object would work, but is better to do it in customisation.
    Go to this path: -
    SPRO>IMG>Materials Management>Purchasing>Purchase Order>Release Procedure for Purchase Orders>Define Release Procedure for Purchase Order (Execute)-->Release Strategies
    Go to: Position>Identify the Group> Identify the Release Strategy code
    (How to know what is the release strategy code? In the PO where a release strategy for this value and characteristic is triggered, you can go to the Header-->Release Strategy tab, you would be able to see that the release strategy is triggered. Simply remember the release strategy code. If you already know the code, ignore this step)
    When the search is complete and located the right release strategy that you want to amend, select it and click on Details.
    Inside, go to Classification. Check that this release strategy contain the characteristic that you want to amend. You would be able to see the Characteristic "Purchasing Group" already maintained. Click on Purchasing Group line and click on "Add rows" icon below, then key in the the Purchasing Group value that you want to add.
    Hit Back, and then Save this customisation.
    Now, the PO release strategy will trigger the Purchasing Group you just added if the PO details entered matched the Purchasing Group, Plant and Document Type value that you maintained for this release strategy.
    Hope this helps.
    Rgds.

Maybe you are looking for