Link to home
Start Free TrialLog in
Avatar of princehyderabad
princehyderabad

asked on

How to call Oracle Function in code

hi,

Let me konw if I'm approaching correct way to call oracle function which takes userKey and return back the value.

..
CallableStatement cs1 = null;        
                    cs1 = conn.prepareCall(" {call GetUserKeySuf(?) }");
                    cs1.setString(1, userKey);
                    cs1.execute();
                    String getSuffix = cs1.getString(1);
...

Error: ORA-00900: invalid SQL statement

thx,
PH
ASKER CERTIFIED SOLUTION
Avatar of Raynard7
Raynard7

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of princehyderabad
princehyderabad

ASKER

how can I put in variable. I mean if I want

String a = rs.getString(?????);

??? what variable name should I give here
What language are you using? I would put the results of the query into a recordset using ADO - then pull the result from column 0 row 0