Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone.
I have a (simple) question: how use a function in load * inline, like this:
LOAD * INLINE [Data, Arquivo, Tipo, Mensagem
Now(), DocumentName, $(vTipoLog), $(vMensagemLog)];
Or only with variables?
Thanks!
The part between square brackets of a LOAD INLINE is an explicit multi-line string. Nothing inside will be handled by he expression evaluator. $-sign substitution will be executed as expected however, as shown in the example by Fer Fer.
But why use an INLINE if you can do it like this?
LOAD Now() AS Data,
DocumentName() AS Arquivo,
'$(vTipoLog)' AS Tipo,
'$(vMensagemLog)' AS Mensagem
AUTOGENERATE 1;
What is that you are getting when you run this Load?
Hi,
LET vNow = Today();
LET vDocumentName = DocumentName();
LET vTipoLog = DocumentPath();
LET vMensagemLog = 'MyMessage';
LOAD * INLINE
[Data, Arquivo, Tipo, Mensagem
$(vNow), '$(vDocumentName)', '$(vTipoLog)', '$(vMensagemLog)'
];
EXIT Script;
The part between square brackets of a LOAD INLINE is an explicit multi-line string. Nothing inside will be handled by he expression evaluator. $-sign substitution will be executed as expected however, as shown in the example by Fer Fer.
But why use an INLINE if you can do it like this?
LOAD Now() AS Data,
DocumentName() AS Arquivo,
'$(vTipoLog)' AS Tipo,
'$(vMensagemLog)' AS Mensagem
AUTOGENERATE 1;
Thank you... the others answers work too, but your working in my format...
SUB gerarLog(vTipoLog, vMensagemLog)
Teste:
LOAD Now() as Data,
DocumentName() as Arquivo,
'$(vTipoLog)' as Tipo,
'$(vMensagemLog)' as Mensagem,
OSUser() AS Usuario,
ComputerName() as Maquina
AUTOGENERATE 1;
STORE * FROM Teste INTO
DROP TABLE Teste;
ENDSUB;