Subject | Re: [firebird-support] Need a little help with EXECUTE STATEMENT |
---|---|
Author | SoftTech |
Post date | 2013-01-10T20:49:42Z |
Greetings Martijn and Mark,
You're exactly right that fixed the problem.
Mark it also fixed this error
ISC ERROR CODE: 335544606
ISC ERROR MESSAGE:
expression evaluation not supported
Thanks to both of you for taking the time to respond,
Mike
You're exactly right that fixed the problem.
Mark it also fixed this error
ISC ERROR CODE: 335544606
ISC ERROR MESSAGE:
expression evaluation not supported
Thanks to both of you for taking the time to respond,
Mike
----- Original Message -----
From: Martijn Tonies
To: firebird-support@yahoogroups.com
Sent: Wednesday, January 09, 2013 8:14 AM
Subject: {Disarmed} Re: [firebird-support] Need a little help with EXECUTE STATEMENT
Hello Mike,
> DECLARE VARIABLE tsEndDate TimeStamp;
> begin
> tsEndDate = :V_END_DATE || ' 23:59:59';
>
>
> EXECUTE STATEMENT 'SELECT FIRST 1 D.CREATE_DATE
> FROM DEBT D
> WHERE D.CREATE_DATE <= ' || tsEndDate
> INTO :FIRST_CREATE_DATE;
>
> both caused this error.
>
> ISC ERROR CODE: 335544569
> ISC ERROR MESSAGE:
> Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 7, char 141
> 23
>
> What am I doing wrong? Any work arounds?
This ends up being (for V_END_DATE = 2013/1/09)
WHERE D.CREATE_DATE <= 9/1/2013 23:59:59
Do you see the problem? It becomes un-quoted...
Try:
WHERE D.CREATE_DATE <= ''' || tsEndDate || ''''
INTO ...
Where ''' = ' ' ' (with no spaces) and '''' = ' ' ' ' (with no spaces)
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
[Non-text portions of this message have been removed]