Forum OpenACS Q&A: Unable To Use db_write_clob

Collapse
Posted by prashant harswal on
Hello,

  I am having a table named temp having following schema.

  roll Number(38), Description CLOB;

    Now I am using following code to insert data in temp Table.

db_write_clob insert_row " insert into temp
                          values
                          (11,'$email_body')
                  "
  Now here the email_body is having more than 5000 Characters.

  Problem is when I am running this code nothing happens, when I viewed the log file I found that it simply becomes standstill. ( I waited for 10 minutes).

  Can anyone correct me were I am going wrong.

Thanks in advance.
/Prashant

Collapse
Posted by Don Baccus on
db_write_clob writes a clob, it doesn't insert a clob.

You need to first insert an empty_clob() then overwrite it (via an UPDATE statement) with the value using Oracle's RETURNING syntax and a bind argument list to the OpenACS db proc call.

I suggest you use "grep" on "empty_clob()" to see some examples.  If you look at the source and query files that do this, you'll also see examples for PostgreSQL.