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 » Passthru and stored functions

Post new topic  Reply to topic
 Passthru and stored functions « View previous topic :: View next topic » 
Author Message
gisly
PostPosted: Wed Jun 27, 2012 4:46 am    Post subject: Passthru and stored functions Reply with quote

Apprentice

Joined: 10 May 2012
Posts: 29

Hi!
I have got the following issue:
we have a stored procedure in an Oracle Database which has timestamp as an input parameter. We used to call it using "external", not "passhtru", and it worked, but it then turned out, that there was a problem with milliseconds dropped when data transferred to Oracle (the problem is also mentioned here :http://www.mqseries.net/phpBB2/viewtopic.php?t=55349&sid=6a61311af4c6e64b365d136ee744a907)
We don't want to mess with the stored function itself (as it was provided by another company), so we decided to use "Passhru". But I can't understand which syntax should be used:
if I use
Code:
set myRes=PASSTHRU('call function_name(
               ?,
                                         ?
               )'
               TO Database.SCHEMA
               VALUES(arg1, arg2))

I get an error: Invalid function name (and I suppose it's connected with the absence of return value)
If is use
Code:
set myRes=PASSTHRU('select function_name(
               ?,
                                         ?
               ) from DUAL'
               TO Database.SCHEMA
               VALUES(arg1, arg2))

I get an error within the function itself (because inserts are used there, and they can't be executed within 'select')
I have tried lots of other options (to declare a variable and to call the function into it, to call the function using the schema prefix etc) but none worked.

Has anyone ever tried to use passthru with a stored function in Oracle?
Or should we try to find a different solution?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jun 27, 2012 5:45 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Your post is very confusing. You have twelve different thoughts all jumbled together. Try posting a reply that draws the focus to a single issue. Just reading your post makes my head hurt. Simplify.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Jun 27, 2012 7:28 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

I suspect that as it is a function rather than a procedure, Oracle would want you to use the {?=CALL(?,?)} ODBC escape syntax. However, one of the limitations of PASTHRU is that is cannot be used with OUT or INOUT parameters and I think this will also include the return value as well...
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jun 27, 2012 8:37 am    Post subject: Re: Passthru and stored functions Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

gisly wrote:
Has anyone ever tried to use passthru with a stored function in Oracle?


Quote:
The main use of the PASSTHRU statement is to issue administrative commands to databases (for example, to create a table).
Note: Do not use PASSTHRU to call stored procedures; instead, use the CALL statement because PASSTHRU imposes limitations (you cannot use output parameters, for example).


http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fak05100_.htm

gisly wrote:

Or should we try to find a different solution?

Yes

You can try changing the stored procedure or function (still not clear from your post on this).
Back to top
View user's profile Send private message Send e-mail
gisly
PostPosted: Wed Jun 27, 2012 9:34 pm    Post subject: Reply with quote

Apprentice

Joined: 10 May 2012
Posts: 29

The question is: has anyone used a stored FUNCTION (not a procedure) with PASSTHRU? If so, what is the syntax like? I have tried several variants (using just CALL, using SELECT FROM DUAL) and none worked.

As I guess from the replies, the answer is NO.

Thanks for your answers!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Passthru and stored functions
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.