How do you know the insert is not working?  Have you verified that the data is 
not being inserted or are you simply relying on a popup provided by the 
application?  If the later, you should be aware that the application can pop-up 
whatever it wants at any time.  For example, it could claim the statement 
failed because the moon is not made of blue stilton.  While the moon is indeed 
not made of blue stilton, that is not (and cannot possibly be) the reason that 
the statement failed.  It does not mean that the statement in fact failed at 
all, only that the application popped up a pop saying it failed bue to the moon 
not being made of blue stilton.

By the time the "application" knows that no results were returned it is already 
too late, the statement has already been run to completion.  The application is 
likely just "spitting out a message" based on their being no results.

Unless of course the application has been deliberately designed to preclude 
insert/update statements by wrapping each statement execution in a transaction, 
which it then does a rollback on.  Or perhaps by making sure the first token of 
the statement is the word "SELECT" ...  If this is the case then perhaps you 
can get a version of the application that does not have these, rather 
intentionally created, restrictions.

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Nelson, Erik - 2
>Sent: Saturday, 16 December, 2017 14:44
>To: SQLite mailing list
>Subject: Re: [sqlite] Odd question
>
>Keith Medcalf wrote on Sent: Saturday, December 16, 2017 4:04 PM
>
>>Your method of achieving a solution to whatever problem you are
>trying to solve will not work.
>
>>Perhaps you can state the problem you are trying to solve without
>making an assumption as to how to solve that problem, someone may be
>able to solve the problem with a workable solution rather than an
>unworkable solution.
>
>I'm using an application that I can't change.  I can give it multiple
>queries to run but the application assumes that each query will
>produce at least one row and causes an error if that's not the case.
>I want to cause some rows to be inserted into a table but plain
>insert queries don't work because they violate the application's
>assumption that a result will be returned.
>
>>-----Original Message-----
>>From: sqlite-users [mailto:sqlite-users-
>>boun...@mailinglists.sqlite.org] On Behalf Of Nelson, Erik - 2
>>Sent: Saturday, 16 December, 2017 12:53
>>To: SQLite mailing list
>>Subject: [sqlite] Odd question
>>
>>For unfortunate reasons, I need a query that does an insert and also
>>returns at least one row... for example, something along the lines
>of
>>
>>Select 1 as value from (insert into table1 values(a, b, c))
>>
>>Or
>>
>>Select coalesce((insert into table1 values(a, b, c)), 1) as value
>>
>>I've tried a number of options but haven't been able to get anything
>>to work.  Is it possible?
>>
>=
>
>---------------------------------------------------------------------
>-
>This message, and any attachments, is for the intended recipient(s)
>only, may contain information that is privileged, confidential and/or
>proprietary and subject to important terms and conditions available
>at http://www.bankofamerica.com/emaildisclaimer.   If you are not the
>intended recipient, please delete this message.
>_______________________________________________
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to