Re: [sqlite] Fortran 95 Language Bindings
Gary Scott wrote: Hi, CVF initially. I will likely transition to IVF once a suitable version is released. Well, that should be easy enough - MSVC/CVF is the platform I used to develop the interface. I managed to extend the documentation on the interface last night - see http://flibs.sf.net - actually it took me an embarrassingly small amount of time to fill in the big gap I had left there. If there is anything unclear about it, let me know and I will try to fix it. Also, if you see any obvious omissions from the full SQLite API, let me know. The best way forward would be a "real" project, rather than any of the toys I have dabbled with. Regards, Arjen - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: Re: [sqlite] DELETE row problem
first,thanks for your answer. in my application, i port sqlite 3.3.12 base on the OS named OS20 supported by ST and a flash FS developed by our team. them i just open a DB(flash_db) and PRAGMA it, PRAGMA temp_store = MEMORY; PRAGMA synchronous = NORMAL; after that,i creat table(flash_tabel) CREATE TABLE flash_table ( name, id INTEGER); (in here ,"id" is the task's id) and insert a hundred of row into it in a task.by now ,everything is ok. after that,in another task ,i delete all row insert previously. "DELETE FROM flash_table WHERE id=%d ;", task_id during do that,the memory dupli-free the memory error is occur. as above showing, i never call memory free function outside of sqlite. so ,i guess the most possible reason for that is something not correct in my interface between sqlite and my flash_fs. but what puzzle me is why everything is ok except DELETE row action happen. "dszhang" < [EMAIL PROTECTED]> wrote: > when i delete some row in my table ... i find the sqlite will free > some memory that have been free[d] previous[ly]. > my question is why that thing happen and how to solve it? > SQLite should never call free() on the same piece of memory twice. If it does, that is a bug. Please report the specific version number of SQLite that you are using and what SQL statements you invoke to get it to occur. But we test very carefully for this sort of thing and no such errors have appeared in a production release in a long time. I suspect that the error is in your application code, not in SQLite. -- D. Richard Hipp < [EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Fortran 95 Language Bindings
Hi, CVF initially. I will likely transition to IVF once a suitable version is released. Arjen Markus <[EMAIL PROTECTED]> wrote: Gary Scott wrote: > > I do not possess a C compiler, so I will need an all-Fortran solution, > unless the C interface is provided as a compiled binary. > What Fortran compiler do you prefer? I can supply a precompiled C library that should be suitable for a number of Fortran compilers (CVF, IVF on Windows, g95 on Linux/MingW or gfortran on Linux/Cygwin for instance). Regards, Arjen - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] trim available ??
Dennis Cote wrote: Stef Mientki wrote: I don't know which version I'm running, how can I detect that ? Stef, You can call sqlite3_libversion (see http://www.sqlite.org/capi3ref.html#sqlite3_libversion for details). Thanks Dennis, Yes, I see now, I've 3.3.8 ;-) cheers, Stef Mientki - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] trim available ??
Liam Healy wrote: An option for versions that do not have trim is http://sqlite.org/contrib//download/extension-functions.tgz?get=17 thanks Liam, but I think it's better to recreate the database, with trimmed itesm. cheers, Stef - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Auto Vaccum and fragmentation?
Ludvig Strigeus uttered: Assuming I have an autovacuum database that primarily stores 32k blobs. If I add/remove lots of rows, will this lead to excessive fragmentation of the overflow chains, or does Sqlite do anything to try to unfragment the pages belonging to a single row? I believe auto-vacuum will simply shuffle data so as to compact free space, rather than ordering table and overflow data into contiguous regions. Hence, you'll still have fragmentation. Thanks, Ludvig -- /"\ \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \ - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] trim available ??
Stef Mientki wrote: I don't know which version I'm running, how can I detect that ? Stef, You can call sqlite3_libversion (see http://www.sqlite.org/capi3ref.html#sqlite3_libversion for details). HTH Dennis Cote - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] handling empty table in a callback function to sqlite3_exec
Hi, I'm querying a table by writing the query in sqlite3_exec with a callback function that does some operation on the resulting row. Everything is fine when the table has even one row, but when it is empty, my program halts with "segmentation fault". I can add a dummy row to the table to prevent this, but is there a nicer solution to this issue? Thanks, Rafi. sqlite3_get_table wraps sqlite3_exec and uses a callback, check it out as an example.. (or just use it instead, if possible) http://www.sqlite.org/cvstrac/fileview?f=sqlite/src/table.c&v=1.26 - Trey - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] trim available ??
An option for versions that do not have trim is http://sqlite.org/contrib//download/extension-functions.tgz?get=17 On 4/16/07, Stef Mientki <[EMAIL PROTECTED]> wrote: > The TRIM function was added on 2007-03-17 17:52:42. > Thanks, that explains .. cheers, Stef > -- > D. Richard Hipp <[EMAIL PROTECTED]> > > > Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of Commerce - trade register 41055629 - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] #define confliction
from 3.3.15, sqlite3's sources are combinded into one sqlite3.c (in sqlite-source-3_3_15.zip). when I compile this on VC++8, a warning is reported: ... It's just a warning. Ignore it. Is it a harmless warning? however, I don't wanna be surprised. hope to replace another macro such as SQLITE_ARRAYSIZE --- : -- : -- : -- : -- : --- FUKUDA, (episteme) Fumiki magical, but never a magic - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] #define confliction
"FUKUDA, Fumiki" <[EMAIL PROTECTED]> wrote: > from 3.3.15, sqlite3's sources are combinded into one sqlite3.c (in > sqlite-source-3_3_15.zip). > when I compile this on VC++8, a warning is reported: > > sqlite3.c(56983) : warning C4005: 'ARRAYSIZE' : macro re-defined. >...VC\PlatformSDK\include\winnt.h(950) : 'ARRAYSIZE' > > so I modified sqlite3.c as: > > #ifdef ARRAYSIZE > #undef ARRAYSIZE > #define ARRAYSIZE(X) (sizeof(X)/sizeof(X[0])) > #endif > > Is this correct work-around? or waht should I do to resolve this? > It's just a warning. Ignore it. -- D. Richard Hipp <[EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] trim available ??
The TRIM function was added on 2007-03-17 17:52:42. Thanks, that explains .. cheers, Stef -- D. Richard Hipp <[EMAIL PROTECTED]> Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of Commerce - trade register 41055629 - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] #define confliction
from 3.3.15, sqlite3's sources are combinded into one sqlite3.c (in sqlite-source-3_3_15.zip). when I compile this on VC++8, a warning is reported: sqlite3.c(56983) : warning C4005: 'ARRAYSIZE' : macro re-defined. ...VC\PlatformSDK\include\winnt.h(950) : 'ARRAYSIZE' so I modified sqlite3.c as: #ifdef ARRAYSIZE #undef ARRAYSIZE #define ARRAYSIZE(X) (sizeof(X)/sizeof(X[0])) #endif Is this correct work-around? or waht should I do to resolve this? --- : -- : -- : -- : -- : --- FUKUDA, (episteme) Fumiki, Japan magical, but never a magic - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] trim available ??
Stef Mientki <[EMAIL PROTECTED]> wrote: > Mohd Radzi Ibrahim wrote: > > Hi, > > I'm running 3.3.15. No problem at all. Maybe your version does not > > have this implemented yet... > > > > I use the SQLITE3.DLL dated 8 october 2006 The TRIM function was added on 2007-03-17 17:52:42. -- D. Richard Hipp <[EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] trim available ??
Mohd Radzi Ibrahim wrote: Hi, I'm running 3.3.15. No problem at all. Maybe your version does not have this implemented yet... I don't know which version I'm running, how can I detect that ? I use the SQLITE3.DLL dated 8 october 2006, but windows can't find the version info in that file. cheers, Stef Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of Commerce - trade register 41055629 - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] trim available ??
Hi, I'm running 3.3.15. No problem at all. Maybe your version does not have this implemented yet... best regards, Radzi. - Original Message - From: "Stef Mientki" <[EMAIL PROTECTED]> To: Sent: Monday, April 16, 2007 10:14 PM Subject: [sqlite] trim available ?? hello, As I read here http://www.sqlite.org/lang_expr.html there are trim functions availabel as part of an expression. But when I try to execute the next statement: SELECT App FROM PO WHERE LOWER(App_Type) = TRIM(LOWER('{ Afzuigapparaat } ')) I get the following error / ERROR ** Error executing SQL "SELECT App FROM PO WHERE LOWER(App_Type) = TRIM(LOWER('{ Afzuigapparaat } ')) " :: no such function: TRIM **/ What am I doing wrong ? thanks, Stef Mientki Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of Commerce - trade register 41055629 - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] trim available ??
hello, As I read here http://www.sqlite.org/lang_expr.html there are trim functions availabel as part of an expression. But when I try to execute the next statement: SELECT App FROM PO WHERE LOWER(App_Type) = TRIM(LOWER('{ Afzuigapparaat } ')) I get the following error / ERROR ** Error executing SQL "SELECT App FROM PO WHERE LOWER(App_Type) = TRIM(LOWER('{ Afzuigapparaat } ')) " :: no such function: TRIM **/ What am I doing wrong ? thanks, Stef Mientki Kamer van Koophandel - handelsregister 41055629 / Netherlands Chamber of Commerce - trade register 41055629 - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] SQL Close issues
Hi all, Sqlite gives an error "Unable to close due to unfinalised statements" if there are any active VM's while we try to close sqlite. Will there be any error (for eg, memory leak and others) if we don't check the condition and try to close the sqlite? The following code checks for that in sqlite3_close in main.c if( db->pVdbe ){ sqlite3Error(db, SQLITE_BUSY, "Unable to close due to unfinalised statements"); return SQLITE_BUSY; } Regards, Phani
Re: [sqlite] Fortran 95 Language Bindings
Arjen, The project I was working on was part of a larger effort to port a suite of software which included Fortran programs that connect to Oracle (using Pro*Fortran). Some of it we ported earlier by rewriting the database access portions in C. One of the alternatives to sqlite3 bindings for Fortran was to do this again. Another was to separate the db access parts out and read and write files, then use a script to do the db access. So I had to weigh the amount of work for each; I made a brief investigation of each approach to estimate how much work was involved. Looking at notes I made in October for the Fortran/sqlite direct connection, it seems I could not extract from the examples and documentation the way to do what I wanted to accomplish. I was able to do some small examples. At that point I put aside the effort entirely, coming to no conclusion on how to proceed, because there were other things to work on with higher priority. That's really all the detail that I have. Since this is now bubbling up again in priority, I can take a fresh look at how to do this.When questions come up, I will post them. Thanks for your effort and interest in developing this interface. Liam On 4/16/07, Arjen Markus <[EMAIL PROTECTED]> wrote: Liam, could you explain in some detail what you find inadequate? I know I should add more documentation, but the functions as implemented ought to be useful enough. I have not much experience with building extensive database applications, so that may show in the implementation. But I welcome comments and will revive the work on this interface. Regards, Arjen - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Fortran 95 Language Bindings
Gary Scott wrote: I do not possess a C compiler, so I will need an all-Fortran solution, unless the C interface is provided as a compiled binary. What Fortran compiler do you prefer? I can supply a precompiled C library that should be suitable for a number of Fortran compilers (CVF, IVF on Windows, g95 on Linux/MingW or gfortran on Linux/Cygwin for instance). Regards, Arjen - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Fortran 95 Language Bindings
Arjen Markus wrote: Gary Scott wrote: Liam Healy wrote: I am very interested in this for a project of increasing urgency. A few months ago I found the two links that the other emails mentioned, but found both of them inadequate and not well documented. I think a complete, documented F95 API would be very useful. I am willing to help and critique as time allows; I would be using gfortran on linux/amd64 if that makes a difference. I like Arjen's project as it mirrors my design thoughts somewhat. I am however unsure how it can be done in a compiler independent manner (I see no such markup in Arjen's work, however, so what am I missing?). The Fortran standard does not guarantee any particular argument passing mechanism. It might use pass by reference or value or register at its own choosing depending on many factors, including optimization settings. There is no standard way for the application programmer to choose. Each compiler vendor provides it's own unique method of adjusting calling mechanisms and many do not by default match C. Some compiler's are now beginning to support standard conforming mechanisms (which may not cover all cases still), but that will be rare for a year or two. I'll be out of town for the next week, hoping for approval to use SQLite in my project. Without that approval, my incenstive will be less. I do see this as an important need however. Let me first tell you that I was inspired by Al Danial's work on a FORTRAN 77 interface for SQLite. I felt however that with Fortran 95 a more generic interface would be possible and that is what I implemented. I have ample experience with combining C and Fortran routines on a variety of platforms and the concerns Gary has are taken care of in this implementation, though not in the most general way possible: - I prefer putting the compiler-dependent parts in the C code - On Windows you need to specify a particular calling convention (__stdcall), rather than the default. On UNIX and Linux there is no such distinction. I take care of that via the macro FTNCALL in csqlite.c - Various Fortran compilers use different "name mangling" schemes - the name of a routine is decorated with one and sometimes two underscores or the name is capitalised. This is taken care of in the C code but not completely. - There is also the matter of passing the implicit length of strings. This is done via the macro INBETWEEN: some Fortran compilers put the length directly after the string argument, others do it by appending these hidden arguments at the end. - Note that the C routines have interfaces that are compatitble to FORTRAN 77 (i.e. no intent, no derived types, ...) - The code should work alright on 64-bits machines (one of the things I adopted from Al's work) I do not possess a C compiler, so I will need an all-Fortran solution, unless the C interface is provided as a compiled binary. Liam, could you explain in some detail what you find inadequate? I know I should add more documentation, but the functions as implemented ought to be useful enough. I have not much experience with building extensive database applications, so that may show in the implementation. But I welcome comments and will revive the work on this interface. Regards, Arjen - To unsubscribe, send email to [EMAIL PROTECTED] - -- Gary Scott mailto:[EMAIL PROTECTED] dot net Fortran Library: http://www.fortranlib.com Support the Original G95 Project: http://www.g95.org -OR- Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html If you want to do the impossible, don't hire an expert because he knows it can't be done. -- Henry Ford - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Error by Creating a Transaction (Sorry ErrorMessage in German)
Oh no I'm so stupid , in the functions concerned has I that open the Connection forgotten. "SQLiteConn.Open()" g.. It is not a Bug in Ado.Net-Provider, it is a Bug in my Brain. CLOSED -- View this message in context: http://www.nabble.com/Error-by-Creating-a-Transaction-%28Sorry-ErrorMessage-in-German%29-tf3505300.html#a10012937 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Error by Creating a Transaction (Sorry ErrorMessage in German)
Hello, i have new information to this Error. I have make an new Projekt with a new Database. The Error begins by Create Connection: Source: Private Sub Read_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReadDB.Click Dim FileName As String = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\Test.pdb" If (Not System.IO.File.Exists(FileName)) Then MsgBox("Fehler: " + vbCrLf + "Datei: " + FileName + vbCrLf + "exestiert nicht.", MsgBoxStyle.Exclamation Or MsgBoxStyle.OkOnly, "FEHLER FileExists") End If -> Using SQLiteConn As SQLiteConnection = New SQLiteConnection("Data Source=" + FileName) Try Using SQLiteTrans As SQLiteTransaction = SQLiteConn.BeginTransaction() Try LB_Show.Items.Clear() Using sqLiteCommand As System.Data.SQLite.SQLiteCommand = SQLiteConn.CreateCommand() Dim RowCount As Integer = 0 sqLiteCommand.CommandText = "SELECT * FROM Test;" Using sqLiteDataRead As System.Data.SQLite.SQLiteDataReader = sqLiteCommand.ExecuteReader() ' vorhandene Koordinatenliste leeren While (sqLiteDataRead.Read()) RowCount += 1 LB_Show.Items.Add(sqLiteDataRead.GetString(0) + " = " + sqLiteDataRead.GetString(1)) End While LB_Show.Items.Add(RowCount.ToString + " Datensätze gelesen") End Using End Using Catch ex As Exception MsgBox("Fehler: " + vbCrLf + ex.Message, MsgBoxStyle.Exclamation Or MsgBoxStyle.OkOnly, "FEHLER Read in Transaction") SQLiteTrans.Rollback() End Try End Using SQLiteConn.Close() Catch ex As Exception MsgBox("Fehler: " + vbCrLf + ex.Message, MsgBoxStyle.Exclamation Or MsgBoxStyle.OkOnly, "FEHLER Read in Connection") End Try End Using End Sub I'm set a Breakpoint to the Code on "Using SQLiteConn As SQLiteConnection = N..." and the codemonitoring in VS get the following Information SQLiteConn = {System.Data.SQLite.SQLiteConnection} + ServerVersion = {"Der Vorgang ist aufgrund des aktuellen Zustands des Objekts ungültig."} ++Data = {System.Collections.ListDictionaryInternal} ++Message = "Der Vorgang ist aufgrund des aktuellen Zustands des Objekts ungültig." ++Source = "System.Data.SQLite" ++StackTrace = " bei System.Data.SQLite.SQLiteConnection.get_ServerVersion()" The "System.Data.SQLite.SQLiteConnection.get_ServerVersion()" make the Exception ?! And "BeginTransaction()" throw the Exception ?! regards Mario -- View this message in context: http://www.nabble.com/Error-by-Creating-a-Transaction-%28Sorry-ErrorMessage-in-German%29-tf3505300.html#a10012034 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Fortran 95 Language Bindings
Gary Scott wrote: Liam Healy wrote: I am very interested in this for a project of increasing urgency. A few months ago I found the two links that the other emails mentioned, but found both of them inadequate and not well documented. I think a complete, documented F95 API would be very useful. I am willing to help and critique as time allows; I would be using gfortran on linux/amd64 if that makes a difference. I like Arjen's project as it mirrors my design thoughts somewhat. I am however unsure how it can be done in a compiler independent manner (I see no such markup in Arjen's work, however, so what am I missing?). The Fortran standard does not guarantee any particular argument passing mechanism. It might use pass by reference or value or register at its own choosing depending on many factors, including optimization settings. There is no standard way for the application programmer to choose. Each compiler vendor provides it's own unique method of adjusting calling mechanisms and many do not by default match C. Some compiler's are now beginning to support standard conforming mechanisms (which may not cover all cases still), but that will be rare for a year or two. I'll be out of town for the next week, hoping for approval to use SQLite in my project. Without that approval, my incenstive will be less. I do see this as an important need however. Let me first tell you that I was inspired by Al Danial's work on a FORTRAN 77 interface for SQLite. I felt however that with Fortran 95 a more generic interface would be possible and that is what I implemented. I have ample experience with combining C and Fortran routines on a variety of platforms and the concerns Gary has are taken care of in this implementation, though not in the most general way possible: - I prefer putting the compiler-dependent parts in the C code - On Windows you need to specify a particular calling convention (__stdcall), rather than the default. On UNIX and Linux there is no such distinction. I take care of that via the macro FTNCALL in csqlite.c - Various Fortran compilers use different "name mangling" schemes - the name of a routine is decorated with one and sometimes two underscores or the name is capitalised. This is taken care of in the C code but not completely. - There is also the matter of passing the implicit length of strings. This is done via the macro INBETWEEN: some Fortran compilers put the length directly after the string argument, others do it by appending these hidden arguments at the end. - Note that the C routines have interfaces that are compatitble to FORTRAN 77 (i.e. no intent, no derived types, ...) - The code should work alright on 64-bits machines (one of the things I adopted from Al's work) Liam, could you explain in some detail what you find inadequate? I know I should add more documentation, but the functions as implemented ought to be useful enough. I have not much experience with building extensive database applications, so that may show in the implementation. But I welcome comments and will revive the work on this interface. Regards, Arjen - To unsubscribe, send email to [EMAIL PROTECTED] -