Focal Point
[CLOSED] SQL Object run file with dynamic name

This topic can be found at:
http://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/869105291

July 27, 2009, 05:05 PM
Tobar
[CLOSED] SQL Object run file with dynamic name
I am trying to create system that can handle multiple files. I am trying to make the SQL object execute some dynamically generated code. I have tried 2 approaches, both which fail.

1) If I assign my dynamic file name in the variable SQLFILE and then I put file(SREG(SQLFILE)) the file command interprets SREG(SQLFILE) as a literal file name and fails.

2) If I try to read some SQL into a variable in a previous File object which I can later run in the SQL object, the FILE read inserts extra characters into the SQl command which causes it to fail.

Can this type of thing not be done? It seems basic to me so I am wondering if I am just applying the wrong thinking.

Thanks for your help.

This message has been edited. Last edited by: Tobar,


------
Livin' down on the cube farm. Left, right, right.

iWay 5.6
Windows
Excel, Tab-delimited, XML
August 05, 2009, 10:50 AM
Kerry
Hi Tobar,

Please try this: add SREG(sregname) in the Statement window not (SREG(sregname)).

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
August 06, 2009, 08:15 AM
Tobar
THe command I have in the statement window is
quote:
file(SREG(SQLFILE))

I think you didn't see the "file" in my original statement, correct?

I have an open ticket with iWay support on this. The work around I found is to use a single file containing
quote:
SELECT *
FROM ?TABLENAME
and then constructing the name in the variable TABLENAME. Not the best solution for all cases but works well here.


------
Livin' down on the cube farm. Left, right, right.

iWay 5.6
Windows
Excel, Tab-delimited, XML