It is good that we both understand his problem.
Do you have a solution for his problem?
For me, I think he may use two statements:
1. Create the table if it does not exist.
2. Insert data if that will not create duplicates.
------------------------------------------------------------------------
/* This is the first instruction for creating the table */
CREATE TEMPORARY TABLE IF NOT EXISTS
showcase (
  PRIMARY KEY (product)
  );
/* This is the second instruction for dumping records */
INSERT IGNORE INTO showcase
SELECT product FROM productList;
------------------------------------------------------------------------

Another alternative is to first DROP that table and recreate it. But I think
the above 2 steps procedure will work.
Unfortunately, I don't see a way to send these queries at once to the server
for execution.

Is this helpful?

Thanks
Emery
----- Original Message -----
From: "Antony Dovgal" <[EMAIL PROTECTED]>
To: "Director General: NEFACOMP" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 29, 2003 15:23
Subject: Re: 'IF NOT EXISTS' ignored?


> On Mon, 29 Sep 2003 15:16:57 +0200
> "Director General: NEFACOMP" <[EMAIL PROTECTED]> wrote:
>
> > Now, do you think I was right in my rephrasing?
> > To me, I think that is a bug and should be reported to MySQL. When the
IF
> > condition is false, it should break the rest of the statement.
> > What is your view on this?
>
> For me this is not a bug, just poorly documented feature.
> So, Hassan can't do it using this statement, he needs to check if table
exists and then INSERT, cause the statement he's trying to use is not
intended for conditional INSERT, but for conditional CREATE.
>
> ---
> WBR,
> Antony Dovgal aka tony2001
> [EMAIL PROTECTED]
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>
>
>



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to