Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 10 of 11 total |
Feature request |
Mon, Feb 6 2012 7:21 AM | Permanent Link |
Lucian | Hi Tim,
Many times I need a handfull of stored procs in many databases if not all of them. And so I have to add the very same function or proc to every database and if there's a bug I have to fix it tons of times. Not sure how to define this but visually, in ElevateDB Manager, I could see another node under a session, between "Databases" and "Stores", called "Library" having two child nodes: "Procedures" and "Functions" .... where I one can drop some stuff which would be available in all databases. I hope this makes sense Regards, Lucian |
Mon, Feb 6 2012 7:28 AM | Permanent Link |
Lucian | CREATE FUNCTION "AddToken" (
IN "InputStr" VARCHAR COLLATE "UNI_CI", IN "DelimStr" VARCHAR COLLATE "UNI_CI", IN "TokenStr" VARCHAR COLLATE "UNI_CI") RETURNS VARCHAR COLLATE "UNI_CI" BEGIN DECLARE Result VARCHAR DEFAULT ''; IF InputStr = '' THEN SET Result = TokenStr; ELSE IF TokenStr = '' THEN SET Result = InputStr; ELSE IF DelimStr = '' THEN SET Result = InputStr + TokenStr; ELSE SET Result = InputStr + DelimStr + TokenStr; END IF; END IF; END IF; RETURN Result; END Sample of usage: AddToken('ABC', ', ', 'DEF') = 'ABC, DEF' AddToken('', ', ', 'DEF') = 'DEF' AddToken('ABC', ', ', '') = 'ABC' AddToken('', ', ', '') = '' |
Mon, Feb 6 2012 7:33 AM | Permanent Link |
Lucian | The above reply had a meaningfull subject line which does not show up when I use Internet Explorer. This post also has a meaningfull subject line that will not show up in Internet Explorer.
This why I still use XanaNews to read newsgroups regards Lucian |
Mon, Feb 6 2012 9:14 AM | Permanent Link |
Lucian | BTW, sorry I asked for this feature here ... I missed there was a ng only for this.
regards Lucian |
Mon, Feb 6 2012 9:42 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Lucian
I asked ages ago for session level functions but, given the architecture of ElevateDB, its difficult to see how Tim could make it work securely. The only place I can see he could put such things is in the configuration file and since you could (not at the same time) have the same database being accessed via different configuration files it could get messy. I wanted to share stuff between an in-memory and a disk database. My personal solution was a small procedure to copy the various functions / procedures across. Roy Lambert [Team Elevate] |
Mon, Feb 6 2012 10:04 AM | Permanent Link |
Lucian | >...have the same database being accessed via different configuration files it could get messy.
Ok, I can see that. Than perhaps that's where the "shared code" idea can help. For many years people asked Borland/Inprise to add new funcs/procs to their SysUtils unit and, in the end, many requests got there. Since these session level functions and procs would not have references to any tables or columns they ought to be inside EDB core code, string functions, numeric functions, etc. Stuff like: IsLeapYear, IsCurWeek, IsCurMonth, IsCurYear, IsLastWeek, IsLastMonth, IsLastYear, IsQ1/2/3/4/, IsFirstHalfOfYear. (I'll upload these shortly) CURRENT_DATE it's nice, but it's even nicer to see YESTERDAY's sales. regards Lucian |
Mon, Feb 6 2012 10:32 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Lucian
>Stuff like: IsLeapYear, IsCurWeek, IsCurMonth, IsCurYear, IsLastWeek, IsLastMonth, IsLastYear, IsQ1/2/3/4/, IsFirstHalfOfYear. (I'll upload these shortly) That will have to wait on Tim's decision. Some things I could support being in the core (especially things I want) but I also don't want to end up with something like Word or Excel where its big, bloated and I can't believe many people use a lot of its features. These days with three primary components (ElevateDB, WPTools, FastReport) and a project starts at 5Mb. I really don't want that start point much higher. Another thought has just occured. Have you looked at the external functions capability of ElevateDB yet? That could give you the single code base to maintain and all that's needed for each database is the links to the dll and the functions. Roy Lambert [Team Elevate] |
Mon, Feb 6 2012 11:21 AM | Permanent Link |
Lucian | >and a project starts at 5Mb. I really don't want that start point much higher.
hehehe ... my limit is a bit higher, about 10-12MB >Another thought has just occured. Have you looked at the external functions capability of ElevateDB yet? No, not yet. I'll give it a shot one of these days Lucian |
Mon, Feb 6 2012 1:26 PM | Permanent Link |
Adam Brett Orixa Systems | >Another thought has just occured. Have you looked at the external functions capability of ElevateDB yet?
External libraries are a very good place to "wrap" often used external processes. You can end up with a single DLL which contains a good number of functions in 1 place. Then you only have to CREATE EXTERNAL MODULE XXX in your new database and all the functions are immediately available. It means a bit of programming in Delphi to generate the DLL ... but once that is done its easy to transfer around. |
Mon, Feb 6 2012 1:45 PM | Permanent Link |
George | > Many times I need a handfull of stored procs in many databases if not all
> of them. And so I have to add the very same function or proc to every > database and if there's a bug I have to fix it tons of times. > Here's a workaround that I use: 1) Have the current database set to where the function is defined. 2) Call the function and if the parameters involve data from another database, prefix the tablename with the database name. Example: Table1 residing in Database1 AddToken Function defined in Database2 SQL Statements: Set Current database to Database2 and the following works select *, AddToken(SomeFieldInTable1) from Database1.Table1 However Setting the Current database to Database1 and the following DOES NOT WORK select *, Database2.AddToken(SomeFieldInTable1) from Table1 |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Sunday, May 19, 2024 at 08:46 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |