Re: selecting into unix variable

From: RSpencer <rspencer_at_aol.com>
Date: 1995/10/17
Message-ID: <4601u4$a3q_at_newsbf02.news.aol.com>#1/1


The way I do this in a Unix script is as follows:

set unix_var=`sqlplus ${user}/${pw} _at_sql_file -s`

Of course you have to use the sql_file has to have set statements in it that turn off headings, underline, etc. as well as the SQL select statement to retrieve the sequence number. You don't have an "into" clause. That way only a single value will be loaded into your Unix variable.

In your delete script you can run SQL*Plus and pass it the sequence number. Change your delete statement as follows:

   delete from table_name
     where sequence = &1;

Use the following to run the delete using a positional variable:

sqplus ${user}/${pw} _at_delete_script $unix_var -s Received on Tue Oct 17 1995 - 00:00:00 CET

Original text of this message