Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread DBISAM Custom Function -> ElevateDB
Wed, May 23 2007 10:51 AMPermanent Link

Heiko Knuettel
Hi !

I used DBISAM Custom SQL and Filter Functions very often, and not all of them can be translated to SQL/PSM. In the SQL
Manual Topic 'CREATE FUNCTION' there is a part "EXTERNAL NAME <ModuleName>"...is it meant to load a custom external
function module with that ?

And if so...is there a tutorial or demo showing how to create/install such a module ?

TIA,

Heiko
Wed, May 23 2007 12:55 PMPermanent Link

Heiko Knuettel
Sorry, just saw the related topic by Roy. Consider this one as answered Wink
Wed, May 23 2007 12:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Heiko,

<< I used DBISAM Custom SQL and Filter Functions very often, and not all of
them can be translated to SQL/PSM. In the SQL Manual Topic 'CREATE FUNCTION'
there is a part "EXTERNAL NAME <ModuleName>"...is it meant to load a custom
external function module with that ? >>

Yes, see this part of the manual:

http://www.elevatesoft.com/edb1sql_external_modules.htm

<< And if so...is there a tutorial or demo showing how to create/install
such a module ? >>

There is a template for creating external modules for functions/procedures
that is available from the Delphi Object Repository.  Unfortunately,
however, it is currently not working correctly in the 1.02 version.  The
1.03 version due out today will fix that issue.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, May 23 2007 2:12 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


I can make a good guess how to go about most of it. What I can't figure out is how to sort out the result since it looks (from EDBMan) as though you can have multiple OUT's unlike the DBISAM version

procedure TDM.CustomFilters(Sender: TObject; const FunctionName: string; FunctionParams: TDBISAMParams; var Result: Variant);

where it was easy to figure out what the Result was Smiley

Roy Lambert
Wed, May 23 2007 2:17 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


OK I've put my brain back into sync with the world and spotted the result page in EDBMan

Roy Lambert
Wed, May 23 2007 3:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I can make a good guess how to go about most of it. What I can't figure
out is how to sort out the result since it looks (from EDBMan) as though you
can have multiple OUT's unlike the DBISAM version >>

Yes, you can have Out or InOut parameters, but only for procedures.
Functions can have result parameters, however.

<< procedure TDM.CustomFilters(Sender: TObject; const FunctionName: string;
FunctionParams: TDBISAMParams; var Result: Variant);

where it was easy to figure out what the Result was Smiley >>

It's the same with an external module:

procedure TEDBExternalModule1.EDBExternalModuleRoutine(
 const RoutineName: String);
begin
  { Fill in the routine (function or procedure) execution code here.
    You can have multiple functions and/or procedures in a module.
    Use the RoutineName parameter to determine which function or
    procedure is being executed.  Use the public Params property of
    this external module (TParams object) to access the parameters to
    the function or procedure.  Do not modify the Params property other
    than to get/set the parameter values or Null flag.  Adding, removing,
    or changing the data type or parameter type of a parameter can cause
    serious problems. }
end;

The result parameter is called "Result" for functions. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, May 24 2007 2:50 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


I think this is one of those wonderful catch 22 things. I need to write the dll to allow myself to produce a function in EDBMan to see how to write the dll Smiley

However, a thought just occured to me "Is EDBMan clever enough to realise that the function I'm trying to create isn't in the dll?" I doubt it so I'll have a go later.

Roy Lambert
Sat, May 26 2007 6:10 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I think this is one of those wonderful catch 22 things. I need to write
the dll to allow myself to produce a function in EDBMan to see how to write
the dll Smiley >>

Ahh, not really.  You could just build a shell DLL that actually does
nothing, and it would work just fine as far as EDB is concerned.

<< However, a thought just occured to me "Is EDBMan clever enough to realise
that the function I'm trying to create isn't in the dll?" >>

No, it isn't.  In fact, you can literally have hundreds of functions in the
same DLL and EDB won't care which one is actually used - that's entirely up
to you in the DLL.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image