Board index » delphi » Function with parameter

Function with parameter


2008-04-22 02:49:32 AM
delphi9
Hi
I have a function that i called this way:
select GetWeekdays(current_date, current_date, 0) from......
The function is defined as
function GetWeekdays(Today: PISC_QUAD;
Date1: PISC_QUAD;
var WorkDaysOnly : Integer): integer; cdecl; export;
Now i want to be 'current_date' a variable
But if i use
select GetWeekdays(:currentdate1, :currentdate1, 0 ) from
and fill parameter :currentdate as TDate
IbDataset2.ParamByName('currentdate1').asDate := Date;
i get a Dynamic SQL Error, Data type unknown
What goes wrong?
running IB2007 /Delphi 2007 using IBX
Eric
 
 

Re:Function with parameter

Eric ten Westenend writes:
Quote
But if i use

select GetWeekdays(:currentdate1, :currentdate1, 0 ) from
and fill parameter :currentdate as TDate

IbDataset2.ParamByName('currentdate1').asDate := Date;

i get a Dynamic SQL Error, Data type unknown

What goes wrong?
IB doesn't support UDF arguments with params, AFAIK.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
IB 6 versions prior to 6.0.1.6 are pre-release and may corrupt
your DBs! Open Edition users, get 6.0.1.6 from mers.com
 

Re:Function with parameter

Hi
Ok, i understand.
Do you see any way to let this work?
Eric
"Craig Stuntz [TeamB]" <XXXX@XXXXX.COM [a.k.a. acm.org]>schreef
in bericht news:480ce358$XXXX@XXXXX.COM...
Quote
Eric ten Westenend writes:

>But if i use
>
>select GetWeekdays(:currentdate1, :currentdate1, 0 ) from
>and fill parameter :currentdate as TDate
>
>IbDataset2.ParamByName('currentdate1').asDate := Date;
>
>i get a Dynamic SQL Error, Data type unknown
>
>What goes wrong?

IB doesn't support UDF arguments with params, AFAIK.

--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
IB 6 versions prior to 6.0.1.6 are pre-release and may corrupt
your DBs! Open Edition users, get 6.0.1.6 from mers.com
 

Re:Function with parameter

Eric ten Westenend writes:
Quote
Do you see any way to let this work?
If currentdate1 is the current date, then use the system function
CURRENT_DATE as the argument.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
All the great TeamB service you've come to expect plus (New!)
Irish Tin Whistle tips: learningtowhistle.blogspot.com
 

Re:Function with parameter

Eric ten Westenend writes:
Quote
Do you see any way to let this work?
Construct the SQL statement on the fly and use values for the UDF
parameters instead of using SQL parameters.
--
Bill Todd (TeamB)