cancel
Showing results for 
Search instead for 
Did you mean: 

Invoking stored procedure through iCommand

Former Member
0 Kudos

I have a stored procedure in oracle that i'd like to call. If I set my query type to command and do this:

call ProcedureName('[Param.1]')

it works fine

When I invoke it through iCommand, it seems to insert a semicolon at the end, and then I get an invalid character error.

What is the right way to call the stored procedure? Should its type be command or something else?

Edited by: apnahas on Oct 9, 2009 10:00 PM

Accepted Solutions (1)

Accepted Solutions (1)

sidnooradarsh
Contributor
0 Kudos

Hi,

As per MII best practices use icommand for any inserts, deletes and update queries.

Yes, you are right with the syntax for calling the SP

CALL Procedure_Name('[Param.1]')

make sure their is no semicolon at the end of statement.

Since your are combining all the data into one string make sure that you escape any single quote(') within the string from javascript else again the icommand will fail.

Just try clearing all the cache, cookies and offline temp data if changes are not reflected.

If you are still getting some error then please post the exact error your getting.

Hope this helps!!

Regards,

Adarsh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

View this link

Hope this help...

Danilo

Former Member
0 Kudos

Code is:


  cmdApp.setQueryTemplate("tempName");
  var queryObj = cmdApp.getQueryObject();

  queryObj.setParam(1,"NAHASAN;254,5,2008,1,2012,5");
  cmdApp.executeCommand();

 In query template editor:
 As a Command Query
 CALL PROC('[Param.1]')

In the query template editor, it works if I set Param.1 to NAHASAN;254,5,2008,1,2012,5

But not from javascript

Also:

In the Log it shows this:

ERROR Connector Error in command: CALL PROC(' NAHASAN;254,5,2008,1,2012,5');

Former Member
0 Kudos

In your query template, remove the single quotes.



CALL PROC([Param.1])

Former Member
0 Kudos

Doesn't seem to work, says invalid command

Former Member
0 Kudos

Could be something in your javascript? Post some of your code and that will help.