Over a million developers have joined DZone.

SQL Quotation For Symbian DBMS


import e32db, time

timestamp = time.time()
distance = 10.5
comment = "I'm fine, thanks!"

# for date/time, int/float, and string respectively

sql = "INSERT INTO events VALUES (#%s#, %d, '%s')" %\
   comment.replace("'", "''") )

- date/time need to be quoted with # and formatted with e32db.format_time
- int/float need no quotation
- string need to be quoted with single quote and repeat the quote if it happen to be inside.
- binary can't be used. You may need to encode it (eg. base64)

One day, I wish to see an easy-to-use SQL abstraction layer for pys60.
An ORM(SQLObject or SQLAlchemy) is even better.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}