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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL within a UNIX (AIX) script

Status
Not open for further replies.

ianholmes

Programmer
Mar 24, 2001
61
GB
I have written a UNIX menu script, accessing a Sybase database.
It gives the user many options, one of which is as follows :-
a. The user enters a reference number, and one or more entries for that reference are returned on the screen from a table, preceded with an incremental counter.
b. The user then enters the numbers he wants to update,
c. and I then re-display those selected.
d. I then update these records.

I do this as follows :

a. From UNIX the user enters his value.
Within SQL, I get the records, creating a VIEW, and displaying them all (1 thru 5, say), with the counter.
b. Back to UNIX, the User enters the numbers he wants (2 and 5, say)
c. I go back into SQL, and update my VIEW, dropping 1, 3, and 4
d. Still in SQL, the 2 remaining records are updated.

This works OK in a testing environment, but going live, I find I do not have UPDATE privileges for my VIEW.
Nor will I be granted them by the DBA.

How can I re-write this functionality ?

Substituting the VIEW with a temporary table doesn’t work, as it is lost when the first SQL session ends.

Ideally, I want to get 2 and 5 entered, within the SQL session.
I could then use the temporary table approach.
 
Do you really need a view? Can't you have a script performing the same SELECT as the view? (I don't know Sybase at all, and not much about Unix... So my answer may be pretty stupid.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top