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 -> ansi dynamic sql returning clause

ansi dynamic sql returning clause

From: Ralph Helmstaedt <rhelmstaedt_at_pcsoft.de>
Date: Fri, 18 Jan 2002 16:53:33 +0100
Message-ID: <gufg4uc40n6c3r93gd0vpg2t1s98782ct7@4ax.com>


Hello,

can anybody explain how to use dynamic sql return clause in proc, please ?
I use the following code snippets;

/* Table */
create table test1 (cl clob);

char *stmt="insert into test1 (cl) values(empty_clob()) returning cl :into clob";

EXEC SQL ALLOCATE DESCRIPTOR 'ind';
EXEC SQL ALLOCATE DESCRIPTOR 'ond';

EXEC SQL Allocate :clob;

printf("Prepare STatement");

EXEC SQL PREPARE stmt FROM :stmt;
printf("\n");

printf("DECLARE CURSOR");
EXEC SQL DECLARE c CURSOR FOR stmt;
printf("\n");

printf("DescrInput");
EXEC SQL DESCRIBE INPUT stmt USING DESCRIPTOR 'ind'; //ohne For printf("\n");

printf("DescrOutput");
EXEC SQL DESCRIBE OUTPUT stmt USING DESCRIPTOR 'ond'; //ohne For printf("\n");

printf("GetCount Input ");
EXEC SQL GET DESCRIPTOR 'ind' :countin= COUNT; printf("\n");

printf("GetCount Output ");
EXEC SQL GET DESCRIPTOR 'ond' :countout= COUNT; printf("\n");

printf("Count Input %d\n",countin); /* Gives 1 ? */ /***** Should it be 0 ? ***/
printf("Count Output %d\n",countout); / Gives 0 */ /**** Should it be 1 ? ***/

printf("Execute");
EXEC SQL FOR BATCHFETCH EXECUTE stmt USING DESCRIPTOR 'ind' into DESCRIPTOR 'ond';
printf("\n");

The Execute statement returns an ORA-00932 inconsistent datatypes

Thanks Received on Fri Jan 18 2002 - 09:53:33 CST

Original text of this message

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