BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PostgreSQL: select (extract(epoch from (bt.endtime - bt.star

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Michael Fullerton
Guest





PostPosted: Wed Jun 07, 2006 8:33 pm    Post subject: PostgreSQL: select (extract(epoch from (bt.endtime - bt.star Reply with 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.

___
Free Project Time Tracker for Delphi Developers
http://www.cybermatrix.com/pcdelphi.html
Back to top
Ray Marron
Guest





PostPosted: Wed Jun 07, 2006 9:21 pm    Post subject: Re: PostgreSQL: select (extract(epoch from (bt.endtime - bt. Reply with quote



"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





PostPosted: Thu Jun 08, 2006 12:01 am    Post subject: Re: PostgreSQL: select (extract(epoch from (bt.endtime - bt. Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.