Re: [SQL] extend INSERT by 'INSERT INTO table FETCH ... FROM cursor' syntax

2003-10-27 Thread Alexander Vlasenko
On Monday 27 October 2003 21:35, Josh Berkus wrote: > Alexander, > > > > BEGIN; > > > DECLARE total CURSOR > > > FOR SELECT=20 > > > SUBSTR(datetime,1,7)||'-01 00:00:00' as month, > > > client, > > > SUM(money) > > > FROM stat > > > WHERE SUBSTR(datetime,1,7)=3D'2003-10' > > > GROUP BY mo

Re: [SQL] extend INSERT by 'INSERT INTO table FETCH ... FROM cursor' syntax

2003-10-27 Thread Josh Berkus
Alexander, > > BEGIN; > > DECLARE total CURSOR > > FOR SELECT=20 > > SUBSTR(datetime,1,7)||'-01 00:00:00' as month, > > client, > > SUM(money) > > FROM stat > > WHERE SUBSTR(datetime,1,7)=3D'2003-10' > > GROUP BY month,client; > > DELETE FROM stat WHERE SUBSTR(datetime,1,7)=3D'2003-10';

Re: [SQL] extend INSERT by 'INSERT INTO table FETCH ... FROM cursor' syntax

2003-10-27 Thread Christoph Haller
> > Please CC me, I am not subscribed. > > An imaginary SQL statement > INSERT INTO table FETCH ... FROM cursor; > looks almost the same as currently available > INSERT INTO table SELECT ...; > > I tried it because I needed to insert a row in a table > after I DELETEd a set of rows, something li

[SQL] extend INSERT by 'INSERT INTO table FETCH ... FROM cursor' syntax

2003-10-24 Thread Alexander Vlasenko
Please CC me, I am not subscribed. An imaginary SQL statement INSERT INTO table FETCH ... FROM cursor; looks almost the same as currently available INSERT INTO table SELECT ...; I tried it because I needed to insert a row in a table after I DELETEd a set of rows, something like this: BEGIN; DECL