|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
call sql server function is passthru statement |
« View previous topic :: View next topic » |
Author |
Message
|
AmolItankar |
Posted: Fri Mar 17, 2006 3:58 am Post subject: call sql server function is passthru statement |
|
|
Newbie
Joined: 14 Mar 2006 Posts: 1
|
hello there,
I am trying to use following esql code to fill one of my array.
OutputRoot......[] = PASSTHRU('SELECT INTERNALID AS ID FROM dbo.getId(?,?), CAST(externalvalue AS INT) , externalcode');
AFTER EXECUTING THIS STATEMENT,IT IS GIVING ME ODBC SQL SERVER DRIVER ERROR.Invalid parameter number.
I have passed the right number of parameter with proper datatype. The dsn also looks OK to me in the compute node.
Can somebody help me in this mater. |
|
Back to top |
|
 |
vennela |
Posted: Fri Mar 17, 2006 9:39 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Moving to the right forum. |
|
Back to top |
|
 |
JT |
Posted: Fri Mar 17, 2006 12:55 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Haven't worked with SQLServer functions, but here's how we call functions in Oracle:
Code: |
SET Environment.Variables.XML.TLA.Response[] =
PASSTHRU('SELECT PRODUCTSA.psa_productcentralxml_pkg.getAllDCProducts_XML(?,?) DATA FROM DUAL',distChannel,sellArrangement); |
Where:- PRODCUTSA is the Database name,
- psa_productcentralxml_pkg is the name of the package
- getAllDCProducts_XML is the name of the function
Based on the syntax of the command we issue, minimally I would think your statement would have to change as such:
Code: |
PASSTHRU('SELECT INTERNALID AS ID FROM dbo.getId(?,?)', CAST(externalvalue AS INT) , externalcode'); |
|
|
Back to top |
|
 |
klabran |
Posted: Mon Mar 20, 2006 12:33 pm Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
This is how we call a SP in SQL Server:
Code: |
SET Environment.Variables.Code[] = PASSTHRU('{call spZipCodeWStateConfirm(?,?)}',SUBSTRING(refCiteOut.Addresses.Address[intCntr].AddressPostalCodeIdentifier FROM 1 FOR 5),refCiteOut.Addresses.Address[intCntr].AddressStateCode);
|
You then reference the values in the .Code[] by name based on your alias or table field name....
Environment.Variables.Code.zip_code where zip_code is the table field name or alias in the SQL.
Also I found that SP's that have default value's will cause a "function sequence error" in the esql. I pulled default value's out of the SP and the ESQL worked. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|