Re: [sqlite] Retrieve INTEGER PRIMARY KEY

2017-02-05 Thread Hick Gunter
But only if you can guarantee that your statement inserts exactly one record 
and that nothing is executed on your connection between the insert and the call.

-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Chris Locke
Gesendet: Freitag, 03. Februar 2017 15:41
An: SQLite mailing list 
Betreff: Re: [sqlite] Retrieve INTEGER PRIMARY KEY

Last_insert_rowid()

https://www.sqlite.org/c3ref/last_insert_rowid.html

On Fri, Feb 3, 2017 at 1:51 PM, Clyde Eisenbeis  wrote:

> For OLE DB SQL, I have retrieved the primary key:
>
> -
>   using (System.Data.OleDb.OleDbConnection oledbConnect = new
> System.Data.OleDb.OleDbConnection(stConnectString))
>   {
> using (System.Data.OleDb.OleDbCommand oledbCmd =
> oledbConnect.CreateCommand())
> {
>   ...
>   oledbCmd.ExecuteNonQuery();
>   //Retrieve the ID
>   oledbCmd.CommandText = "Select @@Identity";
>   int iKeyID = (int)oledbCmd.ExecuteScalar();
>   stKeyID = iKeyID.ToString();
> -
>
> What is the correct nomenclature for SQLite?
> ___
> 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


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


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


Re: [sqlite] sqlite3.def mismatch for Windows x86 and x64 dll

2017-02-05 Thread Jan Nijtmans
2017-02-04 10:49 GMT+01:00 Rengui Xie:
> Hi dear sqlite developers,
>
> In the downlaod page for "Precompiled Binaries for Windows", the
> sqlite3.def EXPORTS for x86 and x64 dll are not the same, x64 dll have 4
> more export functions:
>  - sqlite3_data_directory
>  - sqlite3_fts5_may_be_corrupt
>  - sqlite3_temp_directory
>  - sqlite3_version

Actually, those are not functions, those are external symbols. Windows
Dll's have problems exporting data symbols, that why the mingw-built x86
dll doesn't have them exported. Later Microsoft compilers can handle
them fine, that's why the VC-built x64 dll exports them.

> I assume x86 and x64 dll shall have the same EXPORTS.
> This issue, if it is, exists in latest v3.16.2 and earlier v3.13.0 (maybe
> even more earlier version, I did not check more old version).

None of those 4 symbols are expected to be used from applications,
so whether those are exported or not doesn't really matter.

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


Re: [sqlite] SQLite3 Pros / Cons

2017-02-05 Thread Jens Alfke

> On Feb 5, 2017, at 5:27 AM, Clyde Eisenbeis  wrote:
> 
> I posted "[sqlite] Retrieve INTEGER PRIMARY KEY" a few days ago.  The
> only solution proposed appears to use sqlite3.

I think you’re confusing sqlite3 the library with its C API.

You’re _already_ using the sqlite3 library, in the form of a .NET library that 
wraps around it providing a C# API.
What you’re saying here is that the solution for your problem requires calling 
the C API, because there’s no C# API equivalent to it.
I don’t know if that’s true or not … but it’s going to be easier to discuss the 
issue if you use terminology that makes sense to us.

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


Re: [sqlite] Retrieve INTEGER PRIMARY KEY

2017-02-05 Thread J Decker
http://data.sqlite.org/c3ref/last_insert_rowid.html

there is an api call to get it; or you can use select and get it

the .net library has it as a connection property  LastInsertRowId

https://www.crestron.com/reference/simpl_sharp/html/P_Crestron_SimplSharp_SQLite_SQLiteConnection_LastInsertRowId.htm

On Sun, Feb 5, 2017 at 5:54 AM, Simon Slavin  wrote:

>
> On 5 Feb 2017, at 1:26pm, Clyde Eisenbeis  wrote:
>
> > The compiler complains about "SELECT last_insert_rowid()" ... which
> > appears to be limited to SQLite3.
>
> The compiler should never have got that string.  The string is executed
> when the program is already compiled, just like any other SELECT command.
>
> Find some context where you can execute any other SELECT command, and use
> "last_insert_rowid()" as a column name.
>
> 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] Retrieve INTEGER PRIMARY KEY

2017-02-05 Thread Simon Slavin

On 5 Feb 2017, at 1:26pm, Clyde Eisenbeis  wrote:

> The compiler complains about "SELECT last_insert_rowid()" ... which
> appears to be limited to SQLite3.

The compiler should never have got that string.  The string is executed when 
the program is already compiled, just like any other SELECT command.

Find some context where you can execute any other SELECT command, and use 
"last_insert_rowid()" as a column name.

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


Re: [sqlite] SQLite3 Pros / Cons

2017-02-05 Thread Clyde Eisenbeis
This is good information!

I posted "[sqlite] Retrieve INTEGER PRIMARY KEY" a few days ago.  The
only solution proposed appears to use sqlite3.

On Sat, Feb 4, 2017 at 5:34 PM, Joe Mistachkin  wrote:
>
> Random Coder wrote:
>>
>> And in case it's not obvious: System.Data.Sqlite _is_ sqlite3
>>
>
> To clarify and expand upon the above reply:
>
> System.Data.SQLite is an ADO.NET based managed wrapper around the
> SQLite.
>
> It includes the SQLite core library, compiled with a few extra
> options and loadable extensions, and some extra code to help it
> integrate better with the .NET Framework.  The file name for the
> native portions of System.Data.SQLite (also known as the "interop
> assembly") is typically "SQLite.Interop.dll" (i.e. this file name
> is used instead of "sqlite3.dll" by the P/Invoke integration).
>
> --
> Joe Mistachkin @ https://urn.to/r/mistachkin
>
> ___
> 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] Retrieve INTEGER PRIMARY KEY

2017-02-05 Thread Clyde Eisenbeis
The compiler complains about "SELECT last_insert_rowid()" ... which
appears to be limited to SQLite3.  Perhaps I'm missing something?

On Sat, Feb 4, 2017 at 10:28 AM, Wolfgang Enzinger  wrote:
> Am Sat, 4 Feb 2017 09:04:58 -0600 schrieb Clyde Eisenbeis:
>
>> When I enter last_insert_rowid(), the compiler complains.  I think
>> last_insert_rowid() is SQLite3.
>>
>> Is there an equivalent for System.Data.SQLite?
>
> I don't know, but you can use the SQL function of the same name:
> https://www.sqlite.org/lang_corefunc.html#last_insert_rowid
>
> SELECT last_insert_rowid();
>
> HTH, Wolfgang
>
> ___
> 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] Transactions

2017-02-05 Thread Clemens Ladisch
Michele Pradella wrote:
> I have a question about transactions and SQLite:

http://www.sqlite.org/faq.html#q19


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


[sqlite] Transactions

2017-02-05 Thread Michele Pradella
Hi all, I have a question about transactions and SQLite: 

Do you think transactions are useful only when you have to do a sequence
of statements that depends on each other and you need a way to rollback
all statements if something goes wrong? or you can use transactions even
with not interdependent statements for performance reason? and if yes do
you think there's a trade-off about the number of query number in each
transaction? 

I'm think about 1000 INSERT query to execute, is transaction works
better because you do not have to change index at any insert but just
one time on commit?
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users