[sqlite] Giveaway of Software that uses Sqlite!

2004-04-01 Thread Allan Edwards
Hey guys!

Just wanted to let all of you know that http://www.osnews.com is going to be
giving away a free Enterprise edition of our Software Defect Tracking system
Enterprise Edition that utilizes Sqlite for data storage.  They will have a
competition for the free giveaway starting Monday April 5th.  The package
will include the Enterprise Server and the enough enterprise clients for
each user of the winning group.  The personal edition of our software is
available for trial download if you want to see the product.

Also, next week we are going to post an evaluation of our server that uses
Sqlite as the data store. A lot of questions run on this group asking about
concurrency.  Well, once we get our software out, feel free to come and
download and test it out.  If anyone has any questions on how we did this,
feel free to shoot us questions.  We would be glad to help you out on your
systems (of course in .NET).

Thanks,

Allan

Aspire Managed Solutions, Inc.
http://www.aspire.ws
http://store.aspire.ws

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] sqlite with borland c builder

2004-04-01 Thread Nuno Lucas
Make sure you compile the dll (if you are compiling a dll, offcourse) with the C 
calling convention. I'm not sure now, but if I remember correctly that is not the 
default for the Borland compiler.
Other cause could be not linking with the import library, but that is basic.

Just my two cents. I don't work with a borland compiler anymore.

Regards,
~Nuno Lucas

=== On 2004-04-02, Roy Black wrote ===
>Hello,
>
>I would like to develop some applications with sqlite. I am using Borland C
>builder 6 for these purposes. I was trying to compile/install sqlite for
>Borland C builder 6 (Windows) without success. I followed the instructions
>at http://www.sqlite.org/cvstrac/wiki?p=HowToCompile but got the same.
>I think I missed some thing important but don't know what. Each time I build
>a sample code I get such an error:
>Linker Error: Unresolved external reference _sqlite_open
>
>If you know how to deal with this issue please let me know, the more details
>the better (I'm a newbie)
>
>Thank you for your attention.
>
>Roy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] sqlite with borland c builder

2004-04-01 Thread Nuno Lucas
Make sure you compile the dll (if you are compiling a dll, offcourse) with the C 
calling convention. I'm not sure now, but if I remember correctly that is not the 
default for the Borland compiler.
Other cause could be not linking with the import library, but that is basic.

Just my two cents. I don't work with a borland compiler anymore.

Regards,
~Nuno Lucas

=== On 2004-04-02, Roy Black wrote ===
>Hello,
>
>I would like to develop some applications with sqlite. I am using Borland C
>builder 6 for these purposes. I was trying to compile/install sqlite for
>Borland C builder 6 (Windows) without success. I followed the instructions
>at http://www.sqlite.org/cvstrac/wiki?p=HowToCompile but got the same.
>I think I missed some thing important but don't know what. Each time I build
>a sample code I get such an error:
>Linker Error: Unresolved external reference _sqlite_open
>
>If you know how to deal with this issue please let me know, the more details
>the better (I'm a newbie)
>
>Thank you for your attention.
>
>Roy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] sqlite with borland c builder

2004-04-01 Thread Roy Black
Hello,

I would like to develop some applications with sqlite. I am using Borland C
builder 6 for these purposes. I was trying to compile/install sqlite for
Borland C builder 6 (Windows) without success. I followed the instructions
at http://www.sqlite.org/cvstrac/wiki?p=HowToCompile but got the same.
I think I missed some thing important but don't know what. Each time I build
a sample code I get such an error:
Linker Error: Unresolved external reference _sqlite_open

If you know how to deal with this issue please let me know, the more details
the better (I'm a newbie)

Thank you for your attention.

Roy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Concurrency Proposal

2004-04-01 Thread ben . carlyle
G'day,





"D. Richard Hipp" <[EMAIL PROTECTED]>
31/03/2004 01:21 PM

 
To: [EMAIL PROTECTED]
cc: 
Subject:Re: [sqlite] Concurrency Proposal


> I think the gist of Ben's proposal is as follows
> (please correct me if I am wrong):
> Writes do not modify the main database file until
> they are ready to commit - meaning that reader can
> continue to read from the file during lengthy
> transactions.  The journal contains modified pages,
> not the original pages, and is thus a roll-forward
> journal rather than a roll-back journal.

I think it's worth my posting a suggestion from a co-worker of mine who 
may be known to some if only by his surname :) He posed the obvious 
question as to why the transaction is so long in the first place. My 
personal answer was that I have a transaction I keep open for a second at 
a time, in case more change come through. That way I get maximum 
throughput while retaining the consistency guarantee that journaling 
provides.

