in reply to Testing and database date functions
For example, Oracle's current date function is SYSDATE. If my perl script did something like:
why couldn't you change the perl script to get the day of the week from Oracle - something like this:my $dbh = DBI->connect(blah blah) or die "Can't connect: $DBI::errstr"; my $sth = $dbh->prepare("SELECT SYSDATE FROM DUAL") or die "Can't prepare: $DBI::errstr";
In Oracle sqlplus, doing "SELECT TO_CHAR(SYSDATE, 'DAY') AS DAY_OF_THE_WEEK FROM DUAL" produces this:my $sth = $dbh->prepare(qq{ SELECT TO_CHAR(SYSDATE, 'DAY') AS DAY FROM DUAL }) or die "Can't prepare: $DBI::errstr";
Isn't that what you're looking for?SQL> SELECT TO_CHAR(SYSDATE, 'DAY') AS DAY 2 FROM DUAL; DAY -------- THURSDAY
HTH.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Testing and database date functions
by relax99 (Monk) on Dec 09, 2004 at 20:01 UTC | |
by hmerrill (Friar) on Dec 10, 2004 at 13:06 UTC |