RE: [sqlite] CREATE TABLE on conflict ignore?

2004-03-25 Thread Peter Pistorius
As far as I can tell there is no conflict cause on the CREATE TABLE
statement, however all the table information is stored in a table called
"sqlite_master."

SELECT count(*) FROM sqlite_master WHERE name = "my_table_name";

That should return "1"; 

So, if you're a SQL guru you might be able to work that in to a query. I
tried to figure out an elegant way to do this but I figured that I would
just have to check before in my application.

If you think about it logically you would be telling it to IGNORE the
conflict anway, and create the table regardless. So wouldn't it be safe
to assume that you could just drop the table and recreate it anyway?
Aha-! 

But then you're faced with yet another conflict cause if the table does
not infact exist.

Regards,
PeterP.

 

-Original Message-
From: Jimmy Lantz [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 25, 2004 12:10 PM
To: [EMAIL PROTECTED]
Subject: [sqlite] CREATE TABLE on conflict ignore?

Hi SQLiters!

Can someone tell me the proper syntax for CREATE TABLE  and if theres a
conflict ignore it.
I've tried several versions of the CREATE TABLE query.

All I get is an error that the table already exists.
Thats what I'm trying to avoid.

I've tried using BEGIN ON CONFLICT IGNORE and COMMIT in order to get rid
of it. But no luck.

Would be grateful for any hints.
Cheers
Jimmy.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] CREATE TABLE on conflict ignore?

2004-03-25 Thread Jimmy Lantz
Hi SQLiters!

Can someone tell me the proper syntax for CREATE TABLE  and if theres a 
conflict ignore it.
I've tried several versions of the CREATE TABLE query.

All I get is an error that the table already exists.
Thats what I'm trying to avoid.
I've tried using BEGIN ON CONFLICT IGNORE and COMMIT in order to get rid of 
it. But no luck.

Would be grateful for any hints.
Cheers
Jimmy.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]