His alternative proposal for my situation is simple: Buffer the changes, 
instead of holding a transaction open. This is something my code could do 
fairly easily and I'm a bit disappointed I didn't think of it :) If I ever 
get around to changing the code, I'll have it keep a fixed-size buffer of 
changes. Whenever the buffer fills, or one second passes since the first 
buffer entry was inserted, I'll flush the buffer with a transaction.

Maybe long write transactions concurrent with readers is a requirement for 
sqlite, but I'm not so sure it's my requirement anymore. Perhaps this 
simple suggestion will make it a requirement for fewer current sqlite 
mailing list users, too ;)

Benjamin.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Group by only returning one row when source table is sub-query or view

2004-04-01 Thread Greg Obleshchuk
Hi Richard,
It is a bit more than that for me anyway.  I have several complex views which are 
using grouping within the view themselves.  At the moment I have no other way of 
summarising the results of these views apart from inserting the results into a temp 
table and then processing the temp table, which is slow.

Greg.
  - Original Message - 
  From: D. Richard Hipp 
  Cc: [EMAIL PROTECTED] 
  Sent: Friday, April 02, 2004 8:28 AM
  Subject: Re: [sqlite] Group by only returning one row when source table is sub-query 
or view


  Greg Obleshchuk wrote:
   >
   > I posted a bug ticket a few days ago (ticket 678) regarding group by only
   > returning one row if the source was a subquery or view.  I was wonder if
   > anyone could confirm the bug and how long would a fix take?  (I'm not in a
   > position to create a fix)
   >
   > http://www.sqlite.org/cvstrac/tktview?tn=678,2
   >

  It might be a bug, or it might not.  What seems clear is that
  it is not something that can't be worked around easily, so it
  is not a high priority.  I'll look at it when I get a chance.

  -- 
  D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565


  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] Group by only returning one row when source table is sub-query or view

2004-04-01 Thread D. Richard Hipp
Greg Obleshchuk wrote:
>
> I posted a bug ticket a few days ago (ticket 678) regarding group by only
> returning one row if the source was a subquery or view.  I was wonder if
> anyone could confirm the bug and how long would a fix take?  (I'm not in a
> position to create a fix)
>
> http://www.sqlite.org/cvstrac/tktview?tn=678,2
>
It might be a bug, or it might not.  What seems clear is that
it is not something that can't be worked around easily, so it
is not a high priority.  I'll look at it when I get a chance.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] Sorry for the repeated reply

2004-04-01 Thread aducom
Something terrible went wrong here. Again sorry.

Albert

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] Using sqlite with C++Builder6

2004-04-01 Thread aducom
If you know how to apply Delphi components into C++Builder then you 
might give the components of sqlite.aducom.com a try.
Albert

> I have it working under Windows 2000 using BCB 6.
> 
> -Original Message-
> From: Eli Wheaton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 01, 2004 4:47 PM
> To: [EMAIL PROTECTED]
> Subject: [sqlite] Using sqlite with C++Builder6
> 
> 
> Hi All,
> 
> I'm having a problem trying to get SQLite to work with a C++Builder6
> project.
> Does anyone have any advice on how to do this?
> 
> OS: Windows XP
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] Using sqlite with C++Builder6

2004-04-01 Thread aducom
If you know how to apply Delphi components into C++Builder then you 
might give the components of sqlite.aducom.com a try.
Albert

> I have it working under Windows 2000 using BCB 6.
> 
> -Original Message-
> From: Eli Wheaton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 01, 2004 4:47 PM
> To: [EMAIL PROTECTED]
> Subject: [sqlite] Using sqlite with C++Builder6
> 
> 
> Hi All,
> 
> I'm having a problem trying to get SQLite to work with a C++Builder6
> project.
> Does anyone have any advice on how to do this?
> 
> OS: Windows XP
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] Using sqlite with C++Builder6

2004-04-01 Thread aducom
If you know how to apply Delphi components into C++Builder then you 
might give the components of sqlite.aducom.com a try.
Albert

