ADSM-L

Re: [ADSM-L] Output manipulation on selects

2009-03-26 07:45:14
Subject: Re: [ADSM-L] Output manipulation on selects
From: Andrew Raibeck <storman AT US.IBM DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 26 Mar 2009 07:43:08 -0400
Try storing the command in a file, then running it as a macro. For example,
put the following in a file called tsm.macro:

select 'update thosts set tsm=''T'' where host_name=''' || node_name ||
''';' from nodes

Then run it like this:

dsmadmc -id=adminid -pa=xxxxx -commadelimited -dataonly=yes macro tsm.macro

Note: using -commadelimited forces the output to one line per record
without having to us the AS "SQL STATEMENT" part. And -dataonly=yes
suppresses all the header information so you get only your output records.

Best regards,

Andy

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Product Development
Level 3 Team Lead
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: storman AT us.ibm DOT com

IBM Tivoli Storage Manager support web page:
http://www.ibm.com/software/sysmgmt/products/support/IBMTivoliStorageManager.html


The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.

"ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU> wrote on 03/25/2009
12:15:20 PM:

> [image removed]
>
> Output manipulation on selects
>
> Ullrich Mänz
>
> to:
>
> ADSM-L
>
> 03/25/2009 12:20 PM
>
> Sent by:
>
> "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
>
> Please respond to "ADSM: Dist Stor Manager"
>
> Hi SQL specialists,
>
> we have found a completely different behaviour when executing TSM SQL
> statements on different platforms. The basic idea is to produce SQL
> statements as an input for our analysing tool with its own (Orcale)
> database.  Our select statement (simplyfied example) and output looks as
> follows - the "picture" ist taken from a Windows client:
>
> tsm: SERVER1>select 'update thosts set tsm=''T'' where host_name =''' -
> cont> || node_name || ''';' as -
> cont> "SQL Statement                                                 " -
> cont> from nodes
>
> SQL Statement
> --------------------------------------------------------------
> update thosts set tsm='T' where host_name ='AD-TEST';
> update thosts set tsm='T' where host_name ='BETTY';
> update thosts set tsm='T' where host_name ='W2K3TSM';
>
> It doesn't matter if the client is connected to a Windows or Linux TSM
> server installation. However, executing that select statement on a  Linux

> host, we get the SQL error as listed below:
>
> ANR2906E Unexpected SQL literal token - 'T'.
>
>                                          |
>          ................................V..............................
>          select 'update thosts set tsm=' 'T' ' where host_name =' '' ||
>
> ANS8001I Return code 3.
>
> Any idea whats going wrong here? Or, how to set up the SQL statement on a

> Linux host?
>
> Client versions  tested:
> Windows:        5.4.1.6 and 5.5.1.6
> Linux:          5.4.1.0 and 5.5.1.0
>
> TSM servers:
> Windows:        5.5.1.0
> Linux:          5.1.5.0 (x86) and 5.3.4.0 (ppc64)
>
> Best regards
>
> Ullrich Mänz
> System-Integration
>
> FRITZ & MACZIOL Software und Computervertrieb GmbH
> Ludwig Str. 180D, 63067 Offenbach, Germany
>
> Telefon:
> +49 69 38013500 15
> Mobil:
> +49 170 7678434
> Fax:
> +49 69 38013500 10
> Web:
> http://www.fum.de
>
> Amtsgericht Ulm, Handelsregister-Nummer: HRB 1936
> Geschäftsführer: Heribert Fritz, Oliver Schallhorn, Frank Haines
> Inhaber: Imtech N.V., Gouda, Niederlande
> Referenzen finden Sie auf unserer Website, Rubrik 'News'.
> For References, please click our website, button 'News'.
> Mail powered by Lotus Notes Version 7
<Prev in Thread] Current Thread [Next in Thread>