Problem using script stored procedure as using EXEC dbo.sp_executesql

When I use the Script Stored Procedure AS Create or Drop And Create I want to get the stored procedure returned like in 2008 some how I have missed a setting and I am getting it like this.  I get the sp_executesql instead of just the create procedure
and if I use a single quote it encloses them in single quotes.  Can some one please give me the setting I can't find it?
IF
NOTEXISTS(SELECT*FROMsys.objectsWHEREobject_id=OBJECT_ID(N'[dbo].[usp_record_count]')ANDtypein(N'P',N'PC'))
BEGIN
EXEC
dbo.sp_executesql@statement
=N'--DECLARE
@tablename AS sysname;
--SET @tablename = ''[Production].[Product]''
CREATE PROCEDURE [dbo].[usp_record_count]
(@tablename sysname)
AS
BEGIN
SET NOCOUNT OFF
EXECUTE (''SELECT COUNT(*) FROM '' + @tablename)
END
END
Thank you for you help!!!!
Antonio

If you have Include IF NOT EXISTS clause
to TRUE
then SQL wraps
the script in a sp_executesql statement no matter how you generate the script including above cases. To get rid of SQL wraps
the sp_executesql statement need to set it to FALSE.
AFAIK only alternative is to use
sp_helptext 'proc_name'
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
Praveen Dsa | MCITP - Database Administrator 2008 |
My Blog | My Page

