Oracle stored query(SQE )

Hi guru,
I am trying to use SQE operator in my contains query but I don't know why it is not working in my case.I tried it on Oracle 11g installaion with window and Linux both but did not get success.
Please tell me if I am doing somethign wrong ...
oracle@oracle2 ~$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Jul 6 12:21:32 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create user test identified by test;
User created.
SQL> grant connect,dba,resource,ctxapp to test;
Grant succeeded.
SQL> connect test/test@content;
Connected.
SQL> create table test (text varchar2(2000));
Table created.
SQL> insert into test values ('hello world');
1 row created.
SQL> create index testindex on test(text) indextype is ctxsys.context;
Index created.
SQL> exec ctx_query.store_sqe('testsqe', 'hello')
PL/SQL procedure successfully completed.
SQL> select * from test where contains (text, 'sqe(testsqe)') > 0;
select * from test where contains (text, 'sqe(testsqe)') > 0
ERROR at line 1:
ORA-29902: error in executing ODCIIndexStart() routine
ORA-20000: Oracle Text error:
DRG-00100: internal error, arguments : 50935,http://drpn.c,1051],[,[]
ORA-01403: no data found
SQL> select * from test where contains (text, 'ctx_query.sqe(testsqe)') > 0;
no rows selected
SQL>

So it does look like a character set issue - except that I'm using UTF8 as well:
Can you post the output from the command below, so we can compare it to mine?
SQL> column value format a40
SQL> select * from nls_database_parameters;
PARAMETER                 VALUE
NLS_LANGUAGE                 AMERICAN
NLS_TERRITORY                 AMERICA
NLS_CURRENCY                 $
NLS_ISO_CURRENCY            AMERICA
NLS_NUMERIC_CHARACTERS            .,
NLS_CHARACTERSET            AL32UTF8
NLS_CALENDAR                 GREGORIAN
NLS_DATE_FORMAT             DD-MON-RR
NLS_DATE_LANGUAGE            AMERICAN
NLS_SORT                 BINARY
NLS_TIME_FORMAT             HH.MI.SSXFF AM
PARAMETER                 VALUE
NLS_TIMESTAMP_FORMAT            DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT            HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY            $
NLS_COMP                 BINARY
NLS_LENGTH_SEMANTICS            BYTE
NLS_NCHAR_CONV_EXCP            FALSE
NLS_NCHAR_CHARACTERSET            AL16UTF16
NLS_RDBMS_VERSION            10.1.0.5.0
20 rows selected.Edit: Sorry, that's from my 10.1.0.5 database. My 11g database isn't working at the moment - but can we see your output anyway?
Edited by: raford on Jul 7, 2009 3:51 AM

