Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Help with script

Hi All,

I have the following in my script which hard codes file locations..

For each vDirectory in 'C:\Temp1' ,'C:\Temp2'

I have a field in a QVD which holds all of the file locations i need. what i want to do is use that field instead of hardcoding.

At the moment the field isn't being loaded in at all, so i guess the first thing i need to do is load this field into its own table, but i do not know what to do after that.

Can anyone help please?

1 Solution

Accepted Solutions
Colin-Albert

Try something like this

Tmp_dirlist:

LOAD concat( chr(39) & dirlist & chr(39), ',') as dirlist

From dirlist.qvd ;   

LET vDirlist = peek(dirlist) ;

Drop table Tmp_dirlist;

For each vDirectory in $(vDirlist)

...( rest of your script)

View solution in original post

7 Replies
amit_saini
Master III
Master III

Hi,

You can do like below:

SET vSAP = 'Demo';

Directory \.......\SourceDocuments\qvd\SAP\$(vSAP)\;

Thanks,
AS

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

sorry i dont understand. what does Demo relate to?

Not applicable

Hi Hopkinsc,

something like the below should work for you, you'll need to create a concat list from your qvd and then loop through based on that

(assuming your directory paths are in rows and not in a list already)

LOAD
Concat(Distinct DIRLIST,',') AS Dir_List
FROM
[YourQVDName.qvd]
(
qvd);

Let vDirList = Peek('Dir_List');

For Each Dir In $(vDirList)

//your code here

Next


hope that helps

Joe

amit_saini
Master III
Master III

Say your Folder name is Demo from where you are reading your data.

Thanks,
AS

ThornOfCrowns
Specialist II
Specialist II

That what the OP has and is trying to avoid.

amit_saini
Master III
Master III

Sorry James my mistake

Thanks,

AS

Colin-Albert

Try something like this

Tmp_dirlist:

LOAD concat( chr(39) & dirlist & chr(39), ',') as dirlist

From dirlist.qvd ;   

LET vDirlist = peek(dirlist) ;

Drop table Tmp_dirlist;

For each vDirectory in $(vDirlist)

...( rest of your script)