Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SQL question
#1
Hi,
I have data in an FTS5 sql table, but you can sql update it like any other table. (but no field types)
Say the table is called "abc", and has 3 fields (filename, freeText,register)
The table has 42.000 records;
The problem is in the filename, consider this:
VST-098.png should be VST-0098.png
VST-125.png should be VST-0125.png
VST-995.png should be VST-0995.png
VST-1289.png is ok, with 4 numeric digits.

So I have to test on the numeric part, if it's 3 chars, add leading zero.
Normally in python, a piece of cake, but inside an sql table, how to ?
If it's too complicated, I can also rename the 42.000 image files, maybe that is the wiser option?
thx,
Paul

Edit: the KISS solution is modify the filenames. 5 minute job.
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
SQL question - by DPaul - Jun-02-2023, 08:43 AM
RE: SQL question - by rob101 - Jun-03-2023, 05:05 AM
RE: SQL question - by DPaul - Jun-03-2023, 06:22 AM
RE: SQL question - by rob101 - Jun-03-2023, 06:57 AM
RE: SQL question - by DPaul - Jun-03-2023, 05:09 PM

Forum Jump:

User Panel Messages

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