How do I update a blob in an Oracle table column dynamically?
I know about UPDATEBLOB in PowerBuilder imbedded statements, like
UPDATEBLOB “tablename” set “blob_column_name” = :lblob;
This script uses SQLSA because the column name is known only at runtime. There is no UpdateBLOB statement in Oracle’s PL/SQL. So the statement becomes:
ls_sql = "UPDATE tablename set " + ls_column_name + " = ?, update_timestamp = ? where header_id = ?";
PREPARE SQLSA FROM :ls_sql;
EXECUTE SQLSA USING :lb_data,:ldt_update,:al_header_id;
Trying to pass a row data to a string, convert to a blob, and pass as an argument-- it is seeing those tab characters and throwing the invalid hex value error. I suspect this worked in PB 12.6. I'd rather not use a CASE statement for each blob column.
Any ideas?
I would concur with Miguel and suggest using the "EXECUTE IMMEDIATE" approach.
Regards ... Chris