Re: [sqlite] What happens if an in memory database runs out of memory

2017-12-16 Thread x
I’m with you Simon but the program I’m working on will probably only ever be 
used by me. I just like to try and do things properly as a means of learning. 
I’m using win64 with 16GB RAM and 512GB SSD so everything’s already fast. I 
only tested in win32 so I’d run out of memory a lot quicker.




From: sqlite-users  on behalf of 
Simon Slavin 
Sent: Friday, December 15, 2017 8:50:40 PM
To: SQLite mailing list
Subject: Re: [sqlite] What happens if an in memory database runs out of memory



On 15 Dec 2017, at 8:36pm, x  wrote:

> I’ll have to look into how to increase the in-memory pager cache.

Before you do anything like that, ask yourself two questions:

a) Is my program actually fast enough without any of these weird picky measures 
?  Or am I spending lots of time learning details of SQLite when I could be 
spending it improving my program’s functions ?

b) Is the environment I’m developing under identical to those my program is 
going to work under ?  You’re running under win32.  Are all your users going to 
run under win32 or some going to be running win64 ?  The two don’t do the same 
things at the same point.  Don’t do lots of work and then have to tell people 
"My program doesn’t work on your computer because you’re running 64-bit Windows 
10.".

Simon.
___
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


Re: [sqlite] SQLite3 on WinCE platform

2017-12-16 Thread Ertan Küçükoğlu
>From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
>Behalf Of Simon Slavin
>Sent: Monday, December 11, 2017 12:50 PM
>To: SQLite mailing list 
>Subject: Re: [sqlite] SQLite3 on WinCE platform
>
>On 11 Dec 2017, at 8:59am, Ertan Küçükoğlu  wrote:
>
>> Error I am getting when application runs is: EInOutError: Can not load 
>> SQLite client library "sqlite3ce.dll". Check your installation.
> 
> Given this page
> 
> 
> 
> "EInOutError is raised when a IO routine of Free Pascal returns an error. The 
> error is converted to an EInOutError only if the input/output checking 
> feature of FPC is turned on. The error code of the input/output operation is 
> returned in ErrorCode."
> 
> Can you look at the error code in 'ErrorCode' ?
> 
> Or can you turn off the input/output checking feature of FPC ?
> 
> Simon.

Finally mystery solved. Even Motorola device seems to be using more or less 
same version of WinCE, and having ARMV5 supported CPU it turned out that DLL 
has to be bare ARM compiled and not ARMV4i.

Thanks for all the help.

Ertan

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


[sqlite] Missing data table

2017-12-16 Thread Chris B
Afternoon all,


Just joined the list.  Am a fairly long term user of SQLite Expert Personal (my 
version is 3.5.96.2516 - I upgraded to try version 4 a while back but the 
columns in the Data tab were fixed which is no good for me, I couldn't drag 
them wider so I went back to v3), and while I built my PC from scratch and am 
good with a lot of software, I'm by no means an expert when it comes to SQL or 
databases.


The reason for my post is to help my dad out!  We both maintain our own 
databases (Windows 7) - in the left hand pane of SQLite, you have the database 
name (basestation) and the table name (Aircraft) - I don't think this list 
allows snips or I'd send a screenshot but you know what it looks like.


Twice now in the last two months, the "Aircraft" table has vanished from my 
dad's database effectively showing no data in the data tab on the main window, 
but the file size has remained the same, suggesting the data is in there 
somewhere but without it the database is useless.  Now I know he's obviously 
unwittingly done something, but I'd like to know what he did, how he did it, 
and if there's any way to undo it, should it happen again.  After the first 
loss, I closed the left hand pane so he couldn't accidentally delete the table, 
but it's gone again so something else is amiss.  He uses a laptop with a 
touchpad and I know how temperamental they can be regarding a mouse swipe vs a 
mouse click, especially if you accidentally brush it.


Yes we've backed up the database, but I'd like to prevent this from happening 
in the first place, or at least be able to undo it and get the table back.


If there's anything I've left out please ask, and many thanks for any help with 
this.

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


Re: [sqlite] Missing data table

2017-12-16 Thread Simon Slavin


On 16 Dec 2017, at 1:51pm, Chris B  wrote:

