Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use Database calls from ksh?

Tips and Tricks

How to use Database calls from ksh?

by  pmcmicha  Posted    (Edited  )
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.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top