Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
msludo
Contributor III
Contributor III

Gerar QVD: TableName()

Boa tarde,

Estou tentando gerar o QVD das tabelas que carreguei. Estudando as funções TableName() e NoOfTables(), fiz o seguinte:

//Gera QVD(v1)

For t = 0 to NoOfTables() - 1

LET vTableName = TableName($(t));

    If Not IsNull(vTableName) then

Call GeraQVD ('$(vTableName)')

    EndIf

Next t;

Esse código funciona parcialmente, das 25 tabelas carregadas, somente 11 tabelas são geradas os QVDs. Eu utilizei o seguinte código para obter os nomes das tabelas carregadas e consegui gerar todos os QVDs:

//Gera QVD(v2)

For t = 0 to NoOfTables() - 1

  TabelasCarregadas:

  Load

   TableName($(t)) as Table,

   TableNumber(TableName($(t))) as TableNo,

   NoOfRows(TableName($(t))) as TableRows

   Autogenerate 1;

Next t;

FOR i=1 to NoOfRows('TabelasCarregadas')

LET vTableName = FieldValue('Table',$(i));

IF Len(vTableName)>0 THEN

CALL GeraQVD ('$(vTableName)');

ENDIF

NEXT i

Alguém consegue, por gentileza, me dizer porque o primeiro código (Gera QVD(v1)) não funcionou, ao passo que o segundo funcionou. Não queria gerar TabelasCarregadas para poder ter o nome das tabelas, pois isso a função TableName().

Onde estou errando?

0 Replies