about upsert feature.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

about upsert feature.

畑宏和
Hi, I have a question.

We can use upsert after v3.24.0.

Document <https://www.sqlite.org/lang_insert.html> says that
`INSERT INTO table-name (column-name) select-stmt upsert-clause`
But when I try this syntax, it returns syntax error.
I think we can't use upsert-clause with select-stmt.
Is this thought right?

Thanks for reading my post.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: about upsert feature.

Shawn Wagner
Show an actual insert statement that causes an error?

On Wed, Nov 7, 2018, 2:22 AM 畑宏和 <[hidden email] wrote:

> Hi, I have a question.
>
> We can use upsert after v3.24.0.
>
> Document <https://www.sqlite.org/lang_insert.html> says that
> `INSERT INTO table-name (column-name) select-stmt upsert-clause`
> But when I try this syntax, it returns syntax error.
> I think we can't use upsert-clause with select-stmt.
> Is this thought right?
>
> Thanks for reading my post.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: about upsert feature.

Richard Hipp-3
In reply to this post by 畑宏和
On 11/6/18, 畑宏和 <[hidden email]> wrote:
> Hi, I have a question.
>
> We can use upsert after v3.24.0.
>
> Document <https://www.sqlite.org/lang_insert.html> says that
> `INSERT INTO table-name (column-name) select-stmt upsert-clause`
> But when I try this syntax, it returns syntax error.
> I think we can't use upsert-clause with select-stmt.
> Is this thought right?

Does your select-stmt include a WHERE clause?  It should, even if it
is a no-op like "WHERE true".  Try adding the WHERE clause and let us
know if that fixes your problem.
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: about upsert feature.

畑宏和
Thanks for your reply!
My script's select-stmt do not include where.
When I add 'where true', syntax error does not occur.

Thanks!

2018年11月7日(水) 19:44、Richard Hipp さん([hidden email])のメッセージ:

> On 11/6/18, 畑宏和 <[hidden email]> wrote:
> > Hi, I have a question.
> >
> > We can use upsert after v3.24.0.
> >
> > Document <https://www.sqlite.org/lang_insert.html> says that
> > `INSERT INTO table-name (column-name) select-stmt upsert-clause`
> > But when I try this syntax, it returns syntax error.
> > I think we can't use upsert-clause with select-stmt.
> > Is this thought right?
>
> Does your select-stmt include a WHERE clause?  It should, even if it
> is a no-op like "WHERE true".  Try adding the WHERE clause and let us
> know if that fixes your problem.
> --
> D. Richard Hipp
> [hidden email]
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: about upsert feature.

Chris Brody
I wonder if this should be considered a bug, or if should be better
documented?

On Thu, Nov 8, 2018 at 9:57 AM 畑宏和 <[hidden email]> wrote:

> Thanks for your reply!
> My script's select-stmt do not include where.
> When I add 'where true', syntax error does not occur.
>
> Thanks!
>
> 2018年11月7日(水) 19:44、Richard Hipp さん([hidden email])のメッセージ:
>
> > On 11/6/18, 畑宏和 <[hidden email]> wrote:
> > > Hi, I have a question.
> > >
> > > We can use upsert after v3.24.0.
> > >
> > > Document <https://www.sqlite.org/lang_insert.html> says that
> > > `INSERT INTO table-name (column-name) select-stmt upsert-clause`
> > > But when I try this syntax, it returns syntax error.
> > > I think we can't use upsert-clause with select-stmt.
> > > Is this thought right?
> >
> > Does your select-stmt include a WHERE clause?  It should, even if it
> > is a no-op like "WHERE true".  Try adding the WHERE clause and let us
> > know if that fixes your problem.
> > --
> > D. Richard Hipp
> > [hidden email]
> >
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users