Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I'm putting together a fairly diverse data sources collector project.
Data is collected through specialized data generation QVCs that access each diverse type of databases (Firebird, MSSQLSERVER, DBII, EXCEL) and I would like to store some simple control information in a control QVD to be used later. Ideally this would be done in the load script it self; The information to be stored would be the table names, the number of rows of each table. I tried the following script that didn't work:
LET vTabelas = $Table ;
LET vRows = $Rows ;
Load * inline [ tabelas, nRows
$Table, $Rows ];
How should this be done ?
Best regards,
MM
Load inline don´t support variables...
try
Load
'$(TableName)' as Tabela,
'$(NoRows)' as Linhas
Autogenerate (1);
Fernando
Brasil - zil - zil ...
Thanks Fernando, but i didn't quite got it. Did you mean:
LET vTabelas = $Table ;
LET vRows = $Rows ;
d_tmp:
Load '$(vTabelas)' as Tabela, '$(vRows)' as Linhas Autogenerate (1);
It doesn't work. What Am i doing wrong ?
MM
Não entendi o que é $Table e $Rows. Na verdade não entendi o que você está tentando fazer, mas aí vão algumas dicas, não é a resposta exata, mas que acho que pode ajudar:
SET versus LET
SET is used for static data
SET vTest1 = 'XPTO' ;
Stores the string 'XPTO' into the variable vTest1
LET evaluates a function then stores the result into the variable
LET vTest2 = today();
Stores the result of the function Today() in the variable vTest2
AUTOGENERATE()
Generates a table and you can asing data and create columns as you wish.
Try this example to understand how it works
set v1 = 1;
let v2 = today();
LOAD
'$(v1)' as V1,
'$(v2)' as V2
AUTOGENERATE (1)
;
Ola Fernando,
$Table e $Rows são built in variaveis de sistema do QV que retornam os nomes de toas as tabelas e o numero de linhas respectivamente.
A ideia era utilizar estas variaveis para guardar o registo de cada carregamento. Não tenho qualquer problema em exibi-lasnum Chart ou qq outro objecto de visualização. Só não consigo arranjar uma forma de aceder a elas no script e armazenar o seu valor num QVD.
Um abraço,
MM
Opa,
Entendi agora!
No layout você pode usar os campos do sistema em qualquer tabela ou gráfico diretamente, sem ter que fazer nada no script!
Se você precisar deste tipo de informações no script, use as funções noOfRows() noOfTables() noOfFields()
Procure funçoes similares depois no help!
Um abraço
Fernando
--------------------------------------------------------------------------
Translating:
To access the structure information (such table names and number of rows / columns) you can use the sistem fields initiated by $ as $Field and $Table. You do not need any specific script code to do that.
Therefore you can access this kind of information in the script durning reload through TABLE FUNCTIONS like noOfRows() or noOfTables()
No script você tem funções que retornam estas informações na tabela