> I have it working under Windows 2000 using BCB 6.
> 
> -Original Message-
> From: Eli Wheaton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 01, 2004 4:47 PM
> To: [EMAIL PROTECTED]
> Subject: [sqlite] Using sqlite with C++Builder6
> 
> 
> Hi All,
> 
> I'm having a problem trying to get SQLite to work with a C++Builder6
> project.
> Does anyone have any advice on how to do this?
> 
> OS: Windows XP
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] Using sqlite with C++Builder6

2004-04-01 Thread aducom
If you know how to apply Delphi components into C++Builder then you 
might give the components of sqlite.aducom.com a try.
Albert

> I have it working under Windows 2000 using BCB 6.
> 
> -Original Message-
> From: Eli Wheaton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 01, 2004 4:47 PM
> To: [EMAIL PROTECTED]
> Subject: [sqlite] Using sqlite with C++Builder6
> 
> 
> Hi All,
> 
> I'm having a problem trying to get SQLite to work with a C++Builder6
> project.
> Does anyone have any advice on how to do this?
> 
> OS: Windows XP
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] Using sqlite with C++Builder6

2004-04-01 Thread aducom
If you know how to apply Delphi components into C++Builder then you 
might give the components of sqlite.aducom.com a try.
Albert

> I have it working under Windows 2000 using BCB 6.
> 
> -Original Message-
> From: Eli Wheaton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 01, 2004 4:47 PM
> To: [EMAIL PROTECTED]
> Subject: [sqlite] Using sqlite with C++Builder6
> 
> 
> Hi All,
> 
> I'm having a problem trying to get SQLite to work with a C++Builder6
> project.
> Does anyone have any advice on how to do this?
> 
> OS: Windows XP
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Group by only returning one row when source table is sub-query or view

2004-04-01 Thread Greg Obleshchuk
Hi ,
I posted a bug ticket a few days ago (ticket 678) regarding group by only returning 
one row if the source was a subquery or view.  I was wonder if anyone could confirm 
the bug and how long would a fix take?  (I'm not in a position to create a fix)

http://www.sqlite.org/cvstrac/tktview?tn=678,2

regards
Greg

Re: [sqlite] Solicitation for linking table design suggestions

2004-04-01 Thread D. Richard Hipp
Stephen Blake wrote:
 
This is fine, but I'd like to use something smaller, i.e. the rowid. I
understand that if I .dump the tables, the rowid's will change. Is it
possible to force them to be the same, for example, by doing something
like this (forgive errors, I hope you get the idea):

SELECT 'INSERT INTO t1 (rowid, sha1) VALUES (' ||
rowid || ',' || sha1 || ')' FROM t1;
1.  An INTEGER PRIMARY KEY column is really just an alias for
the rowid.  So if you make your primary key an INTEGER PRIMARY
key, your rowid will be preserved by .dump.
2.  You can also do it using the select above, with some minor
changes:
  SELECT 'INSERT INTO t1(rowid,sha1) VALUES(' || rowid || ','
|| quote(sha1) || ');' FROM t1;
   ^^^  ^
The (undocumented) quote function puts the string inside single-quotes
if it needs it.  And you need a semicolon at the end of the statement.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] Solicitation for linking table design suggestions

2004-04-01 Thread Stephen Blake
Hi all,

I'm fairly new to SQLite and loving it, thanks to Mr. Hipp and everyone
else who makes it happen. My previous database experience is all in
Oracle, but I hope you won't hold that against me. ;-)

I need to create a table to link two tables that look somewhat like
this:

CREATE TABLE t1
(
  sha1 VARCHAR(40) NOT NULL PRIMARY KEY,
  --- ...
  --- other stuff
);

CREATE TABLE t2
(
  sha1 VARCHAR(40) NOT NULL PRIMARY KEY,
  --- ...
  --- other stuff
);

I need to link these two with items in a one to many relationship from
t2 back to t1. The obvious way to do it would be:

CREATE TABLE t2_t1_link
(
  t2_sha1 VARCHAR(40) NOT NULL REFERENCES t2(sha1),
  t1_sha1 VARCHAR(40) NOT NULL REFERENCES t1(sha1)
);

(By the way, I understand that these fk references don't work, but I'd
like to have them there as descriptive.)
 
