[SQL] increment the primary key value without using sequences

2007-07-29 Thread roopa perumalraja
Hi all, I would like to know if its possible to increment the primary key field value of stocks table without using sequences by getting the next value of the pk field from the sequnce table ? insert into stocks (prim_id, date,time, code, price, volume) (select . from

Re: [SQL] raise exception and transaction handling

2007-07-29 Thread Michal Kedziora
Hi, Marcin I'm not familiar with PREPARE TRANSACTION maby it could be done in that way. But, you can use a EXCEPTION clause, and there put your insert. IF EXISTS (SELECT 1 FROM g.m_lista WHERE idf = NEW.id) THEN RAISE EXCEPTION 'CENY NIE SPELNIAJA WARUNKOW! %',

Re: [SQL] increment the primary key value without using sequences

2007-07-29 Thread Michael Glaesemann
On Jul 29, 2007, at 7:00 , roopa perumalraja wrote: I would like to know if its possible to increment the primary key field value of stocks table without using sequences by getting the next value of the pk field from the sequnce table ? Why? Any other solution will cause performance

[SQL] Migration from SQLite Help (Left Join)

2007-07-29 Thread Mitchell Vincent
SELECT c.customer_id as customer_id,c.customer_number as customer_number, c.customer_name as customer_name,c.customer_status as customer_status,cat.category_name as category_name, c.bill_state as bill_state, coalesce(ctots.balance_due, 0.00) as balance FROM customers as c, customer_categories as

Re: [SQL] Migration from SQLite Help (Left Join)

2007-07-29 Thread Nis Jørgensen
Mitchell Vincent skrev: SELECT c.customer_id as customer_id,c.customer_number as customer_number, c.customer_name as customer_name,c.customer_status as customer_status,cat.category_name as category_name, c.bill_state as bill_state, coalesce(ctots.balance_due, 0.00) as balance FROM customers