Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 18th, 2012, 01:11 AM
rforrose rforrose is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2012
Posts: 1 rforrose User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 10 sec
Reputation Power: 0
Variable arguments

Hi,
I am a newbie to SQL. I need to know a way in which I can pass variable arguments to UDF? Below is the sample code:

for execute statement:str
into :val1, :val2
do begin
fill(:val1, :val2)
end

Here its obvious that only 2 values are passed to UDF 'fill', but if there are more arguments (that depends on the execute statement, like val1, val2, val3 etc) then how do I pass these into UDF? Please help.

Thanks

Reply With Quote
  #2  
Old January 19th, 2012, 11:38 PM
costin_mentor costin_mentor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 31 costin_mentor User rank is Lance Corporal (50 - 100 Reputation Level)costin_mentor User rank is Lance Corporal (50 - 100 Reputation Level)costin_mentor User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 13 h 12 m 34 sec
Reputation Power: 7
One solution will be do pass to the UDF only one string parameter that will contain all your values you want to send. Something like this:

cparatemerTosend = cast (val1 as varchar(50))||','||cast (val2 as varchar(50))||','||cast (val3 as varchar(50)).....

fill(cparameterToSend)

In this way you transfer the job to identify the parameters to the UDF.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Variable arguments

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap