 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Michael Fullerton Guest
|
Posted: Wed Jun 07, 2006 8:33 pm Post subject: PostgreSQL: select (extract(epoch from (bt.endtime - bt.star |
|
|
Delphi 5, Zeos
The following SQL works fine in PostgreSQL query tool but not in my
Delphi/PostgreSQL app. It complains the :: is a syntax error.
select (extract(epoch from (bt.endtime - bt.starttime)) /
3600.0::float) * p.rate as cost from btimes bt join people p
on(bt.person = p.person)
Any ideas? Thanks in advance.
___
Free Project Time Tracker for Delphi Developers
http://www.cybermatrix.com/pcdelphi.html |
|
| Back to top |
|
 |
Ray Marron Guest
|
Posted: Wed Jun 07, 2006 9:21 pm Post subject: Re: PostgreSQL: select (extract(epoch from (bt.endtime - bt. |
|
|
"Michael Fullerton" <fullerm@spamkiller-remove.cyber-matrix.com> wrote in
message news:a6sd82lq9fp2c6j0e3qtq8fqj1ficmf0qh (AT) 4ax (DOT) com...
| Quote: | Delphi 5, Zeos
The following SQL works fine in PostgreSQL query tool but not in my
Delphi/PostgreSQL app. It complains the :: is a syntax error.
select (extract(epoch from (bt.endtime - bt.starttime)) /
3600.0::float) * p.rate as cost from btimes bt join people p
on(bt.person = p.person)
Any ideas? Thanks in advance.
|
Try "CAST(3600.0 AS float)" instead. The :: notation is a PostgreSQL-only
extension, noted as "historical usage" in the 8.1 docs. It may also
conflict with parameter parsing - if you don't need them, you could also try
setting the ParamCheck property to False and see if it works.
--
Ray Marron |
|
| Back to top |
|
 |
Johann Campbell Guest
|
Posted: Thu Jun 08, 2006 12:01 am Post subject: Re: PostgreSQL: select (extract(epoch from (bt.endtime - bt. |
|
|
I had this problem, you have double the colons so you should have '::::',
that solved my problem.
Johann.
"Ray Marron" <me (AT) privacy (DOT) net> wrote in message
news:4486fcee (AT) newsgroups (DOT) borland.com...
| Quote: | "Michael Fullerton" <fullerm@spamkiller-remove.cyber-matrix.com> wrote in
message news:a6sd82lq9fp2c6j0e3qtq8fqj1ficmf0qh (AT) 4ax (DOT) com...
Delphi 5, Zeos
The following SQL works fine in PostgreSQL query tool but not in my
Delphi/PostgreSQL app. It complains the :: is a syntax error.
select (extract(epoch from (bt.endtime - bt.starttime)) /
3600.0::float) * p.rate as cost from btimes bt join people p
on(bt.person = p.person)
Any ideas? Thanks in advance.
Try "CAST(3600.0 AS float)" instead. The :: notation is a PostgreSQL-only
extension, noted as "historical usage" in the 8.1 docs. It may also
conflict with parameter parsing - if you don't need them, you could also
try setting the ParamCheck property to False and see if it works.
--
Ray Marron
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|