Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

working with date variables

Status
Not open for further replies.

TheStandard

Programmer
Mar 9, 2004
12
US
Is it possible to initialize a variable of type date in a PL/SQL block to one week from today?

Is it even possible to initialize a date variable to the current date without explicitly specifying the current date?
 
Stan,

Code:
declare
    dt date := sysdate;
begin
    dbms_output.put_line('Today is '||dt);
end;
/

Today is 20-MAY-05

PL/SQL procedure successfully completed.
I am not sure I understand what you are trying to ask here:
TheStandard said:
Is it even possible to initialize a date variable to the current date without explicitly specifying the current date?

What are you trying to avoid and what would you like to see?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)

Do you use Oracle and live or work in Utah, USA?
Then click here to join Utah Oracle Users Group on Tek-Tips.
 
Oh, sorry, I didn't realize you could do that.

sysdate isn't in the index of the book I'm using?

What book would you recommend for PL/SQL?
 
If you go out to Amazon.com and query for "PL/SQL", the titles of the books will generally give guidance as to the most appropriate for your needs. I have found that the "Oracle Press" series of books (not affiliated with Oracle Corporation) is a safe bet.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)

Do you use Oracle and live or work in Utah, USA?
Then click here to join Utah Oracle Users Group on Tek-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top