Running SQL Procedure with dg4msql errors: Function sequence error HY010

I am trying to execute a stored procedure on a SQL database and get the error Function sequence error HY010.
A simple query on a table returns teh expected result.
I have a single Win2008R2 server with MSSQL Express 2008 and Oracle 11gR2 (32bit not 64bit version of Oracle)
Below is the gateway init, listener and tnsnames files and the query I am trying to run:
-- initORIONWASP.ora --
HS_FDS_CONNECT_INFO=INGRDB//waspForGIS
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
HS_CALL_NAME=dbo.spTest;dbo.spQueryAsset;dbo.spQueryAssetDetails
HS_FDS_PROC_IS_FUNC=TRUE
HS_FDS_RESULTSET_SUPPORT=TRUE
-- Listener.ora -- (partial)
(SID_DESC =
(SID_NAME = ORIONWASP)
(ORACLE_HOME = C:\Oracle\product\11.2.0\dbhome_1)
(PROGRAM=dg4msql)
-- tnsnames.ora -- (partial)
ORIONWASP =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=INGRDB)(PORT=1521))
(CONNECT_DATA=(SID=ORIONWASP))
(HS=OK)
-- Simple Query --
Running select "Asset_ID" from asset@ORIONWASP; returns the correct result
Running select * from sys.procedures@ORIONWASP; returns a list of procedures including the procedure I want to run
-- This pl/sql block returns the error ******* identifier 'spTest@ORIONWASP' must be declared *******
declare
begin
"spTest"@ORIONWASP;
end;
-- This passthrough pl/sql block returns ******** [Oracle][ODBC SQL Server Driver]Function sequence error {HY010} ********
DECLARE
CRS BINARY_INTEGER;
RET BINARY_INTEGER;
v_COL1 VARCHAR2(50);
v_COL2 VARCHAR2(50);
BEGIN
CRS := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@ORIONWASP;
DBMS_HS_PASSTHROUGH.PARSE@ORIONWASP(CRS, 'exec spTest');
BEGIN
RET := 0;
WHILE (TRUE)
LOOP
ret := DBMS_HS_PASSTHROUGH.FETCH_ROW@ORIONWASP(CRS, FALSE);
DBMS_HS_PASSTHROUGH.GET_VALUE@ORIONWASP(CRS, 1, v_COL1);
DBMS_HS_PASSTHROUGH.GET_VALUE@ORIONWASP(CRS, 2, v_COL2);
DBMS_OUTPUT.PUT_Line('Col1:'||v_COL1||' Col2:'||v_COL2);
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
DBMS_OUTPUT.PUT_LINE('End of Fetch');
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@ORIONWASP(CRS);
END;
END;
END;
/

The gateway configuration file contains:
HS_FDS_PROC_IS_FUNC=TRUE
HS_FDS_RESULTSET_SUPPORT=TRUE
This setting commonly causes problems and you need to set
HS_FDS_PROC_IS_FUNC=TRUE
HS_FDS_RESULTSET_SUPPORT=FALSE
for normal procedure calls and
HS_FDS_PROC_IS_FUNC=FALSE
HS_FDS_RESULTSET_SUPPORT=TRUE
when calling the procedure with ref cursors.
There's a note in My Oracle Support that gives you examples how to call remote SQl Server procedures
     Note.197192.1 Different Methods How To Call MS SQL Server Procedures Using TG4MSQL - DG4MSQL
and another one for the Sybase gateway but this code is similar for the SQL Server:
Article-ID: Note 351400.1
Title: How to Call a Remote Sybase Procedure Using TG4SYBS

Similar Messages

  • PL/SQL Procedures with the same name

    Hi,
    I have some PL/SQL procedures with the same name but different arguments.
    If I try to catalog the second or third ALBPM always catalogs the first and I don't want to use this. ALBPM only catalogs the first one.
    ALBPM Studio Logs:
    Introspecci?n en curso...
    Agregando procedimiento 'ADM_SGI.UGDIASINOI'
    Agregando procedimiento 'ADM_SGI.UGDIASINOI'
    Agregando procedimiento 'ADM_SGI.UGDIASINOI'
    [Advertencia] No se puede agregar procedimiento 'UGDIASINOI'. Motivo: Duplicar nombre del componente (M?dulo DatabaseRoot.ADM_SGI - Componente UGDIASINOI)..
    [Advertencia] No se puede agregar procedimiento 'UGDIASINOI'. Motivo: Duplicar nombre del componente (M?dulo DatabaseRoot.ADM_SGI - Componente UGDIASINOI)..
    Analizando componentes
    Any solution or idea??
    Thanks!

    I need to retrive data from PL/SQL stored procedures. I am using the DynamicSQL component (2nd workaround) to retrive data from PL/SQL stored procedures. <br><br>
    I am having some problems.<br><br>
    This is the code I am running in Fuego Studio 5.5 SP 11 Build #71108:<br><br>
    dynamicSQL as Fuego.Sql.DynamicSQL<br>
    iterator as Iterator(Any[Any])<br>
    sentence as String<br>
    implname as String<br><br>
    dynamicSQL = Fuego.Sql.DynamicSQL()<br>
    implname = "conexionORBPAU"<br>
    sentence = "var result REFCURSOR; " + <br>
    "exec :result_cursor := pkg_audbpm_bpaasig_indicador.prgetsingle(9999);";<br>
    iterator = executeQuery(DynamicSQL, sentence, implname, inParameters : []);<br><br>
    And, this is the error:<br><br>
    java.sql.SQLException: Falta el parametro IN o OUT en el indice:: 1 <br>
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)<br>      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)<br>
    oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1681)<br>
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3280)<br>
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)<br>
         at fuego.jdbc.FaultTolerantPreparedStatement.executeQuery(FaultTolerantPreparedStatement.java:579)<br>
         at fuegoblock.sql.DynamicSQL.executeQuery(DynamicSQL.java:340)<br>
    ...<br><br>
    This is the code of the PL/SQL in the Oracle DB:<br><br>
    CREATE OR REPLACE PACKAGE PKG_AUDBPM_BPAASIG_INDICADOR IS<br>
    TYPE cursor_type IS REF CURSOR;<br>
         FUNCTION prGetSingle<br>
         (<br>
              p_ID_ASIG_INDICADOR IN NUMBER<br>
         )<br>
         RETURN cursor_type;<br><br>
    END PKG_AUDBPM_BPAASIG_INDICADOR;<br><br>
    is my code OK? Any ideas?<br><br>
    Thanks in advance.<br>

  • How to call sql procedure with parameter from java

    Hello,
    i am trying to call one sql procedure with two parameters from java.
    the first parameter is In parameter, the second is OUT.
    the return value of this java method should be this second parameter value.
    the following is my java code:
    protected String getNextRunNumber() {
         String runnumber=null;
         String sql = "{call APIX.FNC_SST_EXPORT.GET_NEXT_RUNNUMBER (?,?)}";
    CallableStatement state = null;
    try{
         Connection con= getDatabaseConnection();
         state = con.prepareCall(sql);
         state.setString(1, m_appKeyExport);
         state.registerOutParameter(2,Types.NUMERIC,0);
         state.execute();
    ResultSet resultR = (ResultSet)state.getObject(2);
         while (resultR.next()) {
              runnumber=resultR.getBigDecimal(1).toString();
    catch (SQLException e){System.out.println("You can not get the export next run number properly");}
    return runnumber;
    i got error message like:
    java.lang.ClassCastException: java.math.BigDecimal
    As far as i knew, if the parameter is number or decimal, we should give also the paramer scale to the method: state.registerOutParameter(), but i still get this error message.
    Please help me to solve this problem.
    Thanks a lot.

    state.execute();
    i try to use debug to find the problem, in this line, i saw
    OracleCallableStatement(OraclePreparedStatement).execute() line: 642 [local variables unavailable]
    is this the problem?

  • SQL script with a prompt functionality.

    Hello experts,
    I tried searching this on the net but was unsucessful...
    Bascially I need to update an sql script with a prompt functionality..Basically I would like a user prompt that would enter 'Yes or No' to compile invalid objects using utlrp.
    If Yes, it should compile it
    If No it should exit out...
    Can anyone please help.. Need to do this today.
    Edited by: user568296 on Oct 2, 2009 8:18 AM

    Hi,
    As someone suggested, you're probably better off doing this at the OS level.
    SQL*Plus does not have any good mechanism for conditional branching. One trick you can do in SQL*Plus is to run one script from another by saying <tt>@@filename</tt>. By using a substitution variable (which can be defined based on the results of a query) in place of a literal filename, you can make this dynamic.
    For example, the following script runs either
    recompile.sql or
    goodbye.sql
    based on the answer to a prompt:
    ACCEPT     recompile_now      PROMPT        'Do you want to recompile objects now?  '
    COLUMN     next_script_col        NEW_VAL next_script
    SELECT     CASE     
              WHEN  UPPER ('&recompile_now') LIKE 'Y%'
              THEN  'recompile'
              ELSE  'goodbye'
         END     AS next_script_col
    FROM     dual;
    @@&next_script<tt>@@filename</tt> assumes filename.sql is on the same directory as the calling script. You could also give a full path name using only one @-sign:
    <tt>@pathname</tt>

  • Creating Web service for PL/SQL Procedure with Complex Data Types

    I need to created web service for PL/SQL Procedure with Complex Data types like table of records as parameters, how do we map the pl/sql table type parameters with web service, how to go about these?

    Hello,
    When you are creating a service from a Stored Procedure, the OracleAS WS tools will create necessary Java and PL wrapper code to handle the complex types (table of record) properly and make them compatible with XML format for SOAP messages.
    So what you should do is to use JDeveloper or WSA command line, to create a service from your store procedure and you will see that most of the work will be done for you.
    You can find more information in the:
    - Developing Web Services that Expose Database Resources
    chapter of the Web Service Developer's guide.
    Regards
    Tugdual Grall

  • Compiles a procedure with syntax error

    In the script tab, try to compile a procedure with syntax errors.
    The message displays procedure compiled !!!
    It should display that procedure compiled with errors.

    Hi Kris,
    I searched through the threads, but did not come across a similar question and that is why i raised the query. It'll be helpful if you could answer the query.
    regards,

  • Running Premiere PrO cs6. After upgrading to Yosemite 10.10.2 Adobe Premiere wont run, come up with system error and shuts down. Any one else had this issue?

    Running Premiere PrO cs6. After upgrading to Yosemite 10.10.2 Adobe Premiere wont run, come up with system error and shuts down. Any one else had this issue?

    can try this Premiere Pro CC, CC 2014, or 2014.1 freezing on startup or crashing while working (Mac OS X 10.9, and later)

  • SQL developer 3.1 throws Function sequence error

    Hi,
    I was able to connect to my remote timesten db and was able to compile and execute packages.
    I tried modifying one of my packages to include dbms_lock.sleep in my code and then compiled the package.
    while running the package i got some error related to locking.
    The strange this is after this i am not able to connect to the timesten db using sql developer.
    An error is thrown, "Could not connect to the database Function sequence error"
    I tried restarting the timesten server and then also the same error exists.
    How can i resolve this?
    regards
    Lal

    Hi,
    This looks like a problem with the SQL*Developer Early Adopter release itself so it would be better if you opened a new thread in the SQL*Developer forum -
    SQL Developer
    That is monitored by the developers more than this thread so they are more likely to see it.
    Regards,
    Mikei

  • OCCI call PL/SQL Procedure with 2 IN/OUT Parameters..BUS ERROR!!

    Hi~ All,
    I am new user for using OCCI. Util now, I encountered a problem with OCCI when I call a procedure with 2 IN/OUT parameters. Then,I got an error(core dump), Why?
    CREATE OR REPLACE PROCEDURE demo_proc (v1 in integer, v2 in out varchar2, v3 in out varchar2);
    ==== OCCI Code ========
    stmt = conn->createStatement
    ("BEGIN demo_proc(:v1, :v2, :v3); END;");
    cout << "Executing the block :" << stmt->getSQL() << endl;
    stmt->setInt (1, 10);
    stmt->setString (2, "Test1");
    stmt->setString (3, "First");
    int updateCount = stmt->executeUpdate ();
    cout << "Update Count:" << updateCount << endl;
    cout << "Printing the INOUT & OUT parameters:" << endl;
    string c1 = stmt->getString (2);
    cout << c1 << endl;
    string c2 = stmt->getString (3);
    ==== RUN RESULT ====
    Bus error(coredump)
    But, If i just only got one of string from v1 or v2,I could get correct result!! Why? Does some one know how to avoid this two IN/OUT parameters issue?

    Hi~ Amoghavarsha,
    Thanks for your response! I solved the problem by myself. I found the root cause, it seems very strange in
    initializing environment variable.
    === FAILED ===
    Environment *env;
    === SUCCESS ===
    Environment *env = NULL; <---Why??
    cout << "occidml - createEnvironment" << endl;
    env = Environment::createEnvironment (Environment::OBJECT);
    Eventually, I fixed this issue in Win2K and HP-UX 11.
    Best Regards,

  • Debugging PL/SQL procedures with JDeveloper ?

    Hi,
    does anyone know if it is possible to debug PL/SQL procedures and packages with JDeveloper ? I'm using a 9.0.1.2.0 database but JDeveloper returns the error "The target VB_TEST could not be started because the database version does not support debugging." when I try to debug a PL/SQL procedure.
    If it is not possible, does anyone know a good alternative ?Oracle Script Debugger is not available anymore at technet.

    I need to retrive data from PL/SQL stored procedures. I am using the DynamicSQL component (2nd workaround) to retrive data from PL/SQL stored procedures. <br><br>
    I am having some problems.<br><br>
    This is the code I am running in Fuego Studio 5.5 SP 11 Build #71108:<br><br>
    dynamicSQL as Fuego.Sql.DynamicSQL<br>
    iterator as Iterator(Any[Any])<br>
    sentence as String<br>
    implname as String<br><br>
    dynamicSQL = Fuego.Sql.DynamicSQL()<br>
    implname = "conexionORBPAU"<br>
    sentence = "var result REFCURSOR; " + <br>
    "exec :result_cursor := pkg_audbpm_bpaasig_indicador.prgetsingle(9999);";<br>
    iterator = executeQuery(DynamicSQL, sentence, implname, inParameters : []);<br><br>
    And, this is the error:<br><br>
    java.sql.SQLException: Falta el parametro IN o OUT en el indice:: 1 <br>
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)<br>      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)<br>
    oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1681)<br>
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3280)<br>
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)<br>
         at fuego.jdbc.FaultTolerantPreparedStatement.executeQuery(FaultTolerantPreparedStatement.java:579)<br>
         at fuegoblock.sql.DynamicSQL.executeQuery(DynamicSQL.java:340)<br>
    ...<br><br>
    This is the code of the PL/SQL in the Oracle DB:<br><br>
    CREATE OR REPLACE PACKAGE PKG_AUDBPM_BPAASIG_INDICADOR IS<br>
    TYPE cursor_type IS REF CURSOR;<br>
         FUNCTION prGetSingle<br>
         (<br>
              p_ID_ASIG_INDICADOR IN NUMBER<br>
         )<br>
         RETURN cursor_type;<br><br>
    END PKG_AUDBPM_BPAASIG_INDICADOR;<br><br>
    is my code OK? Any ideas?<br><br>
    Thanks in advance.<br>

  • Pl/sql procedure with shell script

    Hi Guys,
    I will be updating some of the columns in the database thru SQL UPDATE stament. I want to make this process automatic. I.e instead of running manually this uodate process, i want to write a unix script which run on cron job. In the update stament I have to compare date like e_create_date > to_date (........, 'yymmdd') and date should be 2 days previous then to date and I would ike to create the spool file which I would like to send through mail.the script will run automatically.
    I am confused how to write shell script & sql procedure and how to call it inside the shell script. How can this be done.
    Help Appreciated.
    Thanks
    sonu

    save the Store procedure as a create_SP.sql in OS
    save another testrun.sql
    as follows
    begin
    sp_test('&p_test');
    end;
    If you are on a Unix or Solaris OS then
    open a Shell Script as follows :
    and name as test.sh or test.ksh
    var='SYSTEM'
    export var
    sqlplus username/password
    @create_SP.sql
    -- this created a store procedure on the database
    @testrun.sql $var
    This will execute the SP with parameter from OS Variable.

  • Toplink storedProcedure/funtion + PL/SQL Procedure with cursor

    Hi,
    I am working on Toplink storedProcedure but, I am not getting any output. I go through the Oracle Tutorial but, still I am not getting any alternative.
    please, anyone help out....
    Thanking You,
    regards,
    sufian

    Hello Sufian,
    You seem to have a few threads trying to get a Stored proc working. In How to work with Toplink + PL/SQL Procedure + Cursor
    you mention you get an error when executing, have you gotten past this exception? You may want to turn on TopLink logging to see the statement TopLink is creating and sending to the driver. Please see
    http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/sescfg004.htm
    If you are not familar with how to turn on logging.
    Also, are you able to get results from a stored procedure that returns data instead of a cursor?
    Best Regards,
    Chris

  • FND_REQUEST PL/SQL procedure with parameters

    Hi guys
    I have created a concurrent program, using PL/SQL procedure which has 2 in parameters. I am trying to call the concurrent program using
    v_req_id :=FND_REQUEST.SUBMIT_REQUEST('INV','OMS_POP_INVVALUES_P',
    NULL,SYSDATE,FALSE,l_on_date, l_org_id,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
    COMMIT;
    However, the concurrent program always failing with
    **Starts**26-AUG-2013 14:02:31 ORACLE error 6550 in FDPSTP Cause: FDPSTP failed due to ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'OMS_POP_INVVALUES_P' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    and I doubt it is because the database procedure call is not proper.
    I have set four parameters with the concurrent program, as they were with the procedure itself, which are
    p_on_date IN DATE, p_org_id IN NUMBER, errbuff   OUT VARCHAR2,retcode   OUT VARCHAR2
    Please help
    regards,
    raj

    Okay I fixed the problem by
    1. Changing the order of parameters with Procedure like following
    CREATE OR REPLACE PROCEDURE OMS_POP_INVVALUES_P (
    errbuff   OUT VARCHAR2,retcode   OUT NUMBER, p_on_date IN DATE, p_org_id IN NUMBER)
    IS
    and then changing the concurrent program call like following
    l_req_id :=
          fnd_request.submit_request('INV','OMS_POP_INVVALUES_P',
                                                                        NULL,SYSDATE,FALSE,l_in_date, l_org_id,CHR(0));
       :SYSTEM.Message_Level := '25';
       COMMIT;
    after removing all the parameters from the program parameter list. No need to pass any value for errbuff and retcode, just pass other parameters and end the parameter list with CHR(0). Hope this is useful for somebody else out there.
    Regards,
    raj

  • Reporting off oracle stored procedure with parameters error

    Erorr message: Error in File xxx.rpt: Failed to retrieve data from the database. Details: [Database Vendor Code: 907 ]
    Asp.net 2.0 web application.
    CR XI R2 sp2 in BOE XI R2 sp2 on Solaris 10.
    Database: Oracle 10g on Solaris 10. Oracle stored procedure defined in package.
    Happens with reports reporting off stored procedure with parameters.
    The sp is used in the crystal report.
    The web application passes parameters to crystal report, which then passes the parameters to stored procedure.
    Encountered error if:
    r.PromptOnDemandViewing = false;
    r.UseOriginalDataSource = false;
    r.CustomServerType = CeReportServerType.ceServerTypeOracle;
    Report can retrieves data if:
    r.PromptOnDemandViewing = false;
    r.UseOriginalDataSource = true;
    r.CustomServerType = CeReportServerType.ceServerTypeOracle;
    In addition
    The steps are:
    1)     Create oracle package and stored proc.
    2)     In CR Designer, select the stored proc as datasource.
    3)     The parameters names were "generated" by the CR Designer.
    4)     Rename the parameter names.
    5)     Drag the fields onto report.
    We noticed the following with different setting of database logon info:
    When previewing from BOE, get error when "Use custom database logon information specified here"
    However, no error when "Use original database logon information from the report". 
    Am i missing something?

    Please re-post if this is still an issue to the Data Connectivity - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • Running SQL developer with Oracle XE

    I am running SQL Developer 1.5 against Oracle 10g XE for a quick interface to practice SQL and PL/SQL. Before running any scripts to create tables, I see a huge number of tables, views, etc. already created for my user HR (which I unlocked in Oracle XE) and any other user I create. What can I do to prevent these tables from appearing? Which ones are necessary for processing? I realize that these are old versions of SQL Developer and Oracle XE but they are much quicker to install for my purposes than the newer editions. Thank you.

    Get the latest SQL Developer instead right away; it's no "install" just unzip and go.
    Above suggested role, is one of the predefined, to-be deprecated roles, and should not be used. Instead use CREATE SESSION privilege for relevant users and preferrably create your own application-specific roles. See the Security Guide for more info.

Maybe you are looking for

  • Bridge CC crashes while using arrow keys to switch images

    Adobe Photoshop CC 2014 Adobe Bridge 2014 on Mac is crashing every time I press an arrow key to move through images in bridge. I can click to manually select images with no problem, but using the up/down arrow keys to move to the next image up/down b

  • Page Not displayed error upon Session Expiry in Solari Environment

    Hi All, I have a web application deployed in Solaris environment. Session expiry is handled from the application. I have this code for session expiry in my filter class: ((HttpServletResponse) _response).sendRedirect("/myapp/view/sessionExpired.jsp")

  • Adobe illustrator and wacom cintiq tablet

    Why is it that i can use my tablet on inkscape (open source) but i cannot get illustrator to work, ironically it works with all my other software perfectly

  • Is in Solaris 9 something like UpdateMangaer in Solairs 10?

    Hi, I am Solaris 10 user on SPARC. But recently I started using Solaris 9 U9 and I am looking something like UpdateManager in Solaris 10. Is in Solaris 9 such tool? I am asking because I would like to install the latest patches on Solaris 9. Kind reg

  • Media converters

    Am creating a graduation gift using video and photos sent to me on a cd. How can I get this into my iMac to create in IMovie and then to IDVD for the ultimate gift?