cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8959
Views
10
Helpful
15
Replies

UCCX Call to a MS SQL Stored Procedure in DB Read or Java?

joshuamarsh
Level 1
Level 1

Hello,

I'm running UCCX Premium 7.x.  I am trying to call a stored procedure from a DB Read step in a CCX script.  The stored procedure takes a few variables and inserts a row into a table.  From the SQL Query Analyzer, I can run a simple, "EXECUTE myStoredProcedure 'variable1' , 'variable2'."  So I assumed that I could do the same in a DB Read step, "EXECUTE myStoredProcedure $variable1 , $variable2."  However, this does not work.  Although it will correctly update the table when hitting the test button in the editor, it returns a "Remote Error: java.lang.NullPointerException" error which causes the script to error out when actually running it.  This doesn't appear to be a value I can select in an On Exception step either to keep moving forward in the script.  Is there something wrong in my syntax, or another way to pull this off?

If not, do any of you Java wizards out there have a snippet from a Do Step where you do an ODBC connection and run a bit of SQL?

Thanks much!

Joshua

15 Replies 15

All good now.  Pilot error.  I was using a login that didn't have privileges to execute a stored procedure.

Advice on this thread was helpful.  FWIW, I don't seem to need to declare and return anything.  A single EXECUTE statement does the trick.

-David