Crystal Reports and Stored Procedures

AdamG

New Member
Hello

I am experimenting with Crystal Reports and Progress Stored Procedures. I have created a simple stored procedure through Progress SQL Explorer ver. 10.0B. The procedure compiles and returns data. It works as expected.
Then, in WinXp, I am trying to set this procedure as a data source for Crystal Reports 10.0, trough ODBC Driver, and I am getting the following
error:
Query Engine Error:[DataDirect][ODBC OPENEDGE driver][OPENEDGE]Syntax error in SQL statement at or about "}" (10713)
I am including above mentioned stored procedure below:
------------------------------------------------------------------------
-
CREATE PROCEDURE odbcuser.getName1()
RESULT (
name CHARACTER(100)
)
BEGIN
String sname = "";
SQLCursor custcursor = new SQLCursor ( "select name from pub.customer"
) ;
custcursor.open ();
custcursor.fetch ();
while (custcursor.found())
{
sname = (String) custcursor.getValue(1, CHARACTER);
SQLResultSet.set (1, sname);
SQLResultSet.insert ();
custcursor.fetch();
}
custcursor.close ();
END;
commit;
--------------------------------------------------------------------
Could someone tell me what I am missing?
Any help is appreciated
 

schaapie

Member
I'm not familiar with Stored Procedures, but have had a SQL-statement gone wrong through an ; too much. Maybe you should ommit a last one in a section?
 

regulatre

Member
Sounds familiar... are you interfacing to a db named HOST or POS?

What user name are you logging on to the DB with?

If the user name contains a space, then the java compiler will puke. You can confirm this by taking a look at the java file that gets spit out when the compile fails. The file is stored in the C:\OpenEdge\Wrk folder on the database server.

Even if the user name is not the problem, then you can look at the java file and inspect it for errors. I think there's also another file created at the same time (in the same folder) that describes the exact error encountered. I think that file ends in .trc.
 
Top