Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am creating a dynamical way of creating my table.
Below example:
My table name is computed say
tableNaming = ‘table1’ ;
Now when I load I want
table1:
Load * from ……;
I am not able to use that Dynamical Table name… though if I display the value in a textbox it is correctly displayed.
sub CreateTableDynamically (Root)
Set tableNaming =mid(
'$(Root)',
index('$(Root)','\',-1)+1 ,
index('$(Root)','_',-1) - ( index('$(Root)','\',-1)+1)
) & ‘:’;
$(tableNaming);
LOAD *
FROM [$(Root)] (txt, codepage is 1252, embedded labels, delimiter is '|', msq, header is 1 lines);
end sub
OK i have computed the value of tableNaming, but now i get
Started loading data
The following error occurred:
Unknown statement
The error occurred here:
additionaldocuments1:
Data has not been loaded. Please correct the error and try loading again.
Where additionaldocuments1 is my COrrect value, but the load is not working
sub CreateTableDynamically (Root,tableNaming)
$(tableNaming);
LOAD *
FROM [$(Root)] (txt, codepage is 1252, embedded labels, delimiter is '|', msq, header is 1 lines);
end sub
OK i managed to get it work
sub CreateTableDynamically (Root,tableNaming)
Set QueryMy = $(tableNaming)
LOAD *
FROM [$(Root)] (txt, codepage is 1252, embedded labels, delimiter is '|', msq, header is 1 lines);
$(QueryMy);
// $(tableNaming);
// LOAD *
// FROM [$(Root)] (txt, codepage is 1252, embedded labels, delimiter is '|', msq, header is 1 lines);
end sub
from the first glance I would say you need to put : instead of ; after $(tableNaming)