Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Location
    Azerbaijan
    Posts
    2

    Red face Unanswered: how can I insert Unique Data in MySQL

    i want to insert data to base if it not situate there
    which function i must use here
    or
    how can use


    It gives Error
    IF NOT EXISTS(SELECT * FROM Costs WHERE C_Name='Monitor')
    BEGIN
    INSERT INTO Costs (C_Name) VALUES ('Monitor')
    END

    thanks for all

  2. #2
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    Can you tell us what error you get?
    The command you use should work, I tried it myself.
    Check the structure of your table, and make sure the columns in the command match those in the table.

  3. #3
    Join Date
    Mar 2004
    Location
    Azerbaijan
    Posts
    2

    Hi Martijnvs

    Hi Martijnvs
    can ugiveyour ICQ num to me
    Iwill ask my question on online

  4. #4
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4

    Re: Hi Martijnvs

    Originally posted by hasanrasim
    Hi Martijnvs
    can ugiveyour ICQ num to me
    Iwill ask my question on online
    Hi,
    I don't think that will work. I'm only online in the evening, and I'm in a different timezone, so I doubt it if we will be online at the same time.

    You can mail me though, martijn [at] gohn [dot] nl.

  5. #5
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    Hi Hasan,

    I just got your e-mail, and I noticed you're using MySQL.
    Maybe you should post your problem in the MySQL-subforum.
    I thought it was a Sybase-problem, so I experimented in Sybase, and that works.

    My Mysql-knowledge is very limited, but I tried some things, right out of the online manual, and that doesn't work, so now I'm lost too .

    Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •