on 10-15-2014 2:15 PM
Hi Experts,
I need help in writing query java UDF.
I receive Plant parameter as input to the UDF :
I want use this inbound parameter in my query, but I don't know how to write this :
1. Query = "SELECT * FROM TABLE WHERE F_VEHICLE_PRODUCTION_PLANT = ' :Plant ' " ;
Or
2. Query = "SELECT * FROM TABLE WHERE F_VEHICLE_PRODUCTION_PLANT'" +Plant +"'";
resultSet = accessor.execute(Query);
Thanks for your help.
"select * from table where F_VEHICLE_PRODUCTION_PLANT =" +"\'"+ Plant+ "\'";
But how are you executing this query? JDBC DML structure?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My Java UDF already exists and works fine. I'm connected to database by à CC JDBC Adapter :
channel = LookupService.getChannel("MDM","CC_MDM_ORACLE_READ"); | |
accessor = LookupService.getDataBaseAccessor(channel); |
resultSet = accessor.execute(Query);
I just want to add this new condition to my query using parameter Plant.
OK, I will try with your exemple, thanks.
Hi,
Why my argument is not recognized ? However this is a string...
Your argument is an array e.g String[] inp, but in your UDF I think you just used
inp.toString(); which would convert it into what you see above. To obtain the correct value, use its array position e.g to get first entry of inp[] array, it should be inp[0].toString();.
Regards,
Mark
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.