Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String replacement in DB
#1
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?
Yoriz write Dec-28-2022, 08:30 AM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  replacement for fpformat.extract GbSig1998 4 252 Apr-12-2024, 06:15 PM
Last Post: deanhystad
Exclamation IndexError: Replacement index 2 out of range for positional args tuple - help? MrKnd94 2 6,405 Oct-14-2022, 09:57 PM
Last Post: MrKnd94
  Extract the largest value from a group without replacement (beginner) preliator 1 2,085 Aug-12-2020, 01:56 PM
Last Post: DPaul
  Simple automated SoapAPI Call with single variable replacement from csv asaxty 1 2,111 Jun-30-2020, 06:38 PM
Last Post: asaxty
  line replacement help mdalireza 8 3,458 Nov-11-2019, 12:54 PM
Last Post: mdalireza
  xml replacement with python josesalazmit 3 8,402 Feb-24-2019, 07:28 PM
Last Post: stullis
  Best replacement for pyzmail in lines 15 and 16 Pedroski55 0 2,496 Nov-03-2018, 06:12 AM
Last Post: Pedroski55
  Is pathlib a viable replacement for os.path? j.crater 4 9,984 Jan-13-2018, 09:49 AM
Last Post: Gribouillis
  Using python for text replacement omar 1 3,848 Dec-22-2016, 01:36 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020