newbie question

Eugene Antimirov Eugene.Antimirov at portaone.com
Mon Jan 22 11:24:16 CET 2007


kavitha thankaian wrote:
> Hi,
>  
> i wrote a simple script (which follows) to insert a table in the 
> database.i could execute this query and get the result in python 
> shell.but when i open "my sql enterprise manager" i couldnt find the 
> table"animals".it would be so kind of you if someone could help me,,,
>  
>  
> import dbi
> import odbc
> conn=odbc.odbc("DSN=mydatabase;UID=xxx;PWD=yyy")
> cursor=conn.cursor()
> cursor.execute("Create table animals(parent char(50),child char(50))")
> cursor.execute("insert into animals values('lion','cub')")
> cursor.execute("insert into animals values('goat','lamb')")
> cursor.execute("select * from animals")
> print cursor.fetchall()
>  
>  
> Rgds
> Kavitha
>
> ------------------------------------------------------------------------
You've probably missed cursor.commit() ;)

-- 
Sincerely,
Eugene Antimirov
PortaOne, Inc., SIP Support Engineer
support at portaone.com

* For further Billing and Technical information:
=> Please visit our website http://www.portaone.com
=> Please visit our forum http://forum.portaone.com

* Meet us at Internet Telephony Conference & Expo
* Ft. Lauderdale, FL - January 24-26, 2007 - Booth 1322
* http://www.tmcnet.com/voip/conference/




More information about the Python-list mailing list