cancel
Showing results for 
Search instead for 
Did you mean: 

How to Call a MaxDB DBPROC ?

Former Member
0 Kudos

MaxDB version 7.7

I have written a DBPROC , and it created successfully

Create DBPROC A.test AS

select * from A.B

(A - Schema name; B - Table name)

However, when I try to call it :

call A.test

if failed with "Error Executing 'CALL A.test' SAP DBTech JDBC: Call of execute(String) is not allowed for PreparedStatement."

And I try to call some system defaul procedures, still the same problems.

Anyone who can tell me why? or how to call it correctly?

Thanks very much !!!

Accepted Solutions (0)

Answers (1)

Answers (1)

alexander_schroeder
Participant
0 Kudos

Hello Xuan,

A prepared statement executes the command given at prepare time. This is

normal JDBC, and nothing specific to MaxDB

So either use a 'normal' statement:


...
Statement s = connection.createStatement();
s.execute("CALL A.test")
...

or use a callable statement and prepare the command:


...
CallableStatement c = connection.prepareCall("CALL A.test");
c.execute();
...

Regards

Alexander Schröder

Former Member
0 Kudos

Hi Alexander Schröder,

Thank you very much !

However, I just ran the statement in MaxDB Database Studio (I new a SQL editor), which just like you writing SQL statement on Query Analyser in Microsoft SQL Server.

So , I wanna if there are some settings I need to modify ? or any other reasons ?

Thank you !

Best Regards,

Bi,Xuan

Former Member
0 Kudos

Hello,

what version of the Database Studio do you use? (Help->About Database Studio)

Best Regards

Wolfgang