Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread External function and memory database
Mon, Jul 28 2008 5:15 AMPermanent Link

Heiko Knuettel
Hi,

at application startup, I open a disk- and a memory database, and then copy the stored
functions from the disk database to the memory database, so that I can use them later in
the memory database context e.g. for a "create table as...".

That works fine with internal SQL/PSM functions.

But when using an external function, in this case flagset(value, flagno: Integer):Boolean,
a simple function that just checks if a bit in a integer is set, I have some trouble.

When executing the query "select * from diskdb.table where flagset(flags, 2)=false" in the
disk database context (DataBaseName := 'disk'), I get the correct result set.

But when executing the same query (with the diskdb qualifier) in the memory database
context, I get an empty result set.

Looks like a bug...

Heiko
Mon, Jul 28 2008 5:49 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Heiko


Two things

1. can you post the function
2. Have you tried it in EDBManager?

Roy Lambert [Team Elevate]
Mon, Jul 28 2008 7:03 AMPermanent Link

Heiko Knuettel
Roy,

The error shows in EDBManager. I could provide a sample project also, that is, if Tim
doesn't see anything at first look.

The external function is :

procedure TEDBExternalModule1.EDBExternalModuleRoutine(const RoutineName: String);
begin
  if ansiuppercase(RoutineName)='FLAGSET' then
     Params.ParamByName('result').AsBoolean :=
        flagset(Params.ParamByName('intval').AsInteger,
                Params.ParamByName('flag').AsInteger);
end;

function TEDBExternalModule1.flagset(intval, flag: Integer): Boolean;
begin
  result := (intval and (1 shl flag))<>0;
end;

FUNCTION "FLAGSET" (IN "intval" INTEGER, IN "flag" INTEGER)
RETURNS BOOLEAN
EXTERNAL NAME "extmodule"


Heiko
Mon, Jul 28 2008 4:30 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Heiko,

<< But when executing the same query (with the diskdb qualifier) in the
memory database context, I get an empty result set. >>

I'll check it out for 2.01 B2.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image