Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all.
Please help me out with this. I've seen on the forum this code that helps truncate the existing qvd data, but I'm facing errors.
I'm pasting what I'm doing, error says table _TableStructure cannot be found.
SUB EmptyQVD (['lib://my_connection'/MyQVD.qvd])
//Check file exists
IF (NOT isNull(qvdCreateTime(['lib://my_connection'/MyQVD.qvd]))) THEN
//Check if QVD is already empty
IF (qvdNoOfRecords(['lib://my_connection'/MyQVD.qvd]) > 0) THEN
//Load the structure from the existing QVD
//Where clause returns no records
_TableStructure:
LOAD
*
FROM ['lib://my_connection'/MyQVD.qvd] (qvd)
WHERE 1<>1;
//Store table definition back to QVD
STORE _TableStructure INTO ['lib://my_connection)'/MyQVD.qvd] (qvd);
DROP TABLE _TableStructure;
END IF
END IF
END SUB
Your help is , as always, so valuable 🙂 Thank you in advance
Anyone, please?
HI
Try like below
set vPath = 'lib://my_connection/';
SUB EmptyQVD(QVDNameWithPath)
//Check file exists
TRACE QVDNameWithPath - $(QVDNameWithPath);
IF (NOT isNull(qvdCreateTime(QVDNameWithPath))) THEN
//Check if QVD is already empty
IF (qvdNoOfRecords(QVDNameWithPath) > 0) THEN
//Load the structure from the existing QVD
//Where clause returns no records
_TableStructure:
LOAD
*
FROM $(QVDNameWithPath) (qvd)
WHERE 1<>1;
//Store table definition back to QVD
STORE _TableStructure INTO $(QVDNameWithPath)(qvd);
DROP TABLE _TableStructure;
END IF
END IF
END SUB
Call EmptyQVD('[$(vPath)MyQVD.qvd]');
Hello @MayilVahanan 🙂 Thanks for helping!
I'm not getting it correctly, let's say for example this:
TRACE QVDNameWithPath - $(QVDNameWithPath);
would be
TRACE ['lib://my_connection'/MyQVD.qvd] - $(['lib://my_connection'/MyQVD.qvd]);
?
@MayilVahanan see, I'm getting all these reds... I've been on it all day, still I can't find what this error is!
HI
You can't write values in the sub function, However you can pass the value.
Did you try the code suggested already?