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 -> dbms_sql

dbms_sql

From: Mikael Schonenberg <micke_at_netg.se>
Date: Thu, 23 Apr 1998 04:07:44 +0200
Message-ID: <Pine.LNX.3.96.980423035900.2007D-100000@valdez.netg.se>


 I have some problems with dynamic SQL. I use the dbms_sql package to dynamically create an sql query. With the define_column, fetch_rows and column_value procedures/functions I seem to get just about the correct data... at least when I test my procedure from SQL*PLUS. When I try to call the procedure from outside Oracle, through ODBC, I run into an ORA-06512. I've tracked down the bug to the column_value function, but to be honest, I have absolutely no idea what to do about it.

 Here's a few lines from the code, just to illustrate what I'm doing;

nCursorId := dbms_sql.open_cursor;

dbms_sql.parse(nCursorId, sSqlStatement, dbms_sql.native);
dbms_sql.define_column(nCursorId, 1, gFirstName, 20);
dbms_sql.define_column(nCursorId, 2, gLastName, 20);

nRows := dbms_sql.execute(nCursorId);
nRows := dbms_sql.fetch_rows(nCursorId); while nRows = 1 loop

	dbms_sql.column_value(nCursorId, 1, gFirstName); 
	dbms_sql.column_value(nCursorId, 2, gLastName);

 It's the two last lines that causes the error...

/Mikael Received on Wed Apr 22 1998 - 21:07:44 CDT

Original text of this message

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