This is fine, but I'd like to use something smaller, i.e. the rowid. I
understand that if I .dump the tables, the rowid's will change. Is it
possible to force them to be the same, for example, by doing something
like this (forgive errors, I hope you get the idea):

SELECT 'INSERT INTO t1 (rowid, sha1) VALUES (' ||
rowid || ',' || sha1 || ')' FROM t1;

Same for t2.

And then running those into another database? If not, any other ideas?

Thanks,
Stephen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] erroneous assert or bug

2004-04-01 Thread D. Richard Hipp
Michael Hunley wrote:
I am getting an assertion in the following code because pTos->flags is 
set to 0x26, which translates into MEM_Static | MEM_Str | MEM_Int.  The 
value on the top of the stack is 1024.  pTos->i is correctly 1024.  It 
is being used in an expression "UPDATE DBPrefs set 
Preferences=Preferences&(~1024);".  I am using sqlite 2.8.11 under windows.

case OP_BitNot: {
  assert( pTos>=p->aStack );
  if( pTos->flags & MEM_Null ) break;  /* Do nothing to NULLs */
  Integerify(pTos);
  assert( pTos->flags==MEM_Int );
  pTos->i = ~pTos->i;
  break;
}
So, should the assert be changed to:
  assert( (pTos->flags&MEM_Int)!=0 );
Or is the code that is setting the top-of-stack flags incorrectly 
setting more than just MEM_Int?

It appears that it is just a bad assert, but...

See http://www.sqlite.org/cvstrac/chngview?cn=1283

--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] erroneous assert or bug

2004-04-01 Thread Michael Hunley
I am getting an assertion in the following code because pTos->flags is set 
to 0x26, which translates into MEM_Static | MEM_Str | MEM_Int.  The value 
on the top of the stack is 1024.  pTos->i is correctly 1024.  It is being 
used in an expression "UPDATE DBPrefs set 
Preferences=Preferences&(~1024);".  I am using sqlite 2.8.11 under windows.

case OP_BitNot: {
  assert( pTos>=p->aStack );
  if( pTos->flags & MEM_Null ) break;  /* Do nothing to NULLs */
  Integerify(pTos);
  assert( pTos->flags==MEM_Int );
  pTos->i = ~pTos->i;
  break;
}
So, should the assert be changed to:
  assert( (pTos->flags&MEM_Int)!=0 );
Or is the code that is setting the top-of-stack flags incorrectly setting 
more than just MEM_Int?

It appears that it is just a bad assert, but...

Michael Hunley
Senior Engineer
PocketPurchase, Inc.  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] va_list

2004-04-01 Thread Christian Smith
On Thu, 1 Apr 2004, eno wrote:

>Greg Obleshchuk wrote:
>
>> Hi Chris,
>> Thanks for your reply.
>> I do have a different way of handling it in C# but I am passing the call on to the 
>> sqlite_vmprintf function (in printf.c and that accepts a va_list)
>> The way around it that I use is having a switch statement and if the use passes one 
>> parameter the I calls sqlite_vmprintf with one parame , if two it calls it with two 
>> and so on.  If I could build a va_list then I would built it and just call 
>> sqlite_vmprintf once.
>
>Hi Greg,
>
>it *might* work building up a (CPU-)stack-like structure holding all the
>parameters, which, of course should be only int's and const char*. To
>outline this, have a look at this example, which is C++:
>
 
>
>   // now we put the values on to a pseudo "stack".
>   // Create a va_arg for the first parameter. In the downward
>   // growing scenario this is at p + (v.size()-1)*el
>   va_list ap;
>   va_start(ap, (int&)(p + (v.size()-1)*el));
>
>   // now do whatever you want...
>}
>
>well, above code is what I would try... and of course, it is fully
>nonportable. Maybe I would consider not using sqlite_vmprintf)( at all.

If all he is doing is building up a string, surely he'd be better off
using C# to do that, and treating the string as atomic.

>
>/eno
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

-- 
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] Using sqlite with C++Builder6

2004-04-01 Thread Drew, Stephen
I have it working under Windows 2000 using BCB 6.

