ADSM-L

Re: [ADSM-L] Output manipulation on selects

2009-03-26 03:45:36
Subject: Re: [ADSM-L] Output manipulation on selects
From: BEYERS Kurt <Kurt.BEYERS AT VRT DOT BE>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 26 Mar 2009 08:44:42 +0100
Ullrich,

When you have an sql statement that either contains single or double quotes, it 
is better to save it first into a file (eg /tmp/sql.scr).

And define afterwards a script in TSM that uses the file as input:

Tsm: TSMSERVER> def scr sql_statement file=/tmp/sql.scr

Than you can execute it as:

TSM: TSMSERVER> run sql_statement

It makes it more easy to repeat the statement later on as well ;-)

Best regards,
Kurt

-----Oorspronkelijk bericht-----
Van: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] Namens 
Ullrich Mänz
Verzonden: woensdag 25 maart 2009 17:15
Aan: ADSM-L AT VM.MARIST DOT EDU
Onderwerp: [ADSM-L] Output manipulation on selects

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
*** Disclaimer ***

Vlaamse Radio- en Televisieomroep
Auguste Reyerslaan 52, 1043 Brussel

nv van publiek recht
BTW BE 0244.142.664
RPR Brussel
http://www.vrt.be/disclaimer

<Prev in Thread] Current Thread [Next in Thread>