Hi, I know this is an old query, but here goes ...
I searched for a solution today in the archives concerning
macros and select where parameter substitution was wanted.
I found an exact match (below) and wondered if anyone had
come up with an alternative solution to this. It doesn't
seem very elegant to have to say something like:
macro thing 'VALUE_1' ... does it?
I also looked at the sample server scripts and failed to do a
define of one containing something like what I wanted.
I found a note from Russell Street saying he had had trouble
installing scripts (with embedded comments) - essentially
the same problem with the quotes around parameters - and he
had done the 'dsmserv runfile scripts.smp' as the only way
to get them in. {Dated November 1998}
It all seems a bit messy and I wondered if anyone had resolved
this?
Thanks!
Sheelagh
------------------------------------------------------------------------
Sheelagh Treweek Email: sheelagh.treweek AT oucs.ox.ac DOT uk
Sheelagh Treweek Email: sheelagh.treweek AT oucs.ox.ac DOT uk
Oxford University Computing Services Tel: +44 (0)1865 273205
13 Banbury Road, Oxford, OX2 6NN, UK Fax: +44 (0)1865 273275
------------------------------------------------------------------------
------------- Begin Forwarded Message -------------
------------- Begin Forwarded Message -------------
To ADSM-L AT VM.MARIST DOT EDU
To ADSM-L AT VM.MARIST DOT EDU
Subject Re: macro substitions in SELECT statement
From Wim Feyants <wim_feyants AT BE.IBM DOT COM>
Date Fri, 8 May 1998 15:52:53 +0000
Tom,
You could try (if you didn't do it yet) to replace the '%1' in your macro code
by %1, which should elimintae the search for a string %1 by the select
statement. Then, start your macro by passing the arguments with their quotes.
So, call your macro as follows:
macro temp.dsm '/osiris48' '/POE/003/009/OUTPUT'
Wim.
IBM Belgium
ADSM-L AT VM.MARIST DOT EDU on 05/07/98 02:38:46 PM
Please respond to ADSM-L AT VM.MARIST DOT EDU
To: ADSM-L AT VM.MARIST DOT EDU
cc:
Subject: macro substitions in SELECT statement
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>
------------- End Forwarded Message -------------
=========================================================================
|