Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
Read a File |
Wed, Apr 22 2015 10:28 AM | Permanent Link |
Terry Swiers | Is there any way to read the contents of a text file in a EDB store into a
CLOB variable from within a procedure or job? I don't think there is, but I want to make sure that I'm not missing something before I create my own external function. --------------------------------------- Terry Swiers Millennium Software, Inc. http://www.1000years.com --------------------------------------- |
Wed, Apr 22 2015 11:06 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Terry
To the best of my knowledge ElevateDB does not provide that sort of functionality. Start writing. Roy Lambert |
Wed, Apr 22 2015 2:47 PM | Permanent Link |
Terry Swiers | Hi Roy,
> To the best of my knowledge ElevateDB does not provide that sort of > functionality. Start writing. Thanks. |
Sun, Apr 26 2015 1:10 PM | Permanent Link |
Ideal Software Systems | > Is there any way to read the contents of a text file in a EDB store into a
> CLOB variable from within a procedure or job? I don't think there is, but I > want to make sure that I'm not missing something before I create my own > external function. External function is probably the right way to go. Would be great for you to share it as well should you get the urge of generosity. |
Mon, Apr 27 2015 3:09 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ideal
>External function is probably the right way to go. Would be great for you to share it as well should you get the urge of generosity. Here's the simple version function LoadTextFile(fn, dir: string):string; var sl:TStringList; begin sl:=TStringList.Create; try if FileExists(IncludeTrainingPathDelimiter(dir)+fn) then begin sl.LoadFromFile(IncludeTrainingPathDelimiter(dir)+fn); Result := sl.Text; end else Result := 'WOOPS'; finally sl.Free; end; end; In procedure TEDBExternalModule.DoRoutine(const RoutineName: string); (in the template provided by Tim) ckn := LowerCase(RoutineName); .... .... if ckn = 'loadtextfile' then begin if ParamValues.FindByName('fn').Null then ParamValues.FindByName('Result').Null := True else ParamValues.FindByName('Result').AsString := LoadTextFile(ParamValues.FindByName('fn').AsString, ParamValues.FindByName('dir').AsString ); if ParamValues.FindByName('Result').AsString = '' then ParamValues.FindByName('Result').Null := True; end else ..... Typed without checking. You could do more like give the function the store name and let it look up the directory, but that would require instantiating a session, database, query inside the function to get the data from the config file. Adding the function into ElevateDB is easy - writing a complex function is as hard as anywhere else. Roy |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |