Re: Unload to and ODBC
Posted in 2005
Hi,
'Unload' isn't a SQL statement, is simulated from dbaccess/sqlcmd/4GL, etc. So you need to do some coding or a script
that reads systables and laucnhes dbaccess
I use this 4GL program to unload all the tables from my database:, maybe you can adapt it for use in windoze.
DATABASE nomi
MAIN
DEFINE m_time CHAR(80),
w_tabla VARCHAR(100),
w_com, w_file CHAR(100)
LET m_time = time
DISPLAY "inicia respaldo a ", m_time
SET ISOLATION TO DIRTY READ
SET LOCK MODE TO WAIT 50
DECLARE c_tab CURSOR FOR
SELECT tabname FROM systables WHERE tabid >= 100
FOREACH c_tab INTO w_tabla
DISPLAY "Genera ", w_tabla
LET w_file = "/soportes/nomi/", w_tabla
LET w_com = ' SELECT * FROM ', w_tabla
UNLOAD TO w_file w_com
END FOREACH
FREE c_tab
LET m_time = time
DISPLAY "Termino respaldo a ", m_time
END MAIN
HTH
PS. You can also install Aubit4GL, It gives you 4GL even in windoze.
Bob escribi':
> Hello,
>
> I need to make backup of my prime database while its running, prohibiting
> the use of dbexport.
>
> When using dbaccess i can do an unload to 'myfile' select * from mytable
> without any problem.
>
> As i have a large amount of tables i thought to make a little software to
> backup all the tables i needed to save using ODBC ... here is the problem,
> the same request which work on dbaccess does not work using sqlview
> connected by odbc. it keep on returning "syntax error"
>
> My database is IDS 7.31 and my system is Win NT 2000 server.
>
> Any help would be great.
>
> Thanks in advance,
>
> Fred
>
>
>
sending to informix-list