Re: [sqlite] Dotnet C# support

2005-10-30 Thread Arjen Markus
Robert Simpson wrote:
> 

> 
> Lots of problems here ... My VB is rusty, but here goes:
> 
> 1.  Don't bother declaring the callback struct -- you cannot do any form of
> callbacks in .NET with SQLite without major hacking.  SQLite's callbacks are
> expected to be "cdecl" and .NET callbacks are always "stdcall" and you will
> get stack errors if you even attempt it.  The ADO.NET 2.0 provider for
> SQLite does it, but I had to go through hoops.
> 

Hm, this mismatch in calling convention could be solved by one or two
little wrapper
functions, couldn't it? I am not very familiar with .NET, so I could be
all wrong.

Regards,

Arjen



Re: [sqlite] SQLite as a Windows kernel tool

2005-10-30 Thread Dirk Zabel

[EMAIL PROTECTED] schrieb:


Ken & Deb Allen <[EMAIL PROTECTED]> wrote:
 


vdbeapi.c
e:\SQLITE\327\Source\vdbeapi.c(55) : warning C4244: 'return' :  
conversion from 'i64' to 'int', possible loss of data
e:\SQLITE\327\Source\vdbeapi.c(195) : warning C4244: '=' : conversion  
from 'double' to 'i64', possible loss of data
e:\SQLITE\327\Source\vdbeapi.c(232) : warning C4244: '=' : conversion  
from 'double' to 'u64', possible loss of data


   



What about these three warnings do you think is a concern?
Have you actually looked at the code in question to see
if the possibility of data loss is real and unintentional?
What makes you think that these warnings are not just a case
of the compiler blowing smoke?

--
D. Richard Hipp <[EMAIL PROTECTED]>


 


These concerns seem to me not unfounded.
Just looking at the three cited positions in vdbeapi.c, i find:
Line 55: the conversion i64->int might be ok, depends on the 
runtime-argument pVal. I am not sure.
Line 195:  this  conversion  double->i64  is done by intent; giving the 
number of nanoseconds since midnight. I think a
cast to int64 would be appropriate to express this intent. I comment 
might help to see the reason, but on the other hand the code looks quite 
obvious here.
Line 232: same conversion, insofar applies the same remark. But what if 
between the computation of startTime and rNow midnight occurred? I guess 
there would be a wrap-around - an error in my point of view.


I don't think it's a good idea to assume a compiler warning about type 
conversions are "blowing smoke". At least, they should be eliminated in 
order not to cover messages about real quirks.


Regards
 Dirk



Re: [sqlite] question about instead of delete triggers

2005-10-30 Thread Mark de Vries
On Sun, 30 Oct 2005, Dan Kennedy wrote:

> When you execute this SQL: "delete from v_items where item='me'",
> SQLite essentially does:
>
> FOR EACH ROW IN "select  FROM v_items where item='me'" {
>
> Execute trigger program
>
> }

That makes perfext sense. Thnx.

Rgds,
Mark.

> --- Mark de Vries <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > I guess my question is: are conditions in the where clause
> > of a instead of delte trigger ignored if the referenced
> > columns are not in the where clause of the orig delete?
> >
> > But perhaps an example of my 'problem':
> >
> > create table item (
> > id integer primary key,
> > name text,
> > catid integer
> > );
> >
> > create table category (
> > id integer primary key,
> > name text
> > );
> >
> > create view v_items as
> > select i.name as item,c.name as cat
> > from item i,category c
> > where i.catid=c.id;
> >
> > insert into category values (1,'good');
> > insert into category values (2,'bad');
> > insert into item values (1,'me',1);
> > insert into item values (2,'you',1);
> > insert into item values (3,'the rest',2);
> >
> > Now I want to be able to delete using the view so I
> >
> > create trigger del_v_items instead of delete on v_items
> > begin
> > delete from item
> > where name=old.item and
> > catid=(select catid from category where name=old.cat);
> > end;
> >
> > Now I can "delete from v_items where item='me'" or "delete from v_items
> > where cat='good'". Both seem to work as I would like it to, but I don't
> > quite understand why. In both cases I don't specify a value for a column
> > that is used in the where clause inside the trigger. Assuming and using
> > 'NULL' would not work, so what does sqlite do? Just ignore those parts of
> > the where clause that it does not have all the values for?
> >
> > Thnx for your time & Regards,
> > Mark.
> >
> >
>
>
>
>
>
> __
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>


Regards,
Mark



Re: [sqlite] question about instead of delete triggers

2005-10-30 Thread Dan Kennedy
When you execute this SQL: "delete from v_items where item='me'", 
SQLite essentially does:

FOR EACH ROW IN "select  FROM v_items where item='me'" {

Execute trigger program

}

--- Mark de Vries <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I guess my question is: are conditions in the where clause
> of a instead of delte trigger ignored if the referenced
> columns are not in the where clause of the orig delete?
> 
> But perhaps an example of my 'problem':
> 
> create table item (
> id integer primary key,
> name text,
> catid integer
> );
> 
> create table category (
> id integer primary key,
> name text
> );
> 
> create view v_items as
> select i.name as item,c.name as cat
> from item i,category c
> where i.catid=c.id;
> 
> insert into category values (1,'good');
> insert into category values (2,'bad');
> insert into item values (1,'me',1);
> insert into item values (2,'you',1);
> insert into item values (3,'the rest',2);
> 
> Now I want to be able to delete using the view so I
> 
> create trigger del_v_items instead of delete on v_items
> begin
> delete from item
> where name=old.item and
> catid=(select catid from category where name=old.cat);
> end;
> 
> Now I can "delete from v_items where item='me'" or "delete from v_items
> where cat='good'". Both seem to work as I would like it to, but I don't
> quite understand why. In both cases I don't specify a value for a column
> that is used in the where clause inside the trigger. Assuming and using
> 'NULL' would not work, so what does sqlite do? Just ignore those parts of
> the where clause that it does not have all the values for?
> 
> Thnx for your time & Regards,
> Mark.
> 
> 





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


[sqlite] question about instead of delete triggers

2005-10-30 Thread Mark de Vries
Hi,

I guess my question is: are conditions in the where clause
of a instead of delte trigger ignored if the referenced
columns are not in the where clause of the orig delete?

But perhaps an example of my 'problem':

create table item (
id integer primary key,
name text,
catid integer
);

create table category (
id integer primary key,
name text
);

create view v_items as
select i.name as item,c.name as cat
from item i,category c
where i.catid=c.id;

insert into category values (1,'good');
insert into category values (2,'bad');
insert into item values (1,'me',1);
insert into item values (2,'you',1);
insert into item values (3,'the rest',2);

Now I want to be able to delete using the view so I

create trigger del_v_items instead of delete on v_items
begin
delete from item
where name=old.item and
catid=(select catid from category where name=old.cat);
end;

Now I can "delete from v_items where item='me'" or "delete from v_items
where cat='good'". Both seem to work as I would like it to, but I don't
quite understand why. In both cases I don't specify a value for a column
that is used in the where clause inside the trigger. Assuming and using
'NULL' would not work, so what does sqlite do? Just ignore those parts of
the where clause that it does not have all the values for?

Thnx for your time & Regards,
Mark.