O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

25.5. Accessing databases

A common task among scripts is to access database systems to retrieve information. This type of process is ideal for here documents. You can do practically anything that you would normally do at the database prompt. This is not an exercise in databases, but to show you how here documents can be used to connect to other applications, and carry out tasks.

On one of our database systems the ‘select into’ gets turned off when the database is accessed from certain third party products. This means that certain databases cannot be used for any insertion of data or the creation of temporary tables.

To fix this problem a here document is used to connect into the database system, and a for loop will feed the here document with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required