Re: [sqlite] User Defined Function using P/Invoke SQLite wrappers

2012-05-01 Thread Joe Mistachkin

Rick Guizawa wrote:
> 
> I was wondering if someone could give me a simple straight forward
> example of creating user defined function in c# - sqlite application.
> I have collected basic ( probably incomplete) P/Invoke SQLite wrapper
> functions but I don't know how to include the user defined function
> in the wrapper. Thank you  very much for any help you could give me. 
> 

You may want to look at using System.Data.SQLite:

http://system.data.sqlite.org/

It has a SQLiteFunction abstract class that you can derive from.  The
help file (CHM) for the project has some information on how to use this
class, including for the static RegisterFunction method used to actually
add the custom functions to the database connection.

--
Joe Mistachkin

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


Re: [sqlite] User Defined Function using P/Invoke SQLite wrappers

2012-05-01 Thread Rick Guizawa
Hi All, I have an assignment to do statistical processes in C#. I like
SQLite stand-alone feature but I need to be able to do the assignment using
something like SQL Server stored-procedure. I was wondering if someone
could give me a simple straight forward example of creating user defined
function in c# - sqlite application. I have collected basic ( probably
incomplete) P/Invoke SQLite wrapper functions but I don't know how to
include the user defined function in the wrapper. Thank you  very much for
any help you could give me.

Cheers,
Rick
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] User-defined function invocation during triggers

2009-10-13 Thread Pavel Ivanov
With the next version of SQLite (which will be released this week) you
will be able to write a trigger on deletion of dependent rows where
you will just call your function.

Pavel

On Tue, Oct 13, 2009 at 1:19 PM, Igor Tandetnik  wrote:
> mwnn  wrote:
>> i am using triggers to delete dependent rows of a table when a
>> referred row is deleted. Is there a way for me to let SQLite call a
>> user-defined function for every row deleted in a trigger?
>
> Well, you could write your trigger like this:
>
> create trigger ... on delete ...
> begin
>    select mycustomfunction(id) from mytable where condition;
>    delete from mytable where condition;
> end;
>
> Igor Tandetnik
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] User-defined function invocation during triggers

2009-10-13 Thread Igor Tandetnik
mwnn  wrote:
> i am using triggers to delete dependent rows of a table when a
> referred row is deleted. Is there a way for me to let SQLite call a
> user-defined function for every row deleted in a trigger?

Well, you could write your trigger like this:

create trigger ... on delete ...
begin
select mycustomfunction(id) from mytable where condition;
delete from mytable where condition;
end;

Igor Tandetnik


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


Re: [sqlite] user defined function

2007-10-10 Thread drh
"Aviad Harell" <[EMAIL PROTECTED]> wrote:
> Hey Igor,
> 
> Thanks for your replay. I tried not to use user defined function to do it.
> This code is working on SqlServer but on SQLite I get misuse of aggregate:
> (SUM(SALES)).
> 

See

   http://www.sqlite.org/cvstrac/tktview?tn=2652
   http://www.sqlite.org/cvstrac/chngview?cn=4435

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


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



Re: [sqlite] User Defined Function vs.Keyword

2004-10-01 Thread D. Richard Hipp
[EMAIL PROTECTED] wrote:
I tried to use my function with a statement like:
SELECT left('Hallo Du!', 5);
I got: "near "(" : syntax error"
This is - I assume - because LEFT is already a keyword with a special
meaning as stated in http://www.sqlite.org/lang.html#keywords and can
therefore not be used as a function name.
Is that true? 
Yes.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565