Hi there. Is there a way to delete rows from a table which MIGHT NOT exist without getting any errors or warnings (I know that SQLite doesn't support stored procedures, so cannot use IF).
if the table exists you get your row deletion. If the table does not exist you get an error in the database.
You can, however, add the table before making any deletes:
Code:
CREATE TABLE IF NOT EXISTS
LRS_GreatWallEffects (
Name text default null,
Value text default null);
This can cause compatibility issues in that if you are trying to deal with a table that is introduced by a JFD mod, for example, and he has altered the contents of one of his custom tables, if your mod fires before JFD's mod, you kill off his intended definition of the table. So you should always add a refeence in your modinfo file (modbuddy's "Associations" tab under "Mod Properties") so that in this example if both your mod and JFD's mod are enabled by the user, JFD's mod would load 1st and create the table within the database as JFD's mod needs it to be structured. Your mod would then never actually add the new table whenever JFD's mod is also enabled.
Yes, the table itself might exist or not. I suspected that there's no way around a possible error (I mean an easy way, like IGNORE statement in some DBs). And your idea is actually very neat - thanks a lot!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.