ADSM-L

Re: SQL select and update command

2001-10-10 17:36:00
Subject: Re: SQL select and update command
From: Bill Colwell <bcolwell AT DRAPER DOT COM>
Date: Wed, 10 Oct 2001 17:24:45 -0400
I don't have a complete answer, but part of the solution
might be to do have the sql make a file that is ready (almost)
to be a macro file.  For example -

select 'update volume', volume_name, ' access=readwrite'
 from volumes
  where access != 'READWRITE'
   > c:\a_macro_file

The output will have the sql and headers and trailing text,
but if you do some editting script you can remove the garbage.

Then you can wrap it all up in a 3 step script;

1 dsmadmc (run the sql & quit)
2. edit the sql output
3. dsmadmc (run the macro & quit).

I do this process manually because I don't know the scripting
languages.

--
--------------------------
--------------------------
Bill Colwell
Bill Colwell
C. S. Draper Lab
Cambridge, Ma.
bcolwell AT draper DOT com
--------------------------
In <Pine.LNX.4.32.0110101353420.27856-100000 AT bread.anim.dreamworks DOT com>, 
on 10/10/01
In <Pine.LNX.4.32.0110101353420.27856-100000 AT bread.anim.dreamworks DOT com>, 
on 10/10/01
   at 05:24 PM, "Thomas A. La Porte" <tlaporte AT ANIM.DREAMWORKS DOT COM> said:

>Mark's response answers the specific case of the original
>question quite well, but I'm curious if anyone knows if there is
>a general solution to the question.

>Having not upgraded any of our production servers past 3.1, I
>only recently began looking at the rudimentary scripting that was
>added with TSM and I wanted to do exactly this type of operation:
>run a query, and use the result of the query in a subsequent
>operation. I couldn't find any way that this was possible, and
>ultimately had to abandon what I wanted to do and instead wrote a
>(very redundant) 100 line macro file.

>Just curious if anyone else has a generalized solution to the
>problem at hand.

> -- Tom

>Thomas A. La Porte
>DreamWorks SKG
>tlaporte AT anim.dreamworks DOT com

>On Wed, 10 Oct 2001, Mark Stapleton wrote:

>>On Tue, 2 Oct 2001 11:06:31 -0400, it was written:
>>>Could someone give me an example how to do a select and then run command
>>>against the select reqult? For example, I want:
>>>
>>>Select volume_name from volumes where access!='READWRITE'
>>>then
>>>update volume the_result_from_select access=readwrite.
>>
>>Easy.
>>
>>        upd vol * stg=<storage_pool_name> access=readwrite
>>
>>--
>>Mark Stapleton (stapleton AT berbee DOT com)
>>
>>
<Prev in Thread] Current Thread [Next in Thread>