Similar Messages

  • What is the problem with this Stored Procedure

    Hi ,
    What is the problem with this Stored Procedure ?Why is it giving errors ??
    CREATE or replace  PROCEDURE getEmpName
    *(EMP_FIRST OUT VARCHAR2(255))*
    BEGIN
    SELECT ename INTO EMP_FIRST
    FROM Emp
    WHERE EMPNO = 7369;
    END ;
    */*

    You don't specify precision in procedure arguments.
    (EMP_FIRST OUT VARCHAR2(255))should be
    (EMP_FIRST OUT VARCHAR2)Since you asked what's wrong with it, I could add that it needs formatting and the inconsistent use of upper and lower case is not helping readability.

  • Problem: PL/SQL + Stored Procedure + Sequence + Trigger + Transaction + Violation Key

    I have a violation key when i insert some datas from a stored procedure. Why ???
    This is my script :
    1) The script of the table :
    CREATE TABLE OLLMULTI (
         IDO int NOT NULL ,
         IDL int NOT NULL ,
         T1 varchar2 (2) NOT NULL ,
         IDR int NOT NULL ,
         Constraint pk_outilsllmulti PRIMARY KEY (IDO, IDL, T1) ,
         Constraint u_outilsllmulti unique (IDR) );
    2) Now, i want to manage automatic increment field on IDR :
    I create a sequence :
    create sequence OLLMULTI_sequence increment by 1 start with 1;
    I create the trigger :
    create or replace trigger OLLMULTI_trigger
    before insert on OLLMULTI
    for each row when (new.IDR is null)
    begin
    select OLLMULTI_sequence.nextval into :new.IDR from dual;
    end;
    3) Now i create my store procedure and, in my procedure i want to insert 6 rows :
    Procedure Insert_OLLMULTI( i_IDO in OLLMULTI.IDO%type)
    is
    pragma AUTONOMOUS_TRANSACTION;
    BEGIN
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,2,'GJ');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,5,'ND');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,12,'AC');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,120,'AH');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,10,'ZG');
    INSERT INTO OLLMULTI (IDO,IDL,T1)
    VALUES (i_IDO,5,'RB');
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    rollback;
    raise;
    END;
    END;
    4) The problem :
    The violation key on the constrainst u_outilsllmulti appears sometimes on a randome insert. Never the same !
    Why ? I think that the sequence is the problem... Or is the problem is the "pragma AUTONOMOUS_TRANSACTION" command ?
    Anyone can help me ?

    Two ideas:
    - Is it possible that there are already records in the table that were
    created without using the sequence? A sequence initially starts at 1,
    if you already got data you first have to increment it.
    - May it be that some inserts happen without your procedure? The trigger
    allows to create IDs without using the sequence. Correct, there are already records in my table !!
    Thanks. That's right.

  • Problem of java stored procedure

    hi,
    now I use the oracle9i JDeveloper9.0.3.1 to develop java stored procedure and then publish it to oracle9i database.
    In the database I create PL/SQL procedure to invoke the java stored procedure.But I encounter the problem,that is ,when I run the PL/SQL procedure ,it throw the java.lang.NullPointerException ,while the java class,the java stored procedure can run correctly invoked by the main class of java.The code of the java stored procedure is as follows:
    import java.sql.*;
    import java.util.Properties;
    public class SQLServerEventDistribute
    public static void sqlServerSaveData(String hostName,String databaseName,String user,String password,String tableName,int x1,int y1,int x2,int y2,String ip)
    String url="",sql="",userName="",passwd="";
    Connection connection;
    Statement statement;
    url="jdbc:microsoft:sqlserver://"+hostName+":1433;DatabaseName="+databaseName+";User="+user+";Password="+password;
    sql="INSERT INTO "+tableName+" VALUES("+x1+","+y1+","+x2+","+y2+",'"+ip+"')";
    Properties property=new Properties();
    property.setProperty(userName,user);
    property.setProperty(passwd,password);
    try
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    // DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
    connection=DriverManager.getConnection(url,property);
    statement=connection.createStatement();
    statement.execute(sql);
    }catch(ClassNotFoundException connectSQLServerEx)
    System.out.println(connectSQLServerEx.getMessage());
    catch(SQLException connectSQLServerEx)
    System.out.println(connectSQLServerEx.getMessage()+connectSQLServerEx.getErrorCode());
    the main class is as follows:
    public class Test
    public static void main(String[] args)
    SQLServerEventDistribute.sqlServerSaveData("gsm","gsmd","sa","sa","IPBinding",11,45,24,21,"23.1.248.12");
    and the PL/SQL procedure is as follows:
    PROCEDURE TEST AS
    BEGIN
    SQLSERVERSAVEDATA('gsm','gsmd','sa','sa','IPBinding',11,45,24,21,'23.1.248.22');
    END;
    How can I deal with it?
    can you tell me?
    thanks

    Hi JavaQQ,
    This is just a guess, but I think you need to load the
    Micro$oft SQLServer JDBC driver into the Oracle
    database (using the "loadjava" utility).
    In any case, there are several ways -- apart from JDBC
    -- for accessing a different database from within an
    Oracle database. Have you tried searching the Oracle
    Web sites for suitable products?
    Hope this helps.
    Good Luck,
    Avi.abramia ,thank you very much.
    but I have load the Microsoft SQLServer JDBC driver into the Oracle database .
    When I debugged the PL/SQL procedure,the exception was thrown at line connection=DriverManager.getConnection(url,property);
    What's the problem with it?

  • Problem in executing Stored Procedure from Trigger

    Hi,
    Case1.
    I am executing a stored procedure form a trigger. The stored procedure is not executing fully.
    Case 2.
    But when when I execute Stored Procedure alone it is executing.
    CREATE OR REPLACE TRIGGER mhubadmin.call_proc_ratesheet_new
    after INSERT OR delete ON mhubadmin.pvt_br_ratesheet
    FOR EACH ROW
    declare
    var_orgid number;
    begin
    if inserting then
    select org_child_id into var_orgid from business_relationship where br_id=:new.br_id;
    mhubadmin.proc_ratesheet_new(var_orgid);
    else
    select org_child_id into var_orgid from business_relationship where br_id=:old.br_id;
    mhubadmin.proc_ratesheet_new(var_orgid);
    end if;
    end;
    CREATE OR REPLACE PROCEDURE proc_ratesheet_new(var_orgid in number)
    IS
    cursor c3 is select distinct(purs.user_id) from hubuser hu
    inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
                   where hu.ORG_ID=var_orgid;
    cursor c1(varUser_id number) is select purs.user_id,purs.ratesheet_id from hubuser hu
    inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
                   where hu.ORG_ID=var_orgid and purs.USER_ID=varUser_id;
    cursor c2(varUser_id number) is select hu.user_id,pbr.ratesheet_id from HUBUSER hu
                             inner join BUSINESS_RELATIONSHIP br on hu.ORG_ID=br.ORG_CHILD_ID
                             inner join PVT_BR_RATESHEET pbr on br.BR_ID=pbr.BR_ID
                                  where hu.user_id in(select distinct(purs.USER_ID) from hubuser hu
                                       inner join PVT_USER_RATESHEET purs
                                                                     on hu.USER_ID=purs.USER_ID
                                                 where hu.ORG_ID=var_orgid) and hu.user_id=varUser_id;
    foundFlag boolean;
    incrFound integer;
    insertFound integer;
    deleteFound integer;
    str varchar2(4000);
    BEGIN
         incrFound:=0;
         insertFound:=0;
         for c3var in c3 loop
    for c2var in c2(c3var.user_id) loop
              insert into test values ('Step3:'||c2var.user_id);
              foundFlag:=false;
              for c1var in c1(c3var.user_id) loop
                   if c2var.ratesheet_id=c1var.ratesheet_id then
                        foundFlag:=true;
                             incrFound:=incrFound+1;
                             exit;
                        end if;
                   end loop;
                   if foundFlag=False then
                   --insert into pvt_user_ratesheet (username_ratesheet_id,user_id,ratesheet_id) values (SEQ_USER_RATESHEET.nextval,c3var.user_id,c2var.ratesheet_id);
                   dbms_output.put_line('Inserted for user :'||c3var.user_id||' is - ratesheet :'||c2var.ratesheet_id);
                   insertFound:=insertFound+1;
                   end if;
              end loop;
    end loop;
         commit;
         incrFound:=0;
         deleteFound:=0;
         for c3var in c3 loop
              for c1var in c1(c3var.user_id) loop
              foundFlag:=false;
              for c2var in c2(c3var.user_id) loop
                        if c1var.ratesheet_id=c2var.ratesheet_id then
                        foundFlag:=true;
                        incrFound:=incrFound+1;
                        exit;
                        end if;
                   end loop;
                   if foundFlag=False then
                   --delete from pvt_user_ratesheet where user_id=c3var.user_id and ratesheet_id=c1var.ratesheet_id;
                        --dbms_output.put_line('Deleted for userid:'||c3var.user_id||' for ratesheet :'||c1var.ratesheet_id);
                        deleteFound:=deleteFound+1;
                   end if;
              end loop;
    end loop;
         commit;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.put_line (SQLCODE||' '|| SQLERRM);
    END;
    Regards,
    Mathew

    In general, I would suggest that you only catch errors that you can handle reasonably. If you know that a SELECT INTO might return 0 rows for example, handle the NO_DATA_FOUND exception. Having a WHEN OTHERS, particularly without re-raising the exception, only serves to hide the source of the problem. I would much rather that my code fail quickly and explicitly than hope that I see an error message in the output and that other code doesn't start failing because the system wasn't left in an appropriate state.
    As Mark suggests, you may choose to implement a comprehensive logging framework using autonomous transactions, in which case a WHEN OTHERS would be reasonable, but you would still want to propagate exceptions you cannot handle.
    If you see a WHEN OTHERS clause and there is no RAISE, you probably have an error waiting to happen.
    Justin

  • MS SQL Server 2005...  Problem while executing stored procedure

    Hi.. all
    I have got a problem with sql server 2005
    When i execute any stored procedure on a remote database using
    ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY
    options, it throws SQL Exception with following message
    "A server cursor cannot be opened on the given statement or statements. Use a default result set or client cursor."
    Note: Every thing works fine, if I execute the same sp from the PC where sql server is installed, it throws this exception only when i execute sp from a computer different thn one where SQL server is installed.
    Here is d code.
    CallableStatement call = conn.prepareCall( "{call getAttributeLabelValues(?,?,?)}",
    ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY
    // set parameters.
    ResultSet rs = call.executeQuery( ) ;
    If I remove options
    ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY
    while executin SP, thn every thing works fine.
    here is d exception
    com.microsoft.sqlserver.jdbc.SQLServerException: A server cursor cannot be opened on the given statement or statements. Use a default result set or client cursor.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
    at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteQuery(Unknown Source)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
    I will appreciate any help.
    Sudhir
    http://www.jyog.com

    use sql server jdbc driver v1.2..........

  • Problem with a stored procedure to search in a table

    h5.
    Hi,
    h5.
    As many people on the forum, I'm new on PL/SQL programming.
    h5.
    I'm trying to program a stored procedure that allow to search on my table fields with different parameters.
    h5.
    All this parameters doesn't need to be set, at least one.
    h5.
    I'm looking for the solution from 2 weeks ago.
    h5.
    I have looked everywhere
    h5.
    Could someone help me, please??
    h5.
    Here is my code:
    * HERE WE CREATE PACKAGE FOR THE CURSOR
    create or replace
    PACKAGE HOTEL_DEST_PKG
    IS
    /* Define the REF CURSOR type. */
    TYPE HOTEL_DEST_TYPE IS REF CURSOR;
    END HOTEL_DEST_PKG;
    * HERE WE CREATE OUR STORE PROCEDURE TO SEARCH
    create or replace
    PROCEDURE Search_Hotel (
    IdDocument IN number,
    MyFilter IN VARCHAR2,
    IdCountry IN number,
    DepartureDateFirst IN DATE,
    DepartureDateSecond IN DATE,
    HD_Cursor OUT HOTEL_DEST_PKG.HOTEL_DEST_TYPE)
    IS
    SQL_REQ VARCHAR2(5000);
    BEGIN
    /* all columns were entered */
    IF ((IdDocument > 0) OR
    ((MyFilter IS NOT NULL) AND (length(MyFilter) > 0)) OR
    (IdCountry > 0) OR
    (DepartureDateFirst IS NOT NULL) OR
    (DepartureDateSecond IS NOT NULL))
    THEN
    SQL_REQ := 'SELECT HOTEL_DESTINATION.*
    FROM HOTEL_DESTINATION
    WHERE 1=1';
    /* Search on the hotel id*/
    IF IdDocument > 0 THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_ID = :IdDocument';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :IdDocument IS NULL';
    END IF;
         /*Search on different indexed fields*/
    IF MyFilter IS NOT NULL AND LENGTH(MyFilter)>0 THEN
    SQL_REQ := SQL_REQ || ' AND CONTAINS(HOTEL_DESTINATION.HD_FILTER, :MyFilter)';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :MyFilter IS NULL';
    END IF;
    /* Search on the hotel country id*/
    IF IdCountry > 0 THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_CN_ID = :IdCountry';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :IdCountry IS NULL';
    END IF;
    /* Search on the dates*/
    IF DepartureDateFirst IS NOT NULL THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_DEPARTURE_DATE >= :DepartureDateFirst';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :DepartureDateFirst IS NULL' ;
    END IF;
    IF DepartureDateSecond IS NOT NULL THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_DEPARTURE_DATE <= :DepartureDateSecond';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :DepartureDateSecond IS NULL';
    END IF;
    OPEN HD_CURSOR FOR SQL_REQ USING IdDocument,
    MyFilter,
    IdCountry,
    DepartureDateFirst,
    DepartureDateSecond;
    END IF;
    END;
    * HERE WE CALL AND EXECUTE OUR STORE PROCEDURE TO SEARCH
    * ON WORD
    set serveroutput on
    DECLARE
         IDDOCUMENT NUMBER;
         MYFILTER VARCHAR2(200);
         IDCOUNTRY NUMBER;
         DEPARTUREDATEFIRST IN DATE;
         DEPARTUREDATESECOND IN DATE;
         HD_CURSOR OUT HOTEL_DEST_PKG.HOTEL_DEST_TYPE);
    BEGIN
    IDDOCUMENT := 0;
    MYFILTER := 'test';
    IDCOUNTRY := 0;
    DEPARTUREDATEFIRST := NULL;
    DEPARTUREDATESECOND := NULL;
    SEARCH_HOTEL(
    IDDOCUMENT => IDDOCUMENT,
    MYFILTER => MYFILTER,
    IDCOUNTRY => IDCOUNTRY,
    DEPARTUREDATEFIRST => DEPARTUREDATEFIRST,
    DEPARTUREDATESECOND => DEPARTUREDATESECOND,
    HD_Cursor => HD_Cursor
    -- Modify the code to output the variable
    --DBMS_OUTPUT.PUT_LINE('HD_Cursor = ' || HD_Cursor);
    END;

    You need to grant right on the table to the owner of the stored procedure directly (not via Role).
    When there are only rights via role everything is fine in sql, but it will not work in stored procedures, functions or packages.
    So as Table-Owner do:
    grant select on <table> to <procedure, package or function-owner>;Edited by: hm on 22.10.2010 08:49

  • Problems with java stored procedure.

    I have a java stored procedure that uses a package called RmiJdbc
    which allows calling remote JDBC data sources from any java capable
    machine.
    I've loaded the RmiJdbc classes into oracle via the loadjava
    command and everything seems to come up valid.
    The stored procedure does a Class.forName() to get the driver
    registered, than attempts to connect to the remote RMI driver.
    The particular line it dies on is this (see the error below):
    c = DriverManager.getConnection("jdbc:rmi:" + rmiHost + "/" + url);
    A mangled version of this (minus the Oracle specific stuff) works
    from the command line correctly. Can somebody point me in a
    direction to figure out what's going on here?
    THanks,
    Eric
    Oracle9i Enterprise Edition Release 9.0.1.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.0.1.3.0 - Production
    ORACLE_HOME = /oracle/v901ee
    System name: HP-UX
    Node name: athena
    Release: B.11.00
    Version: A
    Machine: 9000/889
    Instance name: PASDB2
    Redo thread mounted by this instance: 1
    Oracle process number: 13
    Unix process pid: 7839, image: oracle@athena (TNS V1-V3)
    *** SESSION ID:(8.547) 2002-08-15 15:41:27.221
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at sun.rmi.server.LoaderHandler$LoaderKey.<init>(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.lookupLoader(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java)
    at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputArray(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java)
    at sun.rmi.registry.RegistryImpl_Stub.lookup
    at org.objectweb.rmijdbc.RJConnection.<init>(RJConnection:83)
    at org.objectweb.rmijdbc.Driver.connect(Driver:135)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at TurnoverInfoPlusInterface.insertInterfaceRecords(TurnoverInfoPlusInterface:53)
    java.sql.SQLException: Error unmarshaling return; nested exception is:
    java.lang.NullPointerException
    at org.objectweb.rmijdbc.Driver.connect(Driver:140)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at TurnoverInfoPlusInterface.insertInterfaceRecords(TurnoverInfoPlusInterface:53)

    More info...I'm also seeing "ORA-03113: end-of-file on communication channel". I checked the user trace file and didn't get much help...it indicated an "exception signal: 11" and core-dump type stuff that had no meaning to me.

  • Performance problem with java stored procedure

    hi,
    i developped a java class, then I stored it in Oracle 8.1.7.
    This class contains several import of other classes stored in the database.
    It works, but the execution perfomances are disappointing. It's very long. I guess, that's because of the great number of classes to load that are necessary for my class execution.
    I tried to increase the size of the java pool (I parameter 70 Mo in the java_pool_size parameter of the init.ora), but the performance is not much better.
    Has anyone an idea to increase the performance of this execution of my class ?
    In particular, is there a way to keep permanently in memory the java objects used by my class ?
    Thanks in advance
    bye
    [email protected]
    null

    before running Java, the database session needs to be Java enabled; this might be the reason why it is taking so long. If this is the case, you should see an improvement in subsequent calls, once a database session is Java enabled, other users can benefit from it.
    Kuassi
    I have some performance issue with java stored procedure. Hope some one will be able to help me out. I'm using java stored procedures in my application and basically these procedures are used to do some validation and form the XML message of the database tables. I have noticed that when I call the PL/SQL wrapper function, it is taking time to load the java class and once the class is loaded the execution is faster. Most of the time is spent for loading the class rather than executing the function. if I reduce the class load time, I can improve the performance drastically. Do any one of you know how to reduce the class load time. The following are the platform and oracle version.
    O/S: IBM AIX
    Oracle: 8.1.7

  • Problem with JDBC stored procedure

    Hi...
    We are implementing an interface from SAP r/3 4.7 to Oracle DB 9.0. On sender side we have used IDOC Adapter and on Receiver side we have used JDBC Adapter.
    Here we are using stored procedures in JDBC Adapter. I have 2 stored procedures(one for header and one for items) and SISCSO.SISCSO01 IDOC.
    Here we are getting following error in RWB for JDBC Receiver adapter....
    <b>Error</b>
    " Receiver Adapter v2112 for Party '', Service 'BS_ORADEV':
    Configured at 2006-08-16 10:12:14 GMT+05:30
    History:
    - 2006-08-16 11:02:04 GMT+05:30: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PR_SPARES_VOR_PO_HDR_UPLOAD' (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00201: identifier 'PR_SPARES_VOR_PO_HDR_UPLOAD' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored ".
    <b>My mapping file is like this.....</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:TVS_MST_SPARES_ORDER xmlns:ns0="urn:tvsmotor:salesorder"><statement><PR_SPARES_VOR_PO_HDR_UPLOAD action="execute"><table>PR_SPARES_VOR_PO_HDR_UPLOAD</table><IN_DEALER_ID isInput="true" type="String">efde</IN_DEALER_ID><IN_SPARE_PO_NO isInput="TRUE" type="STRING">sdfsdf</IN_SPARE_PO_NO><IN_PO_DATE isInput="TRUE" type="STRING">12.12.2555</IN_PO_DATE><IN_ORDER_TYPE isInput="TRUE" type="STRING">23</IN_ORDER_TYPE><IN_REMARKS isInput="TRUE" type="STRING">Remark</IN_REMARKS><IN_SAP_SALE_ORD_NO isInput="TRUE" type="STRING">146546</IN_SAP_SALE_ORD_NO><IN_SAP_SALE_ORD_DT isInput="TRUE" type="STRING">12.12.2555</IN_SAP_SALE_ORD_DT><IN_TOT_VAL isInput="TRUE" type="STRING">2323</IN_TOT_VAL></PR_SPARES_VOR_PO_HDR_UPLOAD><PR_SPARES_VOR_PO_DTL_UPLOAD action="execute"><IN_DEALER_ID isInput="TRUE" type="STRING">efde</IN_DEALER_ID><IN_SPARE_PO_NO isInput="TRUE" type="STRING">sdfsdf</IN_SPARE_PO_NO><IN_PO_DATE isInput="TRUE" type="STRING">12.12.2555</IN_PO_DATE><IN_PART_NO isInput="TRUE" type="STRING">cfgdfw4w</IN_PART_NO><IN_ORDER_QTY isInput="TRUE" type="STRING">2</IN_ORDER_QTY><IN_PENDING_QTY isInput="TRUE" type="STRING">20</IN_PENDING_QTY><IN_RATE isInput="TRUE" type="STRING">2432</IN_RATE><IN_TAX isInput="TRUE" type="STRING">18</IN_TAX></PR_SPARES_VOR_PO_DTL_UPLOAD></statement></ns0:TVS_MST_SPARES_ORDER>
    Please help me out with this error... tell me if more information is required.
    Thanks,
    Audumbar.

    hi mario,
    tell me one thing.... does case metter for stored procedure name? and even for the parameters used in stored procedure?
    i have changed the case of stored procedure name... (its small in Oracle) but have not changed the case of parameters....
    after changing the case also i m getting the following error....
    " Receiver Adapter v2112 for Party '', Service 'BS_ORADEV':
    Configured at 2006-08-16 10:12:14 GMT+05:30
    History:
    - 2006-08-16 14:18:19 GMT+05:30: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. <b>'pr_spares_vor_po_hdr_upload'</b> (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00201: identifier <b>'PR_SPARES_VOR_PO_HDR_UPLOAD'</b> must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored "
    Reply me as soon as possible.
    Thanx,
    Regards,
    Audumbar
    Message was edited by: Audumbar Pikle

  • How to call PL-SQL script/stored procedure from BPEL?

    Assume I want to call a PL-SQL stored procedure from BPEL.
    How can I do this?
    Is there a simple "Hello world" example for this?
    Peter

    The database adapter supports calling stored procedures. There is an example called "File2StoredProcedure" that you can use as a reference to get started.

  • Problem Calling Oracle Stored Procedure From JAVA

    Hello all. I've been banging my head against this all day:
    Here's the procedure I'm calling:
    GetIDsByLatLonRadius(inLatitude IN NUMBER,
    inLongitude IN NUMBER,
    inRadius IN NUMBER,
    inTableName IN VARCHAR2,
    inIDColName IN VARCHAR2,
    inLatColName IN VARCHAR2,
    inLonColName IN VARCHAR2,
    LocationIDs OUT HomesCom_Types.GenericCursorType,
    ErrorNo OUT VARCHAR2);
    And here's the JAVA code:
    public Hashtable GetInRadius(Hashtable inStruct)
    ResultSet locationIDs = null;
    Hashtable outputHash = new Hashtable();
    float latitude = (float) 30.429;
    float longitude = (float) -84.2585;
    float radius = (float) 10;
    try {
    CallableStatement proc = con.prepareCall("{ call GEOCODING.getidsbylatlonradius(?,?,?,?,?,?,?,?,?) }");
    proc.setFloat(1,latitude);
    proc.setFloat(2,longitude);
    proc.setFloat(3,radius);
    proc.setString(4,"demographics_school");
    proc.setString(5,"onboard_id");
    proc.setString(6,"geocoding_latitude");
    proc.setString(7,"geocoding_longitude");
    proc.registerOutParameter(8,OracleTypes.CURSOR);
    proc.registerOutParameter(9,OracleTypes.VARCHAR);
    proc.execute();
    locationIDs = (ResultSet) proc.getObject(1);
    if (locationIDs != null)
    outputHash.put("query",locationIDs);
    else
    outputHash.put("query","LOCATION ID WAS NULL");
    catch(SQLException sqlException) {  
    System.out.println(
    "The following error occured in reading " +
    "from the table: "
    + sqlException);
    outputHash.put("error",sqlException.getMessage());
    return outputHash;
    This catches and the sqlException I get is: Unhandled sql type
    I'm not a java expert and I'm completely stuck at this point, so I figured a few more eyes on it might help.
    Thanks in advance,
    Danny

    Danny,
    Don't print merely the error message, print the whole stack trace.
    Then post it here.
    What java version are you using?
    What JDBC driver and version are you using?
    What Oracle database version are you using?
    Is the code from a Java ServerPages (JSP) or from a Java Stored Procedure (JSP)?
    I guess "HomesCom_Types" is one of your PL/SQL packages or routines, right?
    If so, then you can't use it in JDBC, you must define a database type using the command:
    create or replace type ...But in later versions of the Oracle database, the REF CURSOR type is built-in.
    Check the Oracle documentation for more details.
    Good Luck,
    Avi.

  • Problem in calling stored Procedure through Toplink

    Hi ,
    I'm doing POC of calling stored thru toplink but facing some issues. Any pointers to it would be helpful.
    This is my javaCode used to call stored proc through toplink:-
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("testdeleteLeafBox");
    call.addNamedInOutputArgumentValue(
    "box_id", // procedure parameter name
    new Integer("1455"), // in argument value
    "box_id", // out argument field name
    Integer.class // Java type corresponding to type returned by procedure
    ValueReadQuery query = new ValueReadQuery();
    query.setCall(call);
    Integer metricLength = (Integer) session.executeQuery(query);
    My Stored Procedure is :-
    create or replace procedure testdeleteLeafBox(
    v_box_id IN NUMBER ,
    result OUT number
    is
    v_result number;
    BEGIN
    SELECT client_id INTO v_result FROM tb_gvhr_box WHERE box_id=v_box_id;
    result:=v_result;
    end testdeleteLeafBox;
    Thrown exception is :-
    [TopLink Warning]: 2006.02.24 06:35:47.077--DatabaseSessionImpl(650)--Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TESTDELETELEAFBOX'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call:BEGIN testdeleteLeafBox(box_id=>?); END;
         bind => [1455 => box_id]
    Query:ValueReadQuery()
    Exception breakpoint occurred at line 1927 of Session.java.
    oracle.toplink.exceptions.DatabaseException: java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'TESTDELETELEAFBOX'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    The stored procedure defined in the db has one IN and one OUT parameter, therefore in StoredProcedureCall you'll need to have one IN one OUT parameter as well (instead of a single INOUT):
        call.addNamedArgumentValue(
            "v_box_id", //procedure IN parameter name
            new Integer("1455"));
        call.addNamedOutputArgument(
            "result",  //procedure OUT parameter name
            "box_id", // out argument field name
            Integer.class // OUT parameter Java type);

  • Problem Calling MaxDB stored procedure with output from MII Query template

    Hi,
    I am using Max DB Database studio to write stored procedure, I am calling stored procedure from MII Query using CALL statement.
    Can anyone guide me how to pass output values of stored procedure.
    Examlpe::
    call ProcName('[Param.1]','[Param.2]','[Param.3]','[Param.4]','[Param.5]', :isSuccess, :Trace)
    In the above line of code I am not able to get the output values of stored procedure that is isSuccess and Trace values in Query template when executed. But same thing I get when executed in Database studio.
    How do I call with outputs for any stored procedure in MII.
    Any help would be appriciated.
    Thanks,
    Padma

    My call statement is like this
    call RESULTDATA_INSERT('[Param.1]','[Param.2]','[Param.3]', :isSuccess, :Trace)
    I am able to insert record in DB, But I am not getting output values in Query template.I have done this in Fixed Query, when I execute it throws me "Fatal error as Loaded content empty".
    I tried giving select below call but it dont work.
    Regards,
    Rao

  • Problem with a stored procedure (Error(4,1): PLS-00428: an INTO clause..)

    Dear Oracle Experts,
    I try to use the stored procedure below but get this error :
    "Error(4,1): PLS-00428: an INTO clause is expected in this SELECT statement"
    I don't have any clue what could be wrong with my syntax. INTO wouldn't make any sense at this task.
    Does someone of you know what's wrong with my Procedure ?
    Hope someone can help,
    best regards,
    Daniel Wetzler
    create or replace PROCEDURE AnalysisCompatibility (DATEBEGIN timestamp, DATEEND timestamp)
    AS
    BEGIN
    select Fs.*,Vs.Analysispriority,Vs.Compatibility Compatibility from SigFacts Fs
    inner Join Variables Vs On
    (Fs.Var_Ref=Vs.Var_Ref and Fs.Machines_Ref=Vs.Machines_Ref )
    where Fs.DT between DATEBEGIN and DATEEND
    and
    Vs.AnalysisPriority > 0
    or
    VS.Compatibility in (6,7,8,9,10,11,13,21,22)
    order by Fs.DT,Fs.Machines_Ref desc, Vs.AnalysisPriority;
    END AnalysisCompatibility;

    I have created a table (ATREPORT.TEST) that has has got the same column name and type of the query output and i still get error message
    PLS-00403 -- statement ATreport.TESt cannot be used as an into target, pls help
    DECLARE start_date DATE := to_date('01/09/2006' , 'DD-MON-YYYY');
    end_date DATE := to_date('30/09/2006' , 'DD-MON-YYYY');
    BEGIN
    SELECT t.SEC_SHORT_NAME, t.SEC_ISIN, t.SEC_NO,t.SEC_NAME, t.TRADE_DATE,
    t.PAYMENT_DATE,t.COUNTERPARTY, t.PRICE , t.NOMINAL ,
                        t.TRANSACTION_NO,t.CURRENT_VALUE_PC, t.CURRENT_VALUE_SC, t.PAYMENT_AMOUNT_PC,
                        t.PAYMENT_AMOUNT_SC,
                   ct.AMOUNT , ct.CURRENCY,
              sb.BUSINESS_CLASS_LEVEL_2 ,sb.BUSINESS_CLASS_LEVEL_2_NAME,
              sb.BUSINESS_CLASS_LEVEL_3 ,sb.BUSINESS_CLASS_LEVEL_3_NAME,
              sb.BUSINESS_CLASS_LEVEL_4 ,sb.BUSINESS_CLASS_LEVEL_4_NAME,
    sb.BUSINESS_CLASS_LEVEL_5 ,sb.BUSINESS_CLASS_LEVEL_5_NAME
    INTO ATREPORT.TEST
    from scdat.A_TRANSACTIONS t
    INNER JOIN scdat.A_COSTTAX ct     
         ON ct.TRANS_REF = t.TRANS_REF
    INNER JOIN scdat.A_SECS_BUSINESS_CLASS_TS sb
    ON sb.SEC_REF = t.SEC_REF           
    where t.TRADE_DATE >= to_char(start_date ,'DD-MON-YYYY')
    and t.TRADE_DATE < to_char(end_date ,'DD-MON-YYYY')
    and ct.COST_NAME = 'Broker commission'
    and sb.BUSINESS_CLASS_DEFINITION = 'FTSE';
    END;

Maybe you are looking for

  • How do I print borderless on HP Deskjet 1510

    HP Deskjet 1510 doesn't allow me to print my ACTUAL SIZE document on a A4 size paper. My documents are in PDF form and are all in A4 size. When I print it, bottom part of my documents gone. Am using a window 8, Adobe reader latest version 11.09.

  • Podcasts : how to access the "Grouping" tag in the Info window ?

    I upgraded yesterday to iTunes v12.1, and today I discovered that I cannot anymore access to the "Grouping" tag in the Info window (still available using ALT/OPTION in iTunes v12 and v12.0.1). The "Genre" tag still available, but it is useless for Po

  • Why can't I select "Find"? Something is keeping it dimmed out.

    I'd like to search my email for certain content and references. I've done it before using the "Find" entry. But today that's dimmed out and I can't figure out why. Any ideas?

  • SQl Server service failed to start error 1053

    Hi All During installing MS SQL server 2005 ,i am getting the error like Could not start SQL server Service. When trying to start the service manually ,getting error like service could nto start in a timely fashion. We are using Windows 2003 SP2 with

  • Processing system files

    Hi, I want to process file that is located in system files. My code takes this file as a parameter, but how can I process the file directly since it locates in different drive -- not in the same directory where I have my code.