Re : dbaccess syntax
Posted in 1997
Aaron Savage wrote:
> My problem however is that it was my understanding that you could call
> dbaccess with arguments to execute a query and have the results returned
> to you.
>
> we are running dbaccess <name_of_database> - SQL_QUERY
>
> Ive tried to keep the query as simple as possible (suchhe as select *
> from tablename) so I know its not an sql or wrongly phrased query. The
> problem is that the process doesnt run, it simply places me into the
> dbaccess prompt where I have to enter the query again.
Are you trying to do something like this :
<-----
#! /usr/bin/sh
# Script to show the user information
echo "---------------------------------------------------------"
echo "Show Registered User Information"
echo "---------------------------------------------------------"
# There are only 1 arguments :
if (test $# != 1) then
echo "Usage: show_user [mm/dd/yyyy]"
exit
fi
dbaccess your_db - << EOT!
SELECT userid,firstname,lastname,email,city,country FROM USER
WHERE DateRegistered > "$1"
EOT!
---->