-Original Message-
From: Eli Wheaton [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 01, 2004 4:47 PM
To: [EMAIL PROTECTED]
Subject: [sqlite] Using sqlite with C++Builder6


Hi All,

I'm having a problem trying to get SQLite to work with a C++Builder6
project.
Does anyone have any advice on how to do this?

OS: Windows XP



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Using sqlite with C++Builder6

2004-04-01 Thread Eli Wheaton
Hi All,

I'm having a problem trying to get SQLite to work with a C++Builder6
project.
Does anyone have any advice on how to do this?

OS: Windows XP



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] va_list

2004-04-01 Thread eno
right after hitting send I found a line missing and some typo.
//
// The stack, as we are used to it, grows downwards.
// If it wouldn't we had to use begin()/end() here.
Values::const_reverse_iterator it = v.rbegin();
Values::const_reverse_iterator end = v.rend();
while(it != end) {
switch(it->type) {
case value::Int:
*(int*)d = it->i;
break;
case value::String:
*(char*)d = it->s.c_str();
break;
}
++it;
}
should read

 //
 // The stack, as we are used to it, grows downwards.
 // If it wouldn't we had to use begin()/end() here.
 Values::const_reverse_iterator it = v.rbegin();
 Values::const_reverse_iterator end = v.rend();
 char* d = p;
 while(it != end) {
 switch(it->type) {
 case value::Int:
 *(int*)d = it->i;
 break;
 case value::String:
 *(const char**)d = it->s.c_str();
 break;
 }
 ++it;
 d += el;
 }
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] va_list

2004-04-01 Thread eno
Greg Obleshchuk wrote:

Hi Chris,
Thanks for your reply.  
I do have a different way of handling it in C# but I am passing the call on to the sqlite_vmprintf function (in printf.c and that accepts a va_list)
The way around it that I use is having a switch statement and if the use passes one parameter the I calls sqlite_vmprintf with one parame , if two it calls it with two and so on.  If I could build a va_list then I would built it and just call sqlite_vmprintf once.
Hi Greg,

it *might* work building up a (CPU-)stack-like structure holding all the 
parameters, which, of course should be only int's and const char*. To 
outline this, have a look at this example, which is C++:

struct value {
enum Type { Int, String } type;
int i;
std::string s;
};
typedef vector Values;

void run_vprintf(const char* fmt, const Values& v)
{
//
// The size of a single element
unsigned el = max(sizeof(int), sizeof(char*);
//
// allocate a memory block for all values in v.
// Will be freed automatically on return
char* p = (char*) alloca(v.size() * el);

//
// The stack, as we are used to it, grows downwards.
// If it wouldn't we had to use begin()/end() here.
Values::const_reverse_iterator it = v.rbegin();
Values::const_reverse_iterator end = v.rend();
while(it != end) {
switch(it->type) {
case value::Int:
*(int*)d = it->i;
break;
case value::String:
*(char*)d = it->s.c_str();
break;
}
++it;
}
// now we put the values on to a pseudo "stack".
// Create a va_arg for the first parameter. In the downward
// growing scenario this is at p + (v.size()-1)*el
va_list ap;
va_start(ap, (int&)(p + (v.size()-1)*el));
// now do whatever you want...
}
well, above code is what I would try... and of course, it is fully
nonportable. Maybe I would consider not using sqlite_vmprintf)( at all.
/eno

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] Réf. : Re: [sqlite] single quote protection

2004-04-01 Thread Gregory Letellier






 thx for your help 
 
 
---Message original---
 

De : Tito Ciuro
Date : 04/01/04 14:24:31
A : Gregory Letellier
Cc : [EMAIL PROTECTED]
Sujet : Re: [sqlite] single quote protection
 
Hello Gregory,
 
http://www.mail-archive.com/[EMAIL PROTECTED]/msg01031.html
 
Advice: use the archives. There are lots and lots of info.
 
Regards,
 
-- Tito
 
On 1 abr 2004, at 13:03, Gregory Letellier wrote:
 
> hello,
>  
> i've many strings value to insert in a varchar column,
> but this strings contains character : '
>  
> how to protect it ?
>   
> thx for your help !
>  
>  
>
> 
>   IncrediMail - La messagerie électronique a enfin évolué
> - Cliquer ici
 







  IncrediMail - La messagerie électronique a enfin évolué - Cliquer ici

Re: [sqlite] single quote protection

2004-04-01 Thread Tito Ciuro
Hello Gregory,

http://www.mail-archive.com/[EMAIL PROTECTED]/msg01031.html

Advice: use the archives. There are lots and lots of info.

Regards,

