If you write a function in C, and register it with
sqlite3_create_function (or one of its variants), you can then have a
trigger like so:
CREATE TRIGGER Event_test1 AFTER INSERT ON test
BEGIN
SELECT my_notifier_function();
END;
And since it's a C function, you can do pretty much anything
I want to create a trigger on INSERT & in trigger logic I want to notify
other running executable in system.
Can I do this using trigger operation?
Example:
Create table ();
CREATE TABLE test (
ID INT PRIMARY KEY NOT NULL,
NAME TEXT NOT NULL,
);
CREATE TRIGGER Event_test1 AFTER INSERT
On 7/21/2013 7:13 PM, ss griffon wrote:
Following up to my previous question of ordering data sent to an aggregate
function.
Can anyone out there think of (or know of) a good way to return multiple
values from an aggregate function?
Perhaps a virtual table could be pressed into service
Ah, I overlooked that. That will work great, something like ema_csv() to
return a csv string of all values.
Thanks for the suggestion
On Sun, Jul 21, 2013 at 4:35 PM, Simon Slavin wrote:
>
> On 22 Jul 2013, at 12:13am, ss griffon wrote:
>
> >
On 22 Jul 2013, at 12:13am, ss griffon wrote:
> Can anyone out there think of (or know of) a good way to return multiple
> values from an aggregate function?
I couldn't. I returned them in a pipe-separated string: 317|8432|23|1433
Simon.
On 21 Jul 2013, at 11:47pm, Igor Tandetnik wrote:
> On 7/21/2013 5:01 PM, Simon Slavin wrote:
>> I had to fake it. The parameter I passed to my aggregate function was a
>> string as follows:
>>
>> theOrder||':'||theValue
>>
>> My function extension had to split the
Following up to my previous question of ordering data sent to an aggregate
function.
Can anyone out there think of (or know of) a good way to return multiple
values from an aggregate function?
For example, if I have an "exponential moving average" function, ema(), I
would like to return all of
On 7/21/2013 5:01 PM, Simon Slavin wrote:
I had to fake it. The parameter I passed to my aggregate function was a string
as follows:
theOrder||':'||theValue
My function extension had to split the values into two parts
Couldn't you just pass two parameters, separately?
--
Igor Tandetnik
On Sun, Jul 21, 2013 at 1:29 PM, Petite Abeille wrote:
>
> On Jul 21, 2013, at 10:15 PM, ss griffon wrote:
>
> > I'm writing an extension to SQLite that adds some aggregate functions.
> > Some of them, require that the rows passed to the
On 21 Jul 2013, at 9:29pm, Petite Abeille wrote:
> Short answer: no.
Right.
I had to fake it. The parameter I passed to my aggregate function was a string
as follows:
theOrder||':'||theValue
My function extension had to split the values into two parts, then sort
On Jul 21, 2013, at 10:15 PM, ss griffon wrote:
> I'm writing an extension to SQLite that adds some aggregate functions.
> Some of them, require that the rows passed to the aggregate function
> be sorted. It seems as if lots of data bases (MySQL, PostgreSQL)
> support
I'm writing an extension to SQLite that adds some aggregate functions.
Some of them, require that the rows passed to the aggregate function
be sorted. It seems as if lots of data bases (MySQL, PostgreSQL)
support an ORDER BY clause in their aggregate functions. Does SQLite
support anything like
Op 21 jul 2013, om 18:06 heeft Simon Slavin het volgende geschreven:
On 21 Jul 2013, at 4:41pm, E.Pasma wrote:
Is a change in SQLite imaginable such that column expressions are
not re-evaluated with each reference to the column alias?
...
... This is partly because
On Jul 21, 2013, at 7:47 PM, Igor Tandetnik wrote:
> This query is in fact perfectly legal. It's OK to refer to column aliases in
> ORDER BY clause.
Perhaps in SQLite, yes.
select 1 as a order by 1;
select 1 as a order by a;
select x as a from ( select 1 as x ) order by
On 7/21/2013 12:06 PM, Simon Slavin wrote:
One of the problems with this is that it's not standard SQL. You're not meant
to be able to refer to column aliases inside the SELECT that defines them. For
instance
SELECT yearJoined AS y, ageWhenJoined AS a, (y-a) AS yob FROM members
is not
On 21-07-2013 12:01, E.Pasma wrote:
Op 21 jul 2013, om 11:27 heeft Mikael het volgende geschreven:
Hi Igor,
Ah I just noticed how you wrote your query and it delivers for it indeed.
Here's an arbitrary example verifying its works.
Neat - thanks!
sqlite3 test.sqlite
create table categories
You can also use this form:
select id, a, b, 1.0 * a / b as c from
(
select
id,
(select sum(v) from ot as ot1 where ot1.v > categories.id) as a,
(select sum(v) from ot as ot2 where ot2.v < categories.id) AS b
from categories order by +id
)
order by c;
> -Original Message-
> From:
On 21 Jul 2013, at 4:41pm, E.Pasma wrote:
> Is a change in SQLite imaginable such that column expressions are not
> re-evaluated with each reference to the column alias?
> This could also improve queries that use aliases only in the order by clause,
> like
> select id,
Op 21 jul 2013, om 15:43 heeft Clemens Ladisch het volgende geschreven:
RSmith wrote:
On 2013/07/21 12:01, E.Pasma wrote:
Only the execution plan of this query is not optimal:
0|0|0|SCAN TABLE categories (~100 rows)
0|0|0|EXECUTE CORRELATED SCALAR SUBQUERY 1
1|0|0|SCAN TABLE ot AS ot1
RSmith wrote:
> On 2013/07/21 12:01, E.Pasma wrote:
>> Only the execution plan of this query is not optimal:
>> 0|0|0|SCAN TABLE categories (~100 rows)
>> 0|0|0|EXECUTE CORRELATED SCALAR SUBQUERY 1
>> 1|0|0|SCAN TABLE ot AS ot1 (~33 rows)
>> 0|0|0|EXECUTE CORRELATED SCALAR SUBQUERY 2
>>
Well yes, the plan does not read like one would expect an optimal plan to read like - but to the purpose of the original request
there is no more-optimal a plan, is there?.
The entire column used to sort by is made up on the spot and therefore temp BTrees are needed and all the other quirks, as
Op 21 jul 2013, om 11:27 heeft Mikael het volgende geschreven:
Hi Igor,
Ah I just noticed how you wrote your query and it delivers for it
indeed.
Here's an arbitrary example verifying its works.
Neat - thanks!
sqlite3 test.sqlite
create table categories (id number);
insert into
Hi Igor,
Ah I just noticed how you wrote your query and it delivers for it indeed.
Here's an arbitrary example verifying its works.
Neat - thanks!
sqlite3 test.sqlite
create table categories (id number);
insert into categories (id) values (5),(10),(15);
create table ot (v number);
insert into
On Sat, 20 Jul 2013 18:03:43 +0100, Simon Slavin - slav...@bigfraud.org
wrote:
On 20 Jul 2013, at 3:11pm, sqlite.20.browse...@xoxy.net wrote:
this in-memory database actually persists. Ie. Beyond the life of the
program that
http://ams-safetyproducts.com/ngrk/nly.dujbdbtwuxeg
Mag Gam
7/21/2013 7:27:40 AM
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
25 matches
Mail list logo