ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » call sql server function is passthru statement

Post new topic  Reply to topic
 call sql server function is passthru statement « View previous topic :: View next topic » 
Author Message
AmolItankar
PostPosted: Fri Mar 17, 2006 3:58 am    Post subject: call sql server function is passthru statement Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Fri Mar 17, 2006 9:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Moving to the right forum.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JT
PostPosted: Fri Mar 17, 2006 12:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
klabran
PostPosted: Mon Mar 20, 2006 12:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » call sql server function is passthru statement
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.