-- Tito

On 1 abr 2004, at 13:03, Gregory Letellier wrote:

hello,
 
i've many strings value to insert in a varchar column,
but this strings contains character : '
 
how to protect it ?
  
thx for your help !
 
 

  IncrediMail - La messagerie électronique a enfin évolué 
- Cliquer ici

Re: [sqlite] va_list

2004-04-01 Thread Greg Obleshchuk
Hi Chris,
Thanks for your reply.  
I do have a different way of handling it in C# but I am passing the call on to the 
sqlite_vmprintf function (in printf.c and that accepts a va_list)
The way around it that I use is having a switch statement and if the use passes one 
parameter the I calls sqlite_vmprintf with one parame , if two it calls it with two 
and so on.  If I could build a va_list then I would built it and just call 
sqlite_vmprintf once.

anyway thanks
Greg
  - Original Message - 
  From: Christian Smith 
  To: Greg Obleshchuk 
  Cc: [EMAIL PROTECTED] 
  Sent: Thursday, April 01, 2004 8:42 PM
  Subject: Re: [sqlite] va_list


  On Thu, 1 Apr 2004, Greg Obleshchuk wrote:

  >Hi , Can anyone tell me if you can manually create a va_list object.  I
  >have in my wrapper now the sqlite_vmprintf function but as .NET doesn't
  >support the ... as a parameter I had to use a [ParamArray] .  Currently I
  >am testing the number of parameters passed and calling sqlite_vmprintf
  >different ways.  If I could create a va_list and just pass the object it
  >would be a one line call.

  va_list is an opaque type as far as the C standard is concerned.

  How it is implemented is a platform detail of the compiler, and should
  not be messed with.

  Looking at the gcc 3.3 stdarg.h on my Linux box, va_list isn't even a
  structure, but a typedef for an internal __gnuc_va_list type, which is
  manipulated by internal gcc functions.

  In other words, even if you think you know how a va_list is implemented on
  your platform, don't go there. A world of pain awaits.

  Instead, look at what you're using the va_list for. C generally needs it
  because it's string handling is poor and *printf is the easiest way to
  build strings from templates. By .NET I presume you're using C#, which
  should have proper strings and not need the *printf hacks used in C.


  >
  >thanks
  >Greg O


  Christian

  -- 
  /"\
  \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
   X   - AGAINST MS ATTACHMENTS
  / \

[sqlite] single quote protection

2004-04-01 Thread Gregory Letellier






hello,
 
i've many strings value to insert in a varchar column,
but this strings contains character : '
 
how to protect it ? 
 
thx for your help !
 
 







  IncrediMail - La messagerie électronique a enfin évolué - Cliquer ici

Re: [sqlite] va_list

2004-04-01 Thread Christian Smith
On Thu, 1 Apr 2004, Greg Obleshchuk wrote:

>Hi , Can anyone tell me if you can manually create a va_list object.  I
>have in my wrapper now the sqlite_vmprintf function but as .NET doesn't
>support the ... as a parameter I had to use a [ParamArray] .  Currently I
>am testing the number of parameters passed and calling sqlite_vmprintf
>different ways.  If I could create a va_list and just pass the object it
>would be a one line call.

va_list is an opaque type as far as the C standard is concerned.

How it is implemented is a platform detail of the compiler, and should
not be messed with.

Looking at the gcc 3.3 stdarg.h on my Linux box, va_list isn't even a
structure, but a typedef for an internal __gnuc_va_list type, which is
manipulated by internal gcc functions.

In other words, even if you think you know how a va_list is implemented on
your platform, don't go there. A world of pain awaits.

Instead, look at what you're using the va_list for. C generally needs it
because it's string handling is poor and *printf is the easiest way to
build strings from templates. By .NET I presume you're using C#, which
should have proper strings and not need the *printf hacks used in C.


>
>thanks
>Greg O


Christian

-- 
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] va_list

2004-04-01 Thread Greg Obleshchuk
Hi ,
Can anyone tell me if you can manually create a va_list object.  I have in my wrapper 
now the sqlite_vmprintf function but as .NET doesn't support the ... as a parameter I 
had to use a [ParamArray] .  Currently I am testing the number of parameters passed 
and calling sqlite_vmprintf different ways.  If I could create a va_list and just pass 
the object it would be a one line call.

thanks 
Greg O