Ansi SQL and stored procedures

From: tiz <tbezzi_at_yahoo.com>
Date: 25 Feb 2005 03:25:25 -0800
Message-ID: <1109330725.378845.314110_at_l41g2000cwc.googlegroups.com>



[Quoted] [Quoted] Hi, i'm trying to exec a simple stored proc with In and Out params:

PROCEDURE GETNOMEFROMCOGNOME1

 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
[Quoted]  COGNOME                        VARCHAR2                IN
 NOME                           VARCHAR2                OUT

that's my code (basically):

 EXEC SQL ALLOCATE DESCRIPTOR 'input_descriptor';  EXEC SQL ALLOCATE DESCRIPTOR 'output_descriptor';

 EXEC SQL PREPARE prep_statement FROM : dyn_statement;

EXEC SQL SET DESCRIPTOR 'input_descriptor' VALUE 1 TYPE =
:ANSI_varchar_type, LENGTH = :input_len, DATA = :cognome_data;
EXEC SQL SET DESCRIPTOR 'input_descriptor' VALUE 2 TYPE =
:ANSI_varchar_type, LENGTH = :input_len, DATA = :cognome_data;

EXEC SQL SET DESCRIPTOR 'output_descriptor' VALUE 1 DATA=:a, TYPE =
:ANSI_varchar_type;

  EXEC SQL SET DESCRIPTOR 'output_descriptor' VALUE 2 DATA=:b, TYPE =
:ANSI_varchar_type;

EXEC SQL EXECUTE prep_statement USING DESCRIPTOR 'input_descriptor' ;

The error I get is:
ORA-01422: exact fetch returns more than requested number of rows

That's wrong with this code?
Could so help me, please???

thx
tiz Received on Fri Feb 25 2005 - 12:25:25 CET

Original text of this message