Naresh Chandak wrote :
>I am using sap db version 7.3.0.21 
>java driver version : sapdb-jdbc-bin-7.3.0.23a.jar 
>sql studio version 7.3.1.0 
>I have a Table 
>CREATE TABLE TP ( id INTEGER , name VARCHAR(50)) 
>It has got following values 
>INSERT INTO TP( id , name ) values (1 , 'a') 
>INSERT INTO TP( id , name ) values (2 , 'b') 
>INSERT INTO TP( id , name ) values (3 , 'c') 
>INSERT INTO TP( id , name ) values (4 , 'd') 
>INSERT INTO TP( id , name ) values (5 , 'e') 
>I have a procedure.. 
>CREATE DBPROC USP_TEST (IN ID3 INTEGER ) AS
>BEGIN
>SELECT * FROM TP WHERE ID > :ID3 ;
>END ;
>when I execute this procedure through sql studio ( CALL USP_TEST (1) ) 
>It shows 'Statement successfully executed , No result found ' . But it
should get 4 rows. 
>same thing I tried with java. I got an exception 'SQL Statement generates a
row count ' 
>What should be the problem ?

This is not a procedure that returns a cursor. If you want to create a
procedure
returning a cursor you have to use the following syntax :

CREATE DBPROC USP_TEST (IN ID3 INTEGER ) RETURNS CURSOR AS
BEGIN
SET $CURSOR = 'MYCURSOR';
DECLARE :$CURSOR FOR SELECT * FROM TP WHERE ID > :ID3 ;
END ;

But as Marco already wrote this feature is still under construction. If you
use
an old JDBC driver you may have luck, but a call from SQL studio will  
definitive return no result.

Thomas

---

Thomas Anhaus
SAPDB, SAP Labs Berlin  


_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to