Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 6 of 6 total |
It is possible to call a function from another database/schema? |
Wed, Jul 24 2013 5:14 PM | Permanent Link |
Mario Enríquez Open Consult | hi,
As you all know, it is possible to access objects from another databases in the following way: SELECT * FROM Database.Table1; However, I haven't found a way to the same with functions, since the following form throws an error: SET ret = Database.Function1(Param1, Param2); It this is possible, what would be the correct form? I've searched the documentation but haven't found an answer. Regards, Mario |
Thu, Jul 25 2013 6:50 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Mario
You can't. What you have to do is copy the functions from one database to the other. Have a look in the extensions newsgroup for a thread with the subject C;loning functions from disk to memory Roy Lambert [Team Elevate] |
Thu, Jul 25 2013 11:16 AM | Permanent Link |
Uli Becker | Roy,
it depends if you use a script and/or if you want to use the function in a statement or just getting a value into a variable. E.G.: SCRIPT BEGIN DECLARE MyValue VarCHAR; USE Dataset2; SET MyValue = MyFunction(MyParam); USE Dataset1; DoSomething with MyValue END Uli |
Thu, Jul 25 2013 11:31 AM | Permanent Link |
Mario Enríquez Open Consult | Actually, what I'm trying to achieve is using a function in another database to process some data in a local database.
Something along this form... SELECT Database1.fnCalcSomething(Table1.Field1) FROM Table1 I would look into the copy/clon approach. Regards, Mario |
Thu, Jul 25 2013 12:19 PM | Permanent Link |
Uli Becker | Mario,
ok, then Roy's approach is the best. Uli |
Thu, Jul 25 2013 1:12 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Mario
I've asked Tim for session level functions but its a tad difficult to see how to implement it since you can have multiple sessions (not simultaneously) pointing at the same database. Roy Lambert |
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |