To make database calls from ksh, simply use the following:
(**This example uses Sybase**)
#!/usr/bin/ksh -p
ISQL="PATH_TO_ISQL_COMMAND"
${ISQL}/isql -SSYBASE -U${ADMIN_NAME} -P${PASSWORD} <<-(EOF/DONE/something has to be here that isn't normally seen.)
DB Command
GO
(**Repeat as needed**)
EOF/DONE/SOMETHING/etc,etc
More of the script or exit at this point. Any database can be accessed this way, you simply have to know the syntax from the command line and then just type that into your script like you would anything else.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.