Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I am trying to read sql scripts from an excel file which are placed in a field called 'LoadStatement'.
Using For and Next loop I am trying to get the Select statement from each one of the field value (LoadStatement) against the tablenames of the ExtractList.xls to load the data from database. If not Select statement available it should default to 'SQL Select * from TableName' as defined in variables.
However, it only picks first Select statement and all others are defaulted to 'SQL Select * from TableName' statement defined in the For-Next loop.
I have attached all the files I am using to get this worked.
Could you please advise what I am missing.
Appreciate your help here. Thanks in advance.
Hi, with FieldValue you read the values from field, in example LoadStatementCheck only has values 1 and 0 (only 2 values, not 4 like excel rows). To load the table by rows you can try with Peek() and NoOfRows():
FOR i=0 to NoOfRows('ExtractList')-1 // Peek starts at 0
LET vQVDName = Peek('QvdName',$(i),'ExtractList') ;
Hi, with FieldValue you read the values from field, in example LoadStatementCheck only has values 1 and 0 (only 2 values, not 4 like excel rows). To load the table by rows you can try with Peek() and NoOfRows():
FOR i=0 to NoOfRows('ExtractList')-1 // Peek starts at 0
LET vQVDName = Peek('QvdName',$(i),'ExtractList') ;
Thanks heaps Rubenmarin.
That worked.