Home » SQL & PL/SQL » SQL & PL/SQL » How to use sysdate as a column header (Oracle 11g)
How to use sysdate as a column header [message #676867] Wed, 24 July 2019 07:49 Go to next message
chintan.patel
Messages: 159
Registered: July 2008
Location: Ahmedabad
Senior Member
Dear Friends,

Is there any other way to user sysdate as a column header in sql?

Thanks,
Chintan
Re: How to use sysdate as a column header [message #676868 is a reply to message #676867] Wed, 24 July 2019 08:22 Go to previous messageGo to next message
BlackSwan
Messages: 26733
Registered: January 2009
Location: SoCal
Senior Member
chintan.patel wrote on Wed, 24 July 2019 05:49
Dear Friends,

Is there any other way to user sysdate as a column header in sql?

Thanks,
Chintan

Other than what exactly?

It is less than intuitively obvious what exactly you desire as a column header. SHOW us what you want.
Re: How to use sysdate as a column header [message #676869 is a reply to message #676867] Wed, 24 July 2019 11:45 Go to previous messageGo to next message
Solomon Yakobson
Messages: 2985
Registered: January 2010
Location: Connecticut, USA
Senior Member
Column header is displayed by the tool you are using, not by SQL engine. For example, you can use predefined substitution variable _DATE, if you use SQL*Plus:

SQL> COLUMN DT HEAD "&&_DATE"
SQL> SELECT  'Check column header for today''s date' DT
  2    FROM  DUAL
  3  /

24-JUL-19
------------------------------------
Check column header for today's date

SQL> 

SY.
Re: How to use sysdate as a column header [message #676879 is a reply to message #676869] Wed, 24 July 2019 23:33 Go to previous messageGo to next message
chintan.patel
Messages: 159
Registered: July 2008
Location: Ahmedabad
Senior Member
Thank you Solomon Yakobson,

You derived result as i need, but i need to pass this query through java resultset so setting up column header which you advised is not feasible. Therefore, i requested sysdate in column header.

Thanks,
Chintan
Re: How to use sysdate as a column header [message #676880 is a reply to message #676879] Thu, 25 July 2019 00:34 Go to previous messageGo to next message
Michel Cadot
Messages: 67363
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

BlackSwan wrote on Wed, 24 July 2019 15:22
...
Other than what exactly?

It is less than intuitively obvious what exactly you desire as a column header. SHOW us what you want.
Re: How to use sysdate as a column header [message #676887 is a reply to message #676879] Thu, 25 July 2019 07:39 Go to previous message
Solomon Yakobson
Messages: 2985
Registered: January 2010
Location: Connecticut, USA
Senior Member
chintan.patel wrote on Thu, 25 July 2019 00:33

i need to pass this query through java resultset
What query? Post example.

SY.

Previous Topic: Case insensitive in oracle 12c
Next Topic: Select query took too long to execute on one schema but very little time on another scema
Goto Forum:
  


Current Time: Sun Sep 20 23:05:58 CDT 2020