Home » Infrastructure » Unix » Problem in Reading date from command line.
Problem in Reading date from command line. [message #109249] Wed, 23 February 2005 00:23 Go to next message
Naveen Verma
Messages: 60
Registered: August 2004
Member
Hi
My requirement is to read date as a command line argument, then store in a variable and export it.
Then I have to use that variable in sql query to filter data according to that date.
But when I try to store the command line argument in a variable it is showing some error. Please help me to solve it with some example.

Thanks and Regards
Raju
Re: Problem in Reading date from command line. [message #109275 is a reply to message #109249] Wed, 23 February 2005 08:39 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
what kind of problem?
This simple script works for me
<pre>bash-2.03$ q 28-SEP-81

ENAME JOB SAL HIREDATE
---------- --------- ---------- ---------
SCOTT ANALYST 3000 09-DEC-82
KING PRESIDENT 5000 17-NOV-81
ADAMS CLERK 1100 12-JAN-83
JAMES CLERK 950 03-DEC-81
FORD ANALYST 3000 03-DEC-81
MILLER CLERK 1300 23-JAN-82

6 rows selected.

bash-2.03$ cat q
sqlplus -s mag/mag <<EOF
select ename,job,sal,hiredate from emp where hiredate > '$1';
exit
EOF
Previous Topic: Urgent help
Next Topic: Oracle 80522 in HP-UX 11
Goto Forum:
  


Current Time: Fri Apr 19 00:43:28 CDT 2024