Hello Folks, I'm writing a simple & sweet RIS bibliography import script in Python. So far I have found the python bindings great... a real gem to work with, in one word SIMPLE.
Learning how to access the SDB/SDBC services from python I did the basic TABLE and COMMAND/"SELECT ..." without any problems, i.e., I'm properly accessing the database. But now I have run into problems with a basic INSERT command. Here is an excerpt of my code: rowSet = smgr.createInstanceWithContext("com.sun.star.sdb.RowSet", ctx) rowSet.DataSourceName = "Bibliography" rowSet.CommandType = COMMAND for ref in references: columns = ref.keys() statement = "INSERT INTO biblio (" + \ ", ".join(columns) + ") VALUES (" + \ ", ".join(["'" + str(ref[c]) + "'" for c in columns]) + ")" print statement rowSet.Command = statement rowSet.execute() ... the error I get is the oohhhhh so inadequately descriptive: uno.com.sun.star.sdbc.SQLException: Syntax error in SQL expression ... when I look at a sample INSERT string: INSERT INTO biblio (Publisher, Title, Author, Year, Address, Identifier, Type, Pages) VALUES ('Prentice Hall', 'Network flows : theory, algorithms, and applications', 'Ahuja, R.K., Magnanti, T.L., Orlin, J.B.', '1993', 'Upper Saddle River, N.J.', '35', '1', '846') I myself am confident, and have had other glance over it, that there is nothing wrong with this stament... :| The only other thing I've tried is increasing the sizes and types of the biblio columns so that they can handle the large fields from my RIS file. Any suggestions are MUCH appreciated. Once done this script should be a valuable addition to the bibliographic OOo project. Thank You, Mike --------------------------------------------------- Michael Sowka, Graduate Enginerd ___ <*,*> E-mail: [EMAIL PROTECTED] [`-'] Web: http://www.sowka.com -"-"- --------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]