Passing file name at runtime

thanks also. apology for my ignorance. can i able to include file declaration (tps/odbc) at runtime using xlib? is there any example that i can refer to?

XLIB allows to build compound structures (QUEUEs, FILEs, VIEWs) at run time from the scratch or to import such structures from objects declared in the program. For FILEs - XLIB can’t import structures directly from disk files. Usage of the Dynamic File driver is required for that, though structure of SQL/ODBC based files can be retrieved using SQL.
I passed rights to XLIB to SV in 2005.

1 Like

For what your are trying to achieve (ie: copy a record from one file to another having the same structure) why don’t you do away with the CopyFiles procedure, make sure that SourceFile and DestinationFile are open before you start processing then do this …

DestinationFile.Record = SourceFile.Record

Can this code be made available, or is it prevented by “red tape” ?

hi julian, can this work for odbc? what if destination contains same record?

I don’t know whether this facility is described in documentation for the Dynamic File Driver. So, ask SV for that.

Anyone can try to find usage of this feature in the TopScan code.

1 Like

it works for tps @also . what abt odbc?
for example,
MySqlSourceFileName &= NEW FILE
MySqlSourceFileName {PROP:Driver} = ‘MySQL ODBC 3.51 Driver’
MySqlSourceFileName {PROP:Owner} = ‘Customer,root’
MySqlSourceFileName {PROP:Name} = ‘CustomerProfile’
FIXFORMAT(MySqlSourceFileName)

i have tried the above for odbc but it cant pass. But for tps yes.
P.S CustomerProfile table is not in the dct. If need to declare it at runtime, how do i go about it? thanks.

MySqlSourceFileName {PROP:Driver} = ‘ODBC’

@also ok that works! thanks. i can pass the file name to the copy procedure.
how can i declare the file structure at runtime for this odbc case?