[SOLVED] Will the query 'CREATE TABLE IF NOT EXISTS table_name' raise an error if the table exists? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

[SOLVED] Will the query 'CREATE TABLE IF NOT EXISTS table_name' raise an error if the table exists?

Currently I'm developing a database app. I want to ensure that the table in user's database exists. If there is no table, I want to create it automatically. Will the query 'CREATE TABLE IF NOT EXISTS' work? Info : I need clarification if the table exists, so I need an exception raised.

8th Jul 2018, 6:06 AM
Christopher
Christopher - avatar
2 Antworten
+ 1
table creation queries will fail if the table already exists.
8th Jul 2018, 6:53 AM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
+ 1
and yes it should work
8th Jul 2018, 6:53 AM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar