Python Forum

Full Version: String replacement in DB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have two SQLite3 databases each with one table:
Database: MyModule.db has a table "content"
CREATE TABLE "content" (
"topic_id" integer,
"data" BLOB,
"data2" blob,
PRIMARY KEY("topic_id")
);
The field data is in RTF format.

Database: Afr2020map.db has a table "repstr"
CREATE TABLE "repstr" (
"istr" TEXT,
"ostr" TEXT,
PRIMARY KEY("istr")
);

I need to run through all records in MyModule.db and in every record replace in "data" every occurrence of istr with ostr.

Attached is my code which does not work:

What am I doing wrong?