Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 4 of 4 total |
Selecting just the current_date - have to specify table - why?? |
Tue, Jan 29 2008 5:17 PM | Permanent Link |
Damian Haynes | This has been killing me for days, but worked out how to get a current date from the server in a client/server scenario... you have to specify a table!!
select CURRENT_DATE as [date_now] from [dummy_table] top 1; Why do I have to specify a "from table_name" ? ... running version 4.25 of DBISAM. |
Tue, Jan 29 2008 7:50 PM | Permanent Link |
Sean McCall | The SQL standard as far as I know is that the "FROM" clause in a select
statement is not optional. It used to be (and probably still is) common practice in Oracle databases to create a dummy table (I've always seen it called "DUMMY") with one row so that SQL can be used to perform calculations to be returned in a result set. Damian Haynes wrote: > This has been killing me for days, but worked out how to get a current date from the server in a client/server scenario... you have to specify a table!! > > select CURRENT_DATE as [date_now] from [dummy_table] top 1; > > Why do I have to specify a "from table_name" ? ... running version 4.25 of DBISAM. > |
Tue, Jan 29 2008 9:57 PM | Permanent Link |
Damian Haynes | Thanks for the response. Not sure about MS SQL but I know in PostGreSQL you just do Select Current_Date so I got used to doing stuff like that.
I found a better solution off the session... session.GetRemoteDateTime. |
Wed, Jan 30 2008 2:32 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Damian,
<< Thanks for the response. Not sure about MS SQL but I know in PostGreSQL you just do Select Current_Date so I got used to doing stuff like that. I found a better solution off the session... session.GetRemoteDateTime. >> I was going to suggest that instead. A lot of the other database engines provide SELECT-only (no FROM) versions of certain scalar functions in order to allow them to work independent of the specific front-end compiler/IDE being used. Since DBISAM is primarily geared towards Delphi/C++Builder, it uses straight-up properties for these types of calls. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |