You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to add a name to the DB only if it's not already in the DB
if the record is already in the DB I'd like to answer 'sorry the record already exists'
`
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);
INSERT INTO users (name)
SELECT :name WHERE :name IS NOT NULL;
SELECT name AS title FROM users;
SELECT 'form' AS component, 'Add name:' AS title;
SELECT 'name' AS name, TRUE AS required;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to add a
nameto the DB only if it's not already in the DBif the record is already in the DB I'd like to answer 'sorry the record already exists'
`
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);
INSERT INTO users (name)
SELECT :name WHERE :name IS NOT NULL;
SELECT name AS title FROM users;
SELECT 'form' AS component, 'Add name:' AS title;
SELECT 'name' AS name, TRUE AS required;
`
Beta Was this translation helpful? Give feedback.
All reactions