> Twice now in the last two months, the "Aircraft" table has vanished from my 
> dad's database effectively showing no data in the data tab on the main 
> window, but the file size has remained the same, suggesting the data is in 
> there somewhere but without it the database is useless.

Hello, Chris.

Your problem is actually with the program called SQLite Expert Personal.  This 
is not written by the same people who wrote SQLite.  It is just a program which 
uses SQLite format.  Most of the people reading this list have never used that 
program.

You may find you get better help from the sources listed here:




On the other hand, you may be lucky, and someone familiar with your program may 
be reading this list.

If you get no help in the above places, we may be able to help by telling you 
how to rescue the data from your database and write it to a text file.  But you 
should try people who understand your program first.

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


Re: [sqlite] Missing data table

2017-12-16 Thread Jean-Christophe Deschamps

At 14:51 16/12/2017, you wrote:
Just joined the list.  Am a fairly long term user of SQLite Expert 
Personal (my version is 3.5.96.2516 - I upgraded to try version 4 a 
while back but the columns in the Data tab were fixed which is no good 
for me, I couldn't drag them wider so I went back to v3), and while I 
built my PC from scratch and am good with a lot of software, I'm by no 
means an expert when it comes to SQL or databases.



The reason for my post is to help my dad out!  We both maintain our 
own databases (Windows 7) - in the left hand pane of SQLite, you have 
the database name (basestation) and the table name (Aircraft) - I 
don't think this list allows snips or I'd send a screenshot but you 
know what it looks like.



Twice now in the last two months, the "Aircraft" table has vanished 
from my dad's database effectively showing no data in the data tab on 
the main window, but the file size has remained the same, suggesting 
the data is in there somewhere but without it the database is 
useless.  Now I know he's obviously unwittingly done something, but 
I'd like to know what he did, how he did it, and if there's any way to 
undo it, should it happen again.  After the first loss, I closed the 
left hand pane so he couldn't accidentally delete the table, but it's 
gone again so something else is amiss.  He uses a laptop with a 
touchpad and I know how temperamental they can be regarding a mouse 
swipe vs a mouse click, especially if you accidentally brush it.


I'm as well a (very) long-term user of Expert (a completely distinct 
product from what the SQLite dev team maintains and offers for free).


When you open Expert and [re]open your database, you should see a + 
sign in the DB tree (left pane) showing you that the DB contains 
elements (tables and vues). When you hit this + sign, it chenges to a - 
sign and the tree expands to list tables and vues; then you can select 
one of them to see its contents in the Data tab.


Since you seem to say that this is something having occured twice I 
believe the problem is just misuse of the tree panel.


If you have (or your dad has) explicitely selected one table and hit 
Del key, a message box popped up to prompt you for confirmation of 
removal of the table. If a table has been deleted it's no longer 
available from Expert nor any SQLite DB manager. I believe it can still 
be recovered by technical means unless the file has been changed later, 
e.g. by attempting to recreate a table.


As Simon advised you can ask Expert's author for support, even if you 
use the free version.


JcD 


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


Re: [sqlite] DateTime kind stored as undefined

2017-12-16 Thread Cezary H. Noweta

Hello,

