Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jobsonkjoseph
Creator III
Creator III

Load data into QVD only if data present in SQL tables

Hi,

Can we have a solution at script level for "loading data into QVDs only if there is data in SQL tables".

SO, when a run happens and unfortunately the data in SQL table for some reason has no values, then the QVDs should remain unchanged with old records.

 

1 Solution

Accepted Solutions
jobsonkjoseph
Creator III
Creator III
Author

Hi Fosuzuki,

I've made some changes and used the following;

<table_name>:
LOAD *
SELECT * from <table>;
LET v<tablename>rows=NoOfRows('<table_name'>);
if $(v<tablename>rows)>0 then
STORE <table_name> into [lib://.../<table_name>.qvd](qvd);
ENDIF



View solution in original post

2 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Try something like this:

Data:
SQL SELECT * FROM TABLE;

If NoOfRows('Data') > 0 Then
  Store Data into Data.Qvd;
End If
Drop table Data;
jobsonkjoseph
Creator III
Creator III
Author

Hi Fosuzuki,

I've made some changes and used the following;

<table_name>:
LOAD *
SELECT * from <table>;
LET v<tablename>rows=NoOfRows('<table_name'>);
if $(v<tablename>rows)>0 then
STORE <table_name> into [lib://.../<table_name>.qvd](qvd);
ENDIF