Re: [sqlite] Embedded SQL in C

2007-05-27 Thread Leif Jensen
  That sounds very interesting. Could you please elaborate a little 
more on that ?


Leif


John Stanton wrote:
The Sqlite BIND capability makes implementing an embedded SQl 
interface quite a simple operation.


We use embedded SQL with Sqlite but do it within a proprietary 
language.  It was almost trivial to implement.


Leif Jensen wrote:

 Hi,

  In a larger project we are using PostgreSQL database and Embedded 
SQL in C (using ECPG) in a server daemon. We would like to be able to 
have this to work with SQLite for a stand-alone application. The 
Embedded SQL in C standard is as used by Oracle (and former Informix) 
and of course PostgreSQL.


  Does anyone know of an Embedded SQL in C (pre-compiler/interface) 
that will work with SQLite ?


Leif


- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Embedded SQL in C

2007-05-27 Thread Leif Jensen
  Thank you for your ideas. I thought about the "fake" library myself 
even though our project is more like 20 - 30k lines, but I'm not sure 
how bad it would be. I'm aware of the SQL dialects, but we have tried to 
make a point of using "standard" SQL syntax. Of course we might have to 
develop some triggers/functions that are not available in SQLite at the 
moment.


  I was hoping someone had already done something along these lines before.

Leif


Joe Wilson wrote:

--- Leif Jensen <[EMAIL PROTECTED]> wrote:
  
   In a larger project we are using PostgreSQL database and Embedded SQL 
in C (using ECPG) in a server daemon. We would like to be able to have this to work with 
SQLite for a stand-alone application. The Embedded SQL in C standard is 
as used by Oracle (and former Informix) and of course PostgreSQL.


   Does anyone know of an Embedded SQL in C (pre-compiler/interface) 
that will work with SQLite ?



I am not aware of such a pre-compiler for SQLite.

If your project is quite large (100,000+ lines of code) then porting 
PostgreSQL's embedded C compiler ECPG to SQLite may be a viable alternative.


 http://doxygen.postgresql.org/dir_45ac211730e8147f7f879781af2b8b2a.html

The main porting effort would be in the ecpglib/ directory, mapping all
PQ-prefixed postgres functions and the PG-prefixed data structures to their 
SQLite equivalents.


 http://doxygen.postgresql.org/dir_9bd0bfe8893f57601e39e3093fd54938.html

A possibly simpler approach may be to construct a "fake" libpq library for 
use by the PostgreSQL ECPG program that does all the mappings to/from sqlite3.
You'd only have to support the subset of libpq functions actually used 
by ECPG.


But even if you did such a port using either approach, be aware that the 
SQL dialects of Postgres and SQLite are not the same - you'd likely have 
to change some of the embedded SQL statements in your code.




   
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222


-
To unsubscribe, send email to [EMAIL PROTECTED]
-


  


[sqlite] Embedded SQL in C

2007-05-27 Thread Leif Jensen

 Hi,

  In a larger project we are using PostgreSQL database and Embedded SQL 
in C (using ECPG) in a server daemon. We would like to be able to have this to work with 
SQLite for a stand-alone application. The Embedded SQL in C standard is 
as used by Oracle (and former Informix) and of course PostgreSQL.


  Does anyone know of an Embedded SQL in C (pre-compiler/interface) 
that will work with SQLite ?


Leif


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] ANN: Sqlite3Explorer

2005-04-04 Thread Leif Jensen
   Have you heard about wxWidgets (www.wxWidgets.org) ? A great free 
GUI library (and much more) that works on Windows, Linux and Mac (at 
least). Using that and your app. would do too  ;-). I have just made a 
database application with these that runs on both Linux and Windows 
using SQLite3.

Leif
Cariotoglou Mike wrote:
[EMAIL PROTECTED] it seems the new controls I used require this function, which 
only
exists in win2k+. sorry for this, I think I will rebuild *without* the
devexpress controls, for more genral purpose use..
 

-Original Message-
From: Serge Liber [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 04, 2005 8:30 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] ANN: Sqlite3Explorer

Hi,
When starting sqlite3Explorer an error message appears:
"The procedure entry point GdiGradientFill could not be 
located in the dll GDI32.dll"

How can I proceed?
I use NT4+sp6
Serge Liber
New version is out. Since the problem with size limits was 
not lifted from contrib, I created a home site for the 
program. You will now be able to get latest version from

http://www.singular.gr/sqlite
Latest is 1.1 , 24/3/2005 (ignore the typo in the date)
Regards,mike

   


 



Re: [sqlite] ANN: Sqlite3Explorer

2005-03-29 Thread Leif Jensen
  Any chance for  a Linux version ?   Or a web version ?
  Greetings,
Leif
Cariotoglou Mike wrote:
New version is out. Since the problem with size limits was not lifted
from contrib, I created a home site for the program. You will now be
able to get latest version from
http://www.singular.gr/sqlite
Latest is 1.1 , 24/3/2005 (ignore the typo in the date)
Regards,mike
 



Re: [sqlite] Row count after prepare

2005-03-15 Thread Leif Jensen
  Hi Marcelo,
  It would, but I don't know the contents of the SQL at the point where 
I need get the row count, so I would have to scan the statement. Putting 
in the extra 'count(*)' all over is not really possible.

  Does anyone know the timing of  a sqlite3_step() compared to 
sqlite3_step() + sqlite_column_() ?

Leif
Marcelo Zamateo wrote:
Hi Leif:
Will "Select Count(*) from (Your_SQL)" give you what you want?
Be careful if Your_SQL includes Group By clause, don't know if work 
as  expected.
Marcelo





Re: [sqlite] Row count after prepare

2005-03-15 Thread Leif Jensen
  Hi Dan,
 Ah yes, of course  (I knew this was a newbie question ;-) ). So I 
guess I will have to use sqlite3_get_table in this case.

 Thank you for the enlightment,
Leif
Dan Kennedy wrote:
--- Leif Jensen <[EMAIL PROTECTED]> wrote:
 

   Hi All,
   I'm quite new to SQLite, but like it very much.
  I am trying it out for an existing applicationm which seems good, but 
I have one problem:

  How do I get the number of rows in the result set after having called 
sqlite3_prepare( ... ) ? Of course I could call sqlite3_step() until no 
more rows are returned, but isn't there a better way ?
   

It can't be done. Calling sqlite3_prepare() just compiles the SQL to 
bytecode
(see the EXPLAIN command). It doesn't actually read any data from the database
file (except maybe the schema from sqlite_master).
Dan.


		
__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

 



[sqlite] Row count after prepare

2005-03-14 Thread Leif Jensen
   Hi All,
   I'm quite new to SQLite, but like it very much.
  I am trying it out for an existing applicationm which seems good, but 
I have one problem:

  How do I get the number of rows in the result set after having called 
sqlite3_prepare( ... ) ? Of course I could call sqlite3_step() until no 
more rows are returned, but isn't there a better way ?

 Thanks,
Leif