From: Chris C. <cc...@gm...> - 2005-11-28 14:21:57
|
The Sybase libraries (the C-level ones, not the python ones) use "errors" t= o communicate all kinds of things (like database names after "use database"). Catch the exception and check for message 3216. Since it's a known message= , you can ignore it. -Chris P.S. Of course, you'll need to be sure that you won't need to signal a volume change during the backup, becase you need the information in the message to be able to do that properly. On 11/25/05, Wang King <wan...@gm...> wrote: > > Sybase Module for python had been installed successful. > My commands like this: > >>> from Sybase import * > >>> a =3D connect('SYBASE','sa','') > >>> a > <Sybase.Connection instance at 0x0093BBC0> > > >>> cur =3D a.cursor() > >>> cur > <Sybase.Cursor instance at 0x00934350> > >>> cur.execute('dump database test to "c:\\test" ') > > The result like this: > > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "D:\Python24\Lib\site-packages\Sybase.py", line 764, in execute > self.description =3D fetcher.start(self.arraysize) > File "D:\Python24\Lib\site-packages\Sybase.py", line 515, in start > return self._start_results() > File "D:\Python24\Lib\site-packages\Sybase.py", line 619, in > _start_results > status, result =3D self._cmd.ct_results() > File "D:\Python24\Lib\site-packages\Sybase.py", line 200, in > _servermsg_cb > raise DatabaseError(_fmt_server(msg)) > Sybase.DatabaseError: Msg 3216, Level 10, State 1, Line 1 > Backup Server session id is: 47. Use this value when executing the > 'sp_volchan > ged' system stored procedure after fulfilling any volume change request > from the > Backup Server. > Msg 404101, Level 1, State 1, Procedure bs_write_header > Backup Server: 4.41.1.1: Creating new disk file c:\test. > > But the database has been dumped successful. > > How can I dump database by python? > > _______________________________________________ > Python-sybase mailing list > Pyt...@ww... > https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase > > > -- Nervous passengers are advised to wear a blindfold. |