Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: WHERE NOT EXISTS in an INSERT statement?


Message #1 by "Tony" <one_dev@h...> on Wed, 13 Jun 2001 08:51:00 -0500
Thanks everyone for all your help and suggestions.

It works just how I need it to now.

Tony



"Harry Jega Nathan" <hjeganathan@y...> wrote in message
news:73559@s..._language...
>
> INSERT means, you are inserting a new row in to the
> TABLE and WHERE statment does not make any meaning. If
> you want to update a field(s) in a table with given
> condition then you could use WHERE statment.
>
> --- Tony <one_dev@h...> wrote:
> > Hello everyone,
> >
> > Is it possible to use WHERE NOT EXISTS in an INSERT
> > statement?
> >
> > Here's what I'm trying to do and getting the syntax
> > error:
> >     "Incorrect syntax near the keyword 'WHERE'."
> >
> > INSERT INTO tblAreaCodeStateZip (fld1, fld2, fld3,
> > fld4, fld5)
> > VALUES (5, 5, 5, 5, 5)
> > WHERE NOT EXISTS
> >       (SELECT * FROM someTable WHERE someField = 0)
> >
> >
> > Thanks in advance to everyone,
> >
> > Tony


  Return to Index