Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> ORA-01460 Oracle9i

ORA-01460 Oracle9i

From: harp <hmetu_at_gmx.net>
Date: 9 Feb 2005 08:35:47 -0800
Message-ID: <1107966947.055597.19660@c13g2000cwb.googlegroups.com>


Hi!
I created and compiled the following via sql*plus successfully.

DROP PACKAGE ODBCRefCus;
CREATE PACKAGE ODBCRefCus AS
  TYPE firstname_cus IS REF CURSOR;
  TYPE familyname_cus IS REF CURSOR;
  TYPE address_cus IS REF CURSOR;
  TYPE telno_cus IS REF CURSOR;

PROCEDURE spEmpCus(Firstname IN OUT firstname_cus, Familyname IN OUT familyname_cus, Address IN OUT address_cus, Telno IN OUT telno_cus, comp IN
VARCHAR2);
END;
/

CREATE PACKAGE BODY ODBCRefCus AS
PROCEDURE spEmpCus(Firstname IN OUT firstname_cus, Familyname IN OUT familyname_cus, Address IN OUT address_cus, Telno IN OUT telno_cus, comp IN
VARCHAR2)
    AS

      BEGIN
         IF NOT Firstname%ISOPEN
         THEN
             OPEN Firstname for SELECT firstname FROM customers WHERE
firm = comp;
         END IF;
         IF NOT Familyname%ISOPEN
	 THEN
	     OPEN Familyname for SELECT familyname FROM customers WHERE firm =
comp;
         END IF;
         IF NOT Address%ISOPEN
	 THEN
	     OPEN Address for SELECT address FROM customers WHERE firm = comp;

         END IF;
         IF NOT Telno%ISOPEN
	 THEN
	     OPEN Telno for SELECT telno FROM customers WHERE firm = comp;
         END IF;
      END;

END;
/

Then I tried to execute them via odbc (language is c++) AnsiString stmt = "{CALL ODBCRefCus.spEmpCus(?)}"; char *comp = "compName";

//Allocate ODBC Handler

  ret = SQLAllocEnv(&hEnv);//was ok
//Allocate Connecting handler

ret = SQLAllocConnect(hEnv, &hDBconn);//was ok
//create odbc connector

ret = SQLConnect(hDBconn,...);//was ok
//allocate statement

   ret = SQLAllocStmt(hDBconn, &hstmt);//was ok
//step 1: Bind the parameters

   ret =
SQLBindParameter(hstmt,1,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_C_CHAR, sizeof(comp),0,comp,0,&sqlnts);//was ok
//Step 2: Prepare the sql statement and Execute

   ret = SQLPrepare(hstmt, stmt.c_str(), stmt.Length());//was ok
//Step 3: Execute the sql-prepared statement

   ret = SQLExecute(hstmt);
//******* it fails to execute there by displaying this error
//******* message "ORA-01460 unimplemented or
//******* unreasonable conversion requested"
What is wrong with my program? What am I missing? Thanks in advance,
Regards,
Harp Received on Wed Feb 09 2005 - 10:35:47 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US