Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody
i'm facing a strange issue or misunderstanding
When I
LOAD * FROM [$(PathQVD)\$(FileNameQVD).qvd] (qvd);
everyting's OK
BUT When i'm doing
LET v =filename([$(PathQVD)\$(FileNameQVD).qvd]);
my variable v is NULL
Any idea ?
Thnak you
Chris
OK
i found why
FileName is the problem. Returns always NULL
FielSize returns a value if file exists and null if doesn't
Thnak you everybody for your help
Chris
What exactly u want to store in variable v??
this is an example of using filename from online help
Load *, filename( ) as X from
C:\UserFiles\abc.txt
Will return 'abc.txt' in field X in each record read.
Try this
LET v =filename('[$(PathQVD)\$(FileNameQVD).qvd]');
You don't need a variable
try
LOAD *,
FileName() as Filename
FROM [$(PathQVD)\$(FileNameQVD).qvd] (qvd);
I want to check wether or not the file exists
so if i get a filename it does
Chris
I did already, it doesn't
Chris
Yes I do,
i don't want to load data, just check if the file exists
Chris
Hi Chris,
You may want to use this instead
LOAD *,
FilePath() as Path
FROM [$(PathQVD)\$(FileNameQVD).qvd] (qvd);
This will give you the full path of where the file is located and the filename
Regards
Alan
for qvd file there are qvd file functions
answer here (and example)
Re: How can I check if a file exists ?
QvdCreateTime
Returns the XML-header time stamp from a QVD file if any (otherwise NULL).
The filename is the name of a QVD file, if necessary including path.
Examples:
QvdCreateTime('MyFile.qvd')
QvdCreateTime('C:\MyDir\MyFile.qvd')