SQL Statement return code 3

MALT

ADSM.ORG Member
Joined
Mar 14, 2003
Messages
8
Reaction score
0
Points
0
Website
http
I am trying to run a select statement through dsmadmc from within shell script on AIX. My problem is that when I run this I get no output and an error message return code 3.



ANS8000I Server command: 'cmd=Select VOLUME_NAME, STGPOOL_NAME, LAST_WRITE_DATE, LAST_READ_DATE from VOLUMES WHERE STGPOOL=MAIL_TAPE_POOL2'

ANS8001I Return code 3.



ANS8002I Highest return code was 3.



Thanks in advance,

Marty
 
When you use where clause, you should use single quotes to assign the value. i.e.. it should be like



Select VOLUME_NAME, STGPOOL_NAME, LAST_WRITE_DATE, LAST_READ_DATE from VOLUMES WHERE STGPOOL='MAIL_TAPE_POOL2'



and make sure that the value is in caps...

and also I think you specified incorrect column name....and it should be stgpool_name but not STGPOOL

hope this helps.



reddy
 
ok - here is the script that I am running:

#!/bin/sh

dsmadmc -id=xxxx -password=xxxxxx -tab cmd=Select VOLUME_NAME, STGPOOL_NAME, LAST_WRITE_DATE, LAST_READ_DATE from VOLUMES WHERE STGPOOL_NAME='MAIL_TAPE_POOL2' > /apps/tsm/scripts/mailtape2.txt



cat /apps/tsm/scripts/mailmsg.txt /apps/tsm/scripts/mailtape2.txt > /apps/tsm/scripts/mailtapes2.txt



mhmail -from "IT.Storage.Adminstrators" -s "MAIL_TAPE_POOL2 Volumes-Onsite $month/$day/$year " [email protected]< /apps/tsm/scripts/mailtapes2.txt



Heres the email message/error I receive

ANS8000I Server command: 'cmd=Select VOLUME_NAME, STGPOOL_NAME, LAST_WRITE_DATE, LAST_READ_DATE from VOLUMES WHERE STGPOOL_NAME=MAIL_TAPE_POOL2'

ANS8001I Return code 3.



ANS8002I Highest return code was 3.
 
You need to use double quotes for select statements in shell command prompt.

Try this...



dsmadmc -id=xxxx -password=xxxxxx "Select VOLUME_NAME, STGPOOL_NAME, LAST_WRITE_DATE, LAST_READ_DATE from VOLUMES WHERE STGPOOL_NAME='MAIL_TAPE_POOL2'" > /apps/tsm/scripts/mailtape2.txt
 
That worked Thank you so Much...

Marty
 
Back
Top