Home » U++ Library support » U++ SQL » Call external funcions in SQL
Re: Call external funcions in SQL [message #40747 is a reply to message #40745] |
Thu, 12 September 2013 19:23 |
|
koldo wrote on Thu, 12 September 2013 18:37 | Hello all
I wanted to ask you how to call an external function from SQL.
For example, doing:
SQL & ::Select(SqlAll()).From(TABLE).Where(DATE < GetSysTime()));
in the SQL it will always appear the origonal time, so if I call the query one hour later, the time will remain.
What I would need is that GetSysTime() were called every time the query is called.
|
Hi Koldo,
If you use the query as you posted it should evaluate the GetSysTime() each time you call it. The only problem might be if you stored the query for later or multiple execution. I mean something like:SqlSelect sel = Select(SqlAll()).From(TABLE).Where(DATE < GetSysTime());
// .. and one hour later or in some function
SQL & sel;
SQL.Fetch();
If you do that, than the easiest way would be to either create the query each time just before executing.
If I misunderstood something about the problem, please post bit more of the code, so I can get better idea what is the problem.
Also, if you really need what the title says, I'm not aware how to call user defined C++ functions in Sql, unless it is SQLite. If you are interested in that, I can post couple examples But it should not be necessary for you, judging by the example code you posted.
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Sun May 19 02:19:02 CEST 2024
Total time taken to generate the page: 0.00577 seconds
|