Many Thanks !

But there is still a problem :

I have to get back a result-table, so I use "RETURNS CURSOR" .

Like I the sapdb Docu, I the dbproc looks like this :

create dbproc prog_one (IN input char(150)) RETURNS CURSOR AS
VAR   outstr char(150);
SET outstr = REPLACE (input, '�', 'Ae');

$CURSOR = 'HOTEL_CURSOR';
DECLARE :$CURSOR CURSOR FOR
SELECT outstr FROM domain.columns where rowno <= 1 ;

So, you see, that I want to get back a result-set with one field, which contains the 'outstr' variable. (needed for a javabean, lying upper...) But I haven't found out yet, how I could Select a variable, because then, Error comes :

Unknown Column Name

I guess, it's only a tiny problem, but the Docu says to Selected Column (select_column) :

Syntax

<select_column> ::= <table_columns> | <derived_column> | <rowno_column> | <stamp_column>

<table_columns> ::= * | <table_name>.* | <reference_name>.* <derived_column> ::= <expression> [ [AS] <result_column_name>] | <result_column_name> = <expression>
<rowno_column> ::= ROWNO [<result_column_name>] | <result_column_name> = ROWNO
<stamp_column> ::= STAMP [<result_column_name>] | <result_column_name> = STAMP


<result_column_name> ::= <identifier>

So, where is a '<variable_column>' or something like that?

Best regards,
Danny


Am 12 Jun 2003 00:31:56 +0200 hat Thomas Cataldo <[EMAIL PROTECTED]> geschrieben:


On Wed, 2003-06-11 at 18:06, Danny Tramnitzke wrote:
Great, the Replace Function is just, what I need. :-)

So, now I have such a dbproc :

create dbproc prog_one (IN input char(50), OUT outstr char(50)) AS
SET outstr = REPLACE (input, '�', 'Ae') outstr ;

But now, my question is, how could I get the outstr ?
I tried it with java command :

...<shorted>...
String input = "�chtz";
String output = "";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("Call prog_one(" + input + "," + output + ")");
while (rs.next())
{
System.out.println("output : " + output);
}


But there comes the Message : Missing value specification

So, but I guess, I'm right to use an IN and OUT paramter.. ?

This should give you a hint :


[...]
CallableStatement cs = connection.prepareCall("call prog_one(?,?)");
cs.registerOutParameter(2, Types.VARCHAR);
cs.setString(1, "Hello world");
cs.execute();
String ret = cs.getString(1);
[...]

Thomas.






-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to