ADSM-L

macro substitions in SELECT statement

1998-05-07 14:40:28
Subject: macro substitions in SELECT statement
From: "Thomas A. La Porte" <tlaporte AT ANIM.DREAMWORKS DOT COM>
Date: Thu, 7 May 1998 11:40:28 -0700
I'm trying to figure out how to get argument substitutions into a
select statement, but am having trouble because of the single
quotes necessary when specifying an object.

E.g., I have the following query:

SELECT   node_name, filespace_name, hl_name, ll_name, object_id, \
         backup_date, deactivate_date, owner, class_name \
FROM     backups \
WHERE    node_name = 'OSIRIS' \
AND      filespace_name = '/osiris48' \
AND      type = 'FILE' \
AND      hl_name = '/POE/003/009/OUTPUT/'

which I would like to make into a macro file, allowing for
substitution variables in filespace_name and hl_name. I tried:

SELECT   node_name, filespace_name,  hl_name, ll_name, object_id,
\
         backup_date, deactivate_date, owner, class_name \
FROM     backups \
WHERE    node_name = 'OSIRIS' \
AND      filespace_name = '%1' \
AND      type = 'FILE' \
AND      hl_name = '%2'

But when I run the macro ('macro temp.dsm /osiris48
/POE/003/009/OUTPUT') the select is executed with a search for a
literal '%1' and '%2' instead of a variable substitution.

Is there a way to get a variable into the selection criteria of
the WHERE clause in  a macro?

 -- Tom

"It's a dog eat dog world,                Thomas A. La Porte
 and I'm wearing milkbone underwear."     DreamWorks SKG
              - Norm Peterson             <tlaporte AT anim.dreamworks DOT com>
<Prev in Thread] Current Thread [Next in Thread>