December 19, 2011 at 12:42 pm
How would I use getdate() in a sql query where the table is a oracle linked table? Thanks in advance for all your help.
Mike
December 19, 2011 at 12:49 pm
SYSDATE is the equivilent in oracle;
SELECT SYSDATE FROM DUAL; for example.
Lowell
December 19, 2011 at 12:54 pm
I'm running the query from my ms sql server database where the linked server table is an Oracle table.
December 19, 2011 at 1:01 pm
Thanks, it worked... How would I format the result to like like for example 20111219?
My select stmt is as follows:
Select SYSDATE
, LCO
, TMC
From lnkOracle_Table
Again, thanks for all your help...
Mike
December 19, 2011 at 1:07 pm
oracle has a suite of TO_* functions. TO_DATE and TO_CHAR for example, but i'm thinking this is going to be done on SQl, since you are really pulling the table into tempdb and then doing SLq stuff to it:
--ora side
SELECT TO_CHAR(SYSDATE,'YYMMDD')
, LCO
, TMC
From lnkOracle_Table
--sql side
SELECTCONVERT(varchar,datecolumn,112)
, LCO
, TMC
From lnkOracle_Table
Lowell
December 19, 2011 at 1:18 pm
That did the trick!!!! Again, thanks for all your great help.
Mike
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply