Dayra,
when inserting strings into a database you need to enclose them in apostrophes, and the strings themselves need to be "double apostrophized," using
DoubleApos
,
ns_dbquotevalue
or equivalent, if there is any chance that they will contain one or more apostrophes, as in the name "O'Riley." This goes for Oracle as well as Postgres, even if the SQL statement appeared to work on Oracle this time.
There are a couple documents that are well worth reading if you haven't done so already. This topic and some other important issues are covered in the "Common Errors" page (although be aware this is an older document and some parts might be outdated):
https://openacs.org/doc/common-errors.html
SQL for Web Nerds is another document that is a quick-study guide with a lot of relevant information for using databases, particularly in the ACS context:
http://www.arsdigita.com/books/sql/
I hope that helps.