Home » SQL & PL/SQL » Client Tools » date display in report
date display in report [message #242802] Tue, 05 June 2007 03:10 Go to next message
lokhande.dinesh29
Messages: 36
Registered: May 2007
Member

Hi all,

here in the below code, i don't want select statement. So, my question is how can i replace select statement here..?

SET TERMOUT OFF
COLUMN curdate NEW_VALUE report_date
SELECT TO_CHAR(SYSDATE,'dd-Mon-yyyy') curdate
FROM DUAL;
SET TERMOUT ON /*Mechanism to fetch date*/

ttitle left report_date center "Permission Code report" right "Page" format 999 sql.pno

Output of above code like this:

05-Jun-2007 Permission Code report Page 1

Thanks & regards,
dinesh


Re: date display in report [message #242805 is a reply to message #242802] Tue, 05 June 2007 03:36 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Prefix your define variable with &:

ttitle left &report_date center "Permission Code report" right "Page" format 999 sql.pno

Regards
Michel
Re: date display in report [message #242806 is a reply to message #242805] Tue, 05 June 2007 03:37 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Isnt the OP asking
Quote:
i don't want select statement

Or have I missinturped the question ?
Re: date display in report [message #242825 is a reply to message #242802] Tue, 05 June 2007 04:18 Go to previous messageGo to next message
lokhande.dinesh29
Messages: 36
Registered: May 2007
Member
my question is i don't want to display sysdate, i just want to copy sysdate into report_date for diplay purpose.....
Re: date display in report [message #242826 is a reply to message #242825] Tue, 05 June 2007 04:21 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And I answered to the question.

Regards
Michel
Re: date display in report [message #242833 is a reply to message #242802] Tue, 05 June 2007 04:35 Go to previous messageGo to next message
lokhande.dinesh29
Messages: 36
Registered: May 2007
Member
i think my explanation was not correct...

according to ur answer : it is asking for date input at run time..

but what i want oracle implicity assign sysdate to report_date , not from user
Re: date display in report [message #242849 is a reply to message #242833] Tue, 05 June 2007 05:14 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
He doesn't ask it if you execute your:
SET TERMOUT OFF
COLUMN curdate NEW_VALUE report_date
SELECT TO_CHAR(SYSDATE,'dd-Mon-yyyy') curdate
FROM DUAL;
SET TERMOUT ON
before.

Regards
Michel
Re: date display in report [message #242860 is a reply to message #242849] Tue, 05 June 2007 05:42 Go to previous message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

By default the date and the time will appear if you just do a ttitle and do not qualify it (left ,center etc).

ex. (sorry for swedish output)

SQL> ttitle 'date is displayed'
SQL> select 'x' from dual;

Tis Jun 05                                                            sidan    1
                               date is displayed

'
-
x


SQL> ttitle left  'date is not displayed'
SQL>  select 'x' from dual;

date is not displayed
'
-
x



You have to do has Michel suggested if you want exactly the output you wrote in your first post.
Previous Topic: Default set setting....
Next Topic: SQL Plus 8.0
Goto Forum:
  


Current Time: Sat Dec 10 20:17:32 CST 2016

Total time taken to generate the page: 0.14225 seconds