> my connection string looks like this:
> *var connection = new SQLiteConnection("DateTimeKind=Utc;Data
> Source=:memory:");*
> Here is a blog post about it (settig datetimekind in utc for sqlite) on
> which I based:
> 
https://www.thomaslevesque.com/2015/06/28/how-to-retrieve-dates-as-utc-in-sqlite/


Still, I cannot reproduce te original problem. The following results are OK:

==
test.cs:
==
using System;
using System.Data.SQLite;

class Test
{
static void TestUtc(bool utc, bool ticks)
{
DateTime dtUtcNow = DateTime.UtcNow;
DateTime dt;
SQLiteConnection connection;
SQLiteCommand cmd;
SQLiteDataReader rdr;
int rows;
string connectionstring = "Data Source=:memory:;";

Console.WriteLine("* Testing " + (utc ? "UTC" : "UNSPECIFIED") 
+ "/" + (ticks ? "TICKS" : "ISO8601") + "...");


Console.WriteLine("DateTime: {0}", dtUtcNow);
Console.WriteLine("DateTime.Kind: {0}", dtUtcNow.Kind);

if ( utc ) {
  connectionstring += "DateTimeKind=Utc;";
}
if ( ticks ) {
  connectionstring += "DateTimeFormat=Ticks;";
}
connection = new SQLiteConnection(connectionstring);
connection.Open();
cmd = new SQLiteCommand("CREATE TABLE IF NOT EXISTS [test] 
([date] DATETIME NOT NULL);");

cmd.Connection = connection;
rows = cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = new SQLiteCommand("INSERT INTO [test] ([date]) VALUES 
(@date);");

cmd.Parameters.AddWithValue("@date", dtUtcNow);
cmd.Connection = connection;
rows = cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = new SQLiteCommand("SELECT [date] FROM [test];");
cmd.Connection = connection;
rdr = cmd.ExecuteReader();

while ( rdr.Read() ) {
dt = rdr.GetDateTime(0);
Console.WriteLine("DateTime: {0}", dt);
Console.WriteLine("DateTime.Kind: {0}", dt.Kind);
}
rdr.Dispose();
cmd.Dispose();
connection.Dispose();
}

static void Main()
{
TestUtc(false, false);
TestUtc(true, false);
TestUtc(false, true);
TestUtc(true, true);
}

}
==

gives the following results:

==
* Testing UNSPECIFIED/ISO8601...
DateTime: 2017-12-16 15:48:39
DateTime.Kind: Utc
DateTime: 2017-12-16 16:48:39
DateTime.Kind: Unspecified
* Testing UTC/ISO8601...
DateTime: 2017-12-16 15:48:40
DateTime.Kind: Utc
DateTime: 2017-12-16 15:48:40
DateTime.Kind: Utc
* Testing UNSPECIFIED/TICKS...
DateTime: 2017-12-16 15:48:40
DateTime.Kind: Utc
DateTime: 2017-12-16 15:48:40
DateTime.Kind: Unspecified
* Testing UTC/TICKS...
DateTime: 2017-12-16 15:48:40
DateTime.Kind: Utc
DateTime: 2017-12-16 15:48:40
DateTime.Kind: Utc
==

It looks that your app behaves as if it had default settings: 
ISO8601/Unspecified, which results in Local/Unspecified. The sole thing 
I have in mind is Connection Designer. Try to omit the Connection 
Designer -- as far as I remember it had problems with some parameters: 
CD doubled them or had named them incorrectly.


-- best regards

Cezary H. Noweta

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


[sqlite] Odd question

2017-12-16 Thread Nelson, Erik - 2
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


Re: [sqlite] Odd question

2017-12-16 Thread Keith Medcalf

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.

---
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 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


Re: [sqlite] Odd question

2017-12-16 Thread R Smith


On 2017/12/16 9:53 PM, Nelson, Erik - 2 wrote:

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?


That is not possible, and certainly not part of the spirit or letter of 
the SQL Standard, and not done by any of the standard SQL Engines. 
(However, I think in MySQL there exists a way to to do it - but I'm not 
100% sure).


May I ask what are the "unfortunate reasons"?  Perhaps someone here 
had/have a similar scenario and can assist - but the way you are trying 
to solve your problem will almost certainly not work (unless perhaps 
through forking and fudging the SQLite code itself, but that is a 
different can of worms and must be a very last resort...)


Cheers,
Ryan

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


[sqlite] Odd question

2017-12-16 Thread Larry Brasfield
Nelson, Erik - 2
​, on​
Sat, 16 Dec 2017 11:54:06
​, wrote:​


​> ​
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?

​No. Data and schema modification operations return no data from the DB.
(Data modification operations​ return a count of affected rows, but even
that is not available as part of a query.)

​What you probably want is to use a transaction.  That's a guess because
you have not explained your real problem -- only how you imagine you might
solve it.  You'll get better help, and viable alternatives, if you explain
what you are trying to do.​

​Cheers,
--
Larry Brasfield
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Odd question

2017-12-16 Thread Nelson, Erik - 2
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


Re: [sqlite] Odd question

2017-12-16 Thread petern
Re: Nelson "odd". This will make the desired (?) side effect happen:

.load eval.so
SELECT coalesce(eval('INSERT INTO table1 VALUES(a, b, c)'), 1) AS value;

If INSERT references columns from an outer scope then use printf() inside
the eval().
From a program, use https://sqlite.org/c3ref/load_extension.html instead of
".load".

The source of eval.c is in the SQLite source tree or
https://www.sqlite.org/src/artifact/f971962e92ebb8b0

That one is eval(X,Y) where Y is optional column separator.  If you need
the improved eval(X,Y,Z) where Z is an optional line separator, let me know
and I'll post that upgrade.

Peter


On Sat, Dec 16, 2017 at 1:04 PM, Keith Medcalf  wrote:

>
> 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.
>
> ---
> 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 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
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Odd question

2017-12-16 Thread Simon Slavin


On 16 Dec 2017, at 9:43pm, Nelson, Erik - 2  
wrote:

> 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.

Will the application recognise two statements separated by a semicolon ?  This 
happens automatically if it is using sqlite3_exec().  If it does, then you can 
do

INSERT into table1 values(1, 2, 3); SELECT 1

As if it’s a single statement and it’ll return the result of SELECT 1

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


Re: [sqlite] Odd question

2017-12-16 Thread Nelson, Erik - 2
Petern wrote on Saturday, December 16, 2017 4:53 PM
Re: Nelson "odd". This will make the desired (?) side effect happen:

>.load eval.so
>SELECT coalesce(eval('INSERT INTO table1 VALUES(a, b, c)'), 1) AS value;

>If INSERT references columns from an outer scope then use printf() inside the 
>eval().

...snip...

>That one is eval(X,Y) where Y is optional column separator.  If you need
>the improved eval(X,Y,Z) where Z is an optional line separator, let me know
>and I'll post that upgrade.

That's a great suggestion... I'm not using the sqlite shell and I don't have 
control of the application but there's a reasonable chance that eval() is 
statically compiled into the app.  I'll investigate that further.

--
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


Re: [sqlite] EXTERNAL: Re: Possibly uninitialized variables...compile time error

2017-12-16 Thread Edwards, Mark C.
Thank you. I'm looking forward to a clean build on the next release.

___
Mark C Edwards
Chief Scientist, C2 Systems Engineering & Integration
779 Monika Ct
Chubbuck, ID 83202
mark.c.edwa...@leidos.com
Mobile: 208-241-7982



-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Richard Hipp
Sent: Friday, December 15, 2017 9:42 PM
To: SQLite mailing list 
Cc: sqlite-...@mailinglists.sqlite.org
Subject: EXTERNAL: Re: [sqlite] Possibly uninitialized variables...compile time 
error

On 12/15/17, Edwards, Mark C.  wrote:
> sqlite3.c(167291): error C4703: potentially uninitialized local 
> pointer variable 'pNode' used
> sqlite3.c(168154): error C4703: potentially uninitialized local 
> pointer variable 'pRoot' used
> sqlite3.c(168160): error C4703: potentially uninitialized local 
> pointer variable 'pChild' used

All these warnings are false positives.  The variables are initialized by prior 
calls to the nodeAcquire() function.  The problem is that
nodeAcquire() does not necessarily initialize the variables, but if it does 
not, it returns a result code other than SQLITE_OK, and in those cases, the 
code that uses the variables that nodeAcquire() was suppose to have initialized 
is never reached.  Thus there is no possibility of using an uninitialized 
variable.

However, the code in question is not on a critical path.  Hence, I have now 
added extra (unnecessary) local variable initializations in the relevant RTree 
indexing routines so that these warnings should now be suppressed.

--
D. Richard Hipp
d...@sqlite.org
___
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


Re: [sqlite] Odd question

2017-12-16 Thread Nelson, Erik - 2
Simon Slavin wrote on Saturday, December 16, 2017 5:15 PM
>>On 16 Dec 2017, at 9:43pm, Nelson, Erik - 2  
>>wrote:

>> 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.

>Will the application recognise two statements separated by a semicolon ?  This 
>happens automatically if it is using sqlite3_exec().  If it does, then you can 
>do

>INSERT into table1 values(1, 2, 3); SELECT 1

>As if it’s a single statement and it’ll return the result of SELECT 1

This might work- I've never tried passing two statements in as a single 'query' 
but afaik the semicolon doesn't have any particular significance to the 
application.  I believe the application is using the prepare()/step() interface 
but it's worth a try.  Thanks for the suggestion!

--
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