Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×hi,
I have a procedure in oracle db which insert new data on a custom table and a commit at the end. Calling this procedure directly from my db tool(toad) it works fine.
But using JJUPIN sql() routine in a SIL script and calling it from SIL RUNNER Gadget, it doesnt work.
Is it possible to execute insert statement with sql() routine from Sil Runner Gadget?
sqlDo = "execute CUSTOM_PKG.INSERTDATA('test')";sqlResult = sql("JiraDB", sqlDo);
I have been using sql() routine and Sil Runner Gadget successfully many times but just querying data from external table.
Regards,
OK, how about trying such script?:
string param1 = "'test'"; string sqlDo = "begin CUSTOM_PKG.INSERTDATA("+param1+"); end;"; string[] sqlResult = sql("JiraDB", sqlDo);
Hi Eric,
You have a procedure there. You have to use a different routine for that: https://confluence.kepler-rominfo.com/display/SIL30/sqlCallStoredProcedure. If you need out params, check the very similar routine designed for this task.
HTH,
Silviu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Silviu, how do i do this in JJUPIN 2.6? Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eric, The routine is available since JJUPIN 3.0. I suggest you to update to JJUPIN 3.0 since, in addition to bugfixes, we also added lots of features, including structures and error handling in SIL language. Alexandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alexandra, We will upgrade but not yet this time, do we have any other way to execute a procedure from Sil Runner Gadget? a workaround perhaps? Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Short answer: no workaround Long answer: There is https://confluence.kepler-rominfo.com/display/SIL/system routine, if you can manage to invoke an sql command using it, you have the solution for your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks I'll give it a try...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What type of data are your parameters?
You can try this way:
string param1 = "'test'"; string sqlDo = "execute CUSTOM_PKG.INSERTDATA("+param1+")"; string[] sqlResult = sql("JiraDB", sqlDo);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Blazej, I even tried a procedure without parameter, just directly insert and commit, it just doesnt work. Probably need to upgrade for this routine sqlCallStoredProcedure. Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Damn, maybe that's because Oracle handles it differently. We use above approach a lot in MS SQL and it works OK. Are you absolutely sure, that db user used in the JNDI source have permission to execute procedures and/or write data?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yup, user used on JNDI/DB Tool is the same, and it works when using DB Tool.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Blazej, Can you share how you define your JNDI source?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure, however it's a congiuration to ms sql, not oracle: <Resource name="myJNDIname" auth="Container" type="javax.sql.DataSource" username="myDBuser" password="myDBpassword" driverClassName="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:sqlserver://mySERVERaddress" />
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
its same with ours.. :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, one more thought. Have you looked into the logs? What response do you get when you try to call the procedure?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the error log, any idea? 2015-08-13 18:54:14,894 pool-15-thread-1 ERROR eric1000 582x2403x1 jxc0go 192.168.10.10 /rest/keplerrominfo/jjupin/latest/rungadget/run [commons.sil.routines.SQLRoutine] Could not execute SQL >>execute PKG.INSERTDATA('Test')<< on database JiraDB. java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
wow... it works.. thanks a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Point for google :> I've never used oracle in my life, just googled it up :D I'm glad it works :) I'll convert the above comment to an answer, someone might use it in future :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
P.S. If my answer was helpful and worked, please, accept it as an answer to your question :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sure, convert it to answer..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.