Similar Messages

  • Calling Oracle stored procedure from xMII Query Templates.

    Hi All,
    We have a requirement to call a Oracle stored procedure from xMII, the SP expects some inputs and then it returns multiple rows.
    I tried different approches with no results, I remember some posts on the same topic but I could not get in search results.
    Looking for some help in this regards
    Rupesh.

    Hi Rupesh Bajaj,
    In oracle stored procedure we have to use Packages..if you used packages the u have to assign to some variable.
    To calling Stored procedure  in Query Template is CALL Testing('[Param.1]','[Param.2]',,:X)
    In above line Testing is Stored procedure name and Param.1 is parameters and X is Package.
    Thanks
    Ravilla Ramesh

  • Using a ORACLE stored procedure to return a query set.

    I would like to call an ORACLE stored procedure from inside the Creator. The stored procedure returns the data in a hierarchical format. Is there an example of calling ORACLE stored procedures available?
    Thanks for your help.
    Charles

    See this thread - might help:
    http://swforum.sun.com/jive/thread.jspa?threadID=47188&tstart=0
    v

  • Calling a Oracle stored procedure in orchestrator

    I am trying to execute a stored procedure using the query database IP in orchestrator.  I can select data from the oracle db so i know the prereqs are setup correctly but it fails on executing the stored procedure.
    The syntaxe is execute SPNAME('PARAM!','PARAM2')
    The error is 
    Failed, Oracle failure Database error has occurred. ORA-00900: invalid SQL statement
    Oracle query failure, please verify your query syntax is correct.  Verify correct table names and column names etc...
    The SP works fine in sql developer so im pretty sure the syntax is correct unless the Query Database IP needs a different syntax to work.  

    simple as that.  i actually tried something similar since that is how SCOM executes SP but left the execute command in there so it failed and i moved on.  thanks for the reply.  
    Just for reference i went the powershell route and that worked as well but much more complicated then your solution.  for anyone that wants to know the script is 
    $asm = [System.Reflection.Assembly]::LoadWithPartialName("System.Data.OracleClient") 
    $connectionString = "Data Source=TNSNAME;uid=USERID;pwd=PASSWORD";
    $inputString1 = "PARAMETER INPUT 1";
    $inputString2 = "PARAMETER INPUT 2"
    $oracleConnection = new-object System.Data.OracleClient.OracleConnection($connectionString);
    $cmd = new-object System.Data.OracleClient.OracleCommand;
    $cmd.Connection = $oracleConnection;
    $cmd.CommandText = "SP NAME";
    $cmd.CommandType = [System.Data.CommandType]::StoredProcedure;
    $cmd.Parameters.Add("NAME OF EXPECTED PARAMETER 1", [System.Data.OracleClient.OracleType]::NUMBER) | out-null;
    $cmd.Parameters["NAME OF EXPECTED PARAMETER 1"].Direction = [System.Data.ParameterDirection]::Input;
    $cmd.Parameters["NAME OF EXPECTED PARAMETER 1"].Value = $inputString1;
    $cmd.Parameters.Add("NAME OF EXPECTED PARAMETER 2", [System.Data.OracleClient.OracleType]::VARCHAR2) | out-null;
    $cmd.Parameters["NAME OF EXPECTED PARAMETER 2"].Direction = [System.Data.ParameterDirection]::Input;
    $cmd.Parameters["NAME OF EXPECTED PARAMETER 2"].Value = $inputString2;
    $oracleConnection.Open();
    $cmd.ExecuteNonQuery() | out-null;
    $oracleConnection.Close();
    got help from http://dovetailsoftware.com/clarify/gsherman/2012/05/15/calling-oracle-stored-procedures-using-powershell/

  • Oracle Stored Procedure with out parameter

    Good morning,
    Is it possible to use an Oracle stored procedure with out parameters in MII ?
    If yes, what is the manipulation to see the values of parameters Out?
    Thank you

    Michael,
    This is the  MII query template  :
    DECLARE
    STRCOMPTERENDU NVARCHAR2(200);
    BEGIN
    STRCOMPTERENDU := NULL;
    XMII.SP_VALIDATEPROCESSORDERSLIST2 ( STRCOMPTERENDU => [Param.1]  );
    COMMIT;
    END;
    and the stocked procedure code
    CREATE OR REPLACE PROCEDURE XMII.SP_ValidateProcessOrdersList2(strCompteRendu OUT nVarchar2) IS
    tmpVar NUMBER;
    debugmode INT;
    strClauseSql varchar(2048);
    strListPOactif varchar(1024);
    dtmTimeStamp DATE;
       NAME:       SP_ValidateProcessOrdersList
       PURPOSE:   
       REVISIONS:
       Ver        Date        Author           Description
       1.0        18/06/2008          1. Created this procedure.
       NOTES:
       Automatically available Auto Replace Keywords:
          Object Name:     SP_ValidateProcessOrdersList
          Sysdate:         18/06/2008
          Date and Time:   18/06/2008, 18:45:32, and 18/06/2008 18:45:32
          Username:         (set in TOAD Options, Procedure Editor)
          Table Name:       (set in the "New PL/SQL Object" dialog)
    BEGIN
       tmpVar := 0;
       debugmode := 0;
       -- lecture date systeme pour time stamp
       select sysdate  into dtmTimeStamp from dual;
       if debugmode = 1 then
        DBMS_OUTPUT.put_line('SP_ValidateProcessOrdersList');
       end if;
       -- insertion du bloc dans le log
       insert into LOG_ORDER
        (DATE_ORDER,BLOCK_ORDER,ID_LOG_ORDER)
       values
       (dtmTimeStamp,'SP_ValidateProcessOrdersList',ID_LOG_ORDER.nextval);
       Commit;
        if debugmode = 1 then
        DBMS_OUTPUT.put_line('insertion LOG OK');
       end if;
    strCompteRendu := '0123456-896;0123456-897';
    commit; 
       EXCEPTION
         WHEN NO_DATA_FOUND THEN
           NULL;
         WHEN OTHERS THEN
         ROLLBACK;
         -- insertion du bloc dans le log
       insert into LOG_ORDER
        (DATE_ORDER,BLOCK_ORDER,ID_LOG_ORDER)
       values
       (dtmTimeStamp,' ',ID_LOG_ORDER.nextval);
       COMMIT;
           -- Consider logging the error and then re-raise
           RAISE;
    END SP_ValidateProcessOrdersList2;
    Thanks for your help
    Alexandre

  • How to call oracle stored procedure with OUT parameter?

    I create oracle stored procedure in eclipse oepe
    PROCEDURE SP_SELECT_ORA (
    ID_INPUT IN VARCHAR2,
    ID_OUTPUT OUT VARCHAR2,
    PASSWD_OUTPUT OUT VARCHAR2,
    NAME_OUTPUT OUT VARCHAR2) IS
    BEGIN
    SELECT EMP_ID, EMP_Passwd, EMP_Name
    INTO ID_OUTPUT, PASSWD_OUTPUT, NAME_OUTPUT
    FROM family
    WHERE EMP_ID = ID_INPUT;
    END;
    and I try to call the sp in jpa like below,
    @NamedNativeQueries({
         @NamedNativeQuery(name = "callSelectSP", query = "call SP_SELECT_ORA(?,?,?,?)", resultClass = Members.class)
    @Entity
    @Table(name="family")
    public class Members implements Serializable {
         @Id
         @Column(name = "EMP_ID")
         private String ID;
         @Column(name = "EMP_Passwd")
         private String Passwd;
         @Column(name = "EMP_Name")
         private String Name;
    ==============
    @PersistenceContext(unitName="MyFamily")
         EntityManager em;
    query = em.createNamedQuery("callSelectSP");
         query.setParameter(1, ID);
         String id_output = null;
         String passwd_output = null;
         String name_output = null;
         query.setParameter(2,id_output);
         query.setParameter(3,passwd_output);
         query.setParameter(4,name_output);
         query.executeUpdate();
         member = (Members)query.getSingleResult();
    But this query throws exception,
    19:55:35,500 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--127.0.0.1-8080-1) SQL Error: 1465, SQLState: 72000
    19:55:35,500 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--127.0.0.1-8080-1) ORA-01465: invalid hex number
    I don't know how. Pls, give me your advice. Thanks in advnace.
    Best regards

    Thank you for your reply, Chris!
    I tried this one.
    @NamedNativeQueries({
    @NamedNativeQuery(name = "callSelectSP", query = "exec SP_SELECT_ORA( ?, :id_output, :passwd_output, :name_output) " , resultClass = Members.class)
    @Entity
    @Table(name="family")
    public class Members implements Serializable
    ===================
    query = em.createNamedQuery("callSelectSP");
    query.setParameter(1, ID);
    String id_output = null;
    String passwd_output = null;
    String name_output = null;
    query.setParameter("id_output", id_output);
    query.setParameter("passwd_output", passwd_output);
    query.setParameter("name_output",name_output);
    query.executeUpdate();
    On Console hibernate shew the sql and ora # like below,
    19:59:25,160 INFO [stdout] (http--127.0.0.1-8080-1) Hibernate: exec SP_SELECT_ORA( ?, ?, ?, ?)
    19:59:25,192 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--127.0.0.1-8080-1) SQL Error: 900, SQLState: 42000
    19:59:25,192 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--127.0.0.1-8080-1) ORA-00900: Invalid SQL statement
    Pls, inform me your advice. Thanks in advance.
    Best regards.

  • Command for "How to find Cursor Size" in Oracle Stored Procedure"

    Hi
    Can u tell me....
    How to find Cursor Size" in Oracle Stored Procedure........
    I want command for that........

    why don't you try select count(*) from your_table;That requires running the same query twice - or rather running two different queries twice. Besides it still doesn't guarantee anything, because Oracle's read consistency model only applies at the statement level (unless you're running in a serialized transaction).
    This is such a common requirement - users are wont to say "well Google does it" - it seems bizarre that Oracle cannot do it. The truth is that that Google cheats. Firstly it guesses the number on the basis of information in its indexes and refines the estimate as pages are returned. Secondly, Google is under no onus to kepp all its data and indexes synchronized - two simultaneous and identical queries which touch different Google servers can return different results. Oracle Text works the same way, which is why we can get a count with CTX_QUERY.COUNT_HITS in estimate mode.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com
    .

  • Executing an Oracle Stored Procedure from Sender JDBC adapter

    I could really use some help from someone who had done this before. 
    I've read the help about using the JDBC sender adapter, but it's not helping enough.
    I found this line: "Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
    The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs."
    That's definately what we want to do, but we can't figure out the syntax.
    The procedure in oracle looks like this:
    CREATE OR REPLACE PROCEDURE test_ref_cursor
    ( cur_generic IN OUT result_sets.cur_generic)
    as
    BEGIN
    Open cur_generic for
    select
       proposal_number,
       to_char(sequence_number),
       column_name,
       column_value,
       update_timestamp,
       update_user
       from
       coeus.sap_test;
    END test_ref_cursor;
    And we have tried every kind of statement we can think of, but the file adapter always gives us an "invalid sql statement" error.
    Does anyone know what syntax we need to put in the "Query SQL Statement" in the JDBC sender adapter in order to call this procedure?  Or is there something wrong with the procedure that is causing the error?
    <i>I will absolutely return and give points, but PLEASE read my whole post before answering and do not just link me to or quote the help for configuring a sender JDBC adapter or blogs that are about the JDBC adapter in general but do not deal with the issues I am having. Thank you.</i>

    Hi Vanda,
    Unfortunately, the sender JDBC adapter does not support Oracle's store procedure/function.  Unlike stored procedures from other database vendors, Oracle returns a cursor, not a resultset.  The sender JDBC adapter must send a resultset to XI.
    There are 2 possible ways you can accomplish this:
    1.  Use BPM and call the Oracle stored procedure using a receiver adapter via a asynch-synch bridge.
    2.  Develop a user-module for the adapter, which can be used with a sender adapter.
    Thanks
    Prasad

  • JDBC Sender - Oracle Stored procedures

    hi all
    i am working on JDBC sender - File receiver
    I am fetching data from Oracle database
    if i write select query directly in sender adapter the scenario is working properly but when try to write stored procedure in oracle and use execute statement in JDBC, adapter is throwing error.
    As in oracle to fetch multiple rows i have to use cursors .
    i read lot of articles in forum but still not clear on following issues :can any one solve them?
    1 . To get multiple rows can i write SP without cursors?
    2 . If SP is using cursor do my XI accept it or it only accepts  resultset? in that     case how to write sp.
    thanks & regards
    sheetal

    Sheetal,
    Adding to Jai Shankar's reply, Like pointed out, Oracle Stored Procedures return Cursors and XI sender JDBC adapter expects resultsets and so it is not possible to call Oracle SP's from Sender JDBC adapters.
    But, I have also come across a few recent threads where there have been discussions that this is possible  from SP 16 onwards. I have not been able to check and confirm on this, but, maybe you can check your SP level and see if you are below SP 16 . If yes, definetly not possible. If SP 16, or above, a Quick OSS to SAP should surely give the answer if it is possible or not!
    Do let us know your findings.
    Regards
    Bhavesh

  • JDBC Receiver to ORACLE Stored Procedure

    Hi Experts
    I browed the forum and could not find a strait answer to my problem. Hence I am posting this thread.
    I have a sync call using JDBC Receiver to ORACLE stored procedure.
    The definition of the procedure is as follows:
    CREATE OR REPLACE procedure TW.XI_TEST
        (p_edi_extract_id varchar2, p_res out edi_extract%rowtype) is
    t edi_extract%rowtype;
    begin
      select *
      into p_res
      from edi_extract e
      where e.edi_extract_id = to_number(p_edi_extract_id);
    exception
       when no_data_found then
            p_res := t;
    end XI_TEST;
    The request XML is as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:MT_EDIExtractSelectionRequest xmlns:ns0="urn:zim.com:tests">
    <STATEMENT>
    <PROC_NAME ACTION="EXECUTE">
      <TABLE>TW.XI_TEST</TABLE>
      <EDI_EXTRACT_ID isInput="true" type="STRING">4223142</EDI_EXTRACT_ID>
      </PROC_NAME>
      </STATEMENT>
      </ns0:MT_EDIExtractSelectionRequest>
    The error I am getting is as follows:
    com.sap.engine.interfaces.messaging.api.exception.MessagingException:
    Error processing request in sax parser:
    Error when executing statement for table/stored proc. 'TW.XI_TEST' (structure 'STATEMENT'):
    java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306:
    wrong number or types of arguments in call to 'XI_TEST' ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Any help would be appreciated.
    Regards
    Effi.

    >
    Rajesh wrote:
    > > Hi Rajesh
    > >
    > > The structure of my data type for the request query is as follows:
    > >
    > >
    DT_EDIExtractSelectionRequest (Complex Type)
    > >    STATEMENT (Element)
    > >       PROC_NAME (Element)
    > >          ACTION (Attribute) _mapped to_: EXECUTE
    > >          TABLE (Element) _mapped to_: TW.XI_TEST
    > >          EDI_EXTRACT_ID (Element) _mapped to_: 123456
    > >             isInput (Attribute) _mapped to_: true
    > >             type (Attribute) _mapped to_: STRING
    > >          EDI_EXTRACT (Element)
    > >             isOutput (Attribute) _mapped to_: true
    > >             type (Attribute) _mapped to_: CURSOR
    > >
    > >
    >
    >
    > Change the DT type to like below
    >
    >            STATEMENT (Element)
    >                   ACTION (Attribute) _mapped to_: EXECUTE
    >                   TABLE (Element) _mapped to_: TW.XI_TEST
    >                   EDI_EXTRACT_ID (Element) _mapped to_: 123456
    >                        isInput (Attribute) _mapped to_: true
    >                        type (Attribute) _mapped to_: STRING
    >                   EDI_ETRACT (Element)
    >                      isOutput (Attribute) _mapped to_: true
    >                     type (Attribute) _mapped to_: CURSOR

    > and try ...actually i dont remeber the exact strucuture..but i tolo faced the same pain of this
    >
    > HTH
    > Rajesh
    Hi Rajesh
    Changing the DT per your suggestion result in the following error:
    <SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser:
    No 'action' attribute found in XML document
    (attribute "action" missing or wrong XML structure)</SAP:AdditionalText>
    Omitting the PROC_NAME element from the DT is not correct.
    Also, I would also like to clarify that the variables of the DT I am using are:
    EDI_EXTRACT_ID is defined as string
    EDI_EXTRACT is defined as string
    Because the variable p_res is mapped to nothing in the request payload it does not show.
    I read in one of the posts that this is correct and the variable is used due to the fact the isOutput attribute is true.
    Regards,
    Effi.
    Edited by: Effi Olivkovitch on Dec 6, 2009 9:11 AM
    Edited by: Effi Olivkovitch on Dec 6, 2009 9:18 AM

  • SOS..How to execute an Oracle Stored procedure

    Please help me.
    I need to execute an oracle stored procedure from a JSP.
    I'M using Jakarta Tomcat and I dont have the Oracle Jbo tags and no BC4j tags.
    Anyone have an example using standar tags or directives???.
    This an emergency call..!!!!!!

    To execute a stored procedure (Oracle or other), you must create a CallableStatement.
    Here is the link to the API description:
    http://java.sun.com/products/jdk/1.2/docs/api/java/sql/CallableStatement.html
    You use it like a query but the the syntax is:
    {call <procedure-name>[<arg1>,<arg2>, ...]}

  • Oracle stored ns and where clauses

    Hello everybody,
    I need to call an Oracle stored function and at the same time do a select on the result of the query, it works well except when I use a where clause. I am connecting to Oracle 8.1.7 through OLEDB using the Oracle provider for
    OLEDB distributed with this Oracle version.
    Here is the query I am doing:
    select * from {call MC.SEC.QryTermbases(?, ?) where ID = ?}
    If I remove the where clause it works well but I need to use the where. I know that I could pass the parameter to the procedure instead of doing that in the select but there are places where I can not do that since the SQL
    query is generated dynamically. The code above is just a demo.
    Thanks very much for your help,
    José.

    Thanks for answering, it is actually possible to do a select on the return of a function, I have tested it with other than "select *" and it has worked well. What has not worked for me is using a "where" clause. That is "select" without "where" has worked but not with the "where".
    I also suspect that it does not work but similar queries work well in MSSQL 2000 and Interbase 6.0 so I thought may be there was a way to do that with Oracle. That is in MSSQL I can treat the result of a function as a normal table and I can do the same thing with a stored procedure that returns a recordset in Interbase.
    Thanks again for answering,
    Jose.

  • Oracle stored functions and where clauses

    Hello everybody,
    I need to call an Oracle stored function and at the same time do a select on
    the result of the query, it works well except when I use a where clause. I
    am connecting to Oracle 8.1.7 through OLEDB using the Oracle provider for
    OLEDB distributed with this Oracle version.
    Here is the query I am doing:
    select * from {call MC.SEC.QryTermbases(?, ?) where ID = ?}
    If I remove the where clause it works well but I need to use the where. I
    know that I could pass the parameter to the procedure instead of doing that
    in the select but there are places where I can not do that since the SQL
    query is generated dynamically. The code above is just a demo.
    Thanks very much for your help,
    Jose.

    Thanks for answering, it is actually possible to do a select on the return of a function, I have tested it with other than "select *" and it has worked well. What has not worked for me is using a "where" clause. That is "select" without "where" has worked but not with the "where".
    I also suspect that it does not work but similar queries work well in MSSQL 2000 and Interbase 6.0 so I thought may be there was a way to do that with Oracle. That is in MSSQL I can treat the result of a function as a normal table and I can do the same thing with a stored procedure that returns a recordset in Interbase.
    Thanks again for answering,
    Jose.

  • Sending '?' in XML tag to Oracle Stored Procedure

    I have a situation that I cannot find the answer to why it is happening.
    I am sending an XML data type to an oracle stored procedure. In one of the fields, I need to allow the '?' character to be sent.
    <ADDITIONALINFO>This is where I want ? to be</ADDITIONALINFO>
    When I send the info to the stored procedure I get the following error: ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing
    LPX-00216: invalid character 191 (0xBF)Error at line 19
    What I do not understand is that the character (0xBF) is the inverted question mark �
    I have been able to get around the issue by changing the question mark to &#63; which is the decimal format for the question mark and the query works.
    ie: <ADDITIONALINFO>This is where I want &#63 to be</ADDITIONALINFO>
    Is there another delimiter that is needed for '?' like what is needed to print the & in & fashion?
    Any insight to this issue would be helpful.

    There are some characters that you cannot use in an XML document, but I was not aware that the questionmark was one of them. As far as I know, you need to transform the characters '&', '<' and '>', and any character with a code higher than 127. The fact that the question mark is turned into an upside down questionmark seems to be some weird functionality.

  • Executing an oracle stored procedure in xMII 11.5

    Dear all,
          I am facing problem executing an oracle stored procedure using sql query in MII. The SP does not have any input or output parameters & consists of only 2 insert statements. I tried to use Command Mode, FixedQuery & FixedQuery With output mode, but the SP doesn't run.
    This is the error i get when i use :
    execute InsertTest or exec InsertTest -  A SQL Error has occurred on query, ORA-00900: invalid SQL statement
    I read in one of the posts to use 'CALL' instead of 'exec' or 'execute'. Even with this i get error which states:
    A SQL Error has occurred on query, ORA-06576: not a valid function or procedure name
    The syntax i used is CALL InsertTest  -  'InsertTest' is the SP name.
    I also checked Sam's comment in one of the posts about jdbc driver. We are using oracle 9i, so i guess there is no problem with the version of DB.
    The stored procedure is working fine in SQL Developer, How else can i invoke the SP in MII?
    Any help would be greatly appreciated.
    Thanks,
    Sushma.

    Hi all,
    for insert create procedure
    CREATE PROCEDURE MII_TEST_INSUPD
    (ID_IN IN NUMBER,
    NAME_IN IN VARCHAR2)
    IS
    BEGIN
      -- UPDATE ROW
      UPDATE TEST SET
              NAME = NAME_IN
      WHERE
              ID = ID_IN;
      -- NOT RETURN INSERT NEW LINE IN TABLE
      IF SQL%ROWCOUNT = 0 THEN
         INSERT INTO TEST (ID, NAME) VALUES (ID_IN, NAME_IN);                        
      END IF; 
    END;
    In MII you create a query template
    Mode - Command
    FixedQuery - insert the code below
    CALL MII_TEST_INSUPD ([Param.1],'[Param.2]')
    for returns the grid using procedures in oracle you need create a package on oracle server
    CREATE PACKAGE PKG_test IS
      TYPE cursortype is ref cursor;
      PROCEDURE test (mycursor in out cursortype);
    END PKG_test;
    CREATE PACKAGE BODY PKG_test IS
      PROCEDURE test (mycursor in out cursortype) AS
      BEGIN
         open mycursor for select * from test;
      END;
    END PKG_test;
    In MII you create a query template
    Mode -  FixedQueryWithOutput
    FixedQuery - insert the code below
    CALL PKG_TEST.TEST(?)
    Danilo

Maybe you are looking for