Posted in 1998
Topics: Server Administration, Platform-Specific Issues
Remove the the first line , put the $1 in "" ....
this works fine
dbaccess eagle - <<EOF
select * from terminal where trans_date="$1"EOF
jjdai@hotmail.com wrote in article <6e7gqi$g94$1@nnrp1.dejanews.com>...
> Hi,
> I want to write a script (HP-UX), there is a sql statment to query data
> base , How can i trans the command line argument to sql statement?
>
> Example:
> tst.sh :
> export DBDATE=dmy4/> dbaccess dbname <<EOF
> select * from tbname where buy_date=$1
> EOF>
> run status : $> tst.sh "3/11/1998" result : no rows found
> $> tst.sh '3/11/1998' result : no rows found
> but it does not fit the actural.
> why???
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
>
We use strictly necessary cookies to make this site work. With your consent we’d also use optional cookies for analytics and marketing. You can accept all, reject all, or choose. Read our Cookie Policy.