[SQL] Rollback & Nextval fails

2000-05-29 Thread Eriksson, Fredrik
I have been trying the following SQL code : BEGIN; INSERT INTO table VALUES ( NEXTVAL('serial'), 'Data' ); ROLLBACK; And the insert function is rolled back but the serial sequence isn't. Hav I misunderstood the functionality of rollback or is this a bug? Is there someway to get the functionality

Re: [SQL] Rollback & Nextval fails

2000-05-29 Thread Grant Finnemore
Fredrik, > I have been trying the following SQL code : > > BEGIN; > INSERT INTO table VALUES ( NEXTVAL('serial'), 'Data' ); > ROLLBACK; > > And the insert function is rolled back but the serial sequence isn't. Hav I > misunderstood the functionality of rollback or is this a bug? Is there > somew

Antw: [SQL] Rollback & Nextval fails

2000-05-29 Thread Gerhard Dieringer
Fredrik Eriksson wrote: > I have been trying the following SQL code : > BEGIN; > INSERT INTO table VALUES ( NEXTVAL('serial'), 'Data' ); > ROLLBACK; > And the insert function is rolled back but the serial sequence isn't. Hav I > misunderstood the functionality of rollback or is this a bug? Is

[SQL] adding fields containing NULL values

2000-05-29 Thread Werner Modenbach
Hi all! Let's say I have a table like: employee datesallary extras -- Name1 01-31-1999 5000.00 NULL Name1 02-29-1999 5000.00 500.00 Name1 03-31-1999 5000.00 NULL I would like to get something like: employee datetotal

Re: [SQL] adding fields containing NULL values

2000-05-29 Thread Grant Finnemore
Werner, > Umfortunately 'select employee,date,sallary+extras as total' doesn't give the > desired result because 'somevalue + NULL' is considered to be NULL. > Is there any solution for my (small) problem? Try SELECT employee, date, salary + COALESCE(extras, 0) as total FROM ... Regards Gr

[SQL] template or index of some kind

2000-05-29 Thread Bernie Huang
Hi, I have a situation where there are hundreds of inventories that needs to be stored into postgres. And I am thinking of doing a template to ease the track of those inventories. Idea 1: each inventory may be an individual table, and the problem is how can I keep track of those tables? Idea 2

[SQL] constraint

2000-05-29 Thread Bernie Huang
Hi, I am a newbie to SQL. Could someone please explain why do I need a contraint, and how do I use it in SQL? An example is needed. Thanks - Bernie begin:vcard n:Huang;Bernie tel;fax:(604)664-9195 tel;work:(604)664-9172 x-mozilla-html:TRUE org:Environment Canada;Standards and Technology Se

Re: [SQL] constraint

2000-05-29 Thread Jan Wieck
Bernie Huang wrote: > Hi, > > I am a newbie to SQL. Could someone please explain why do I need a > contraint, and how do I use it in SQL? An example is needed. Thanks Constraints are used to have the database engine ensure the integrity of the data. It'l like teaching the database it

[SQL] storing images!

2000-05-29 Thread Bernie Huang
Hi, Does PostgreSQL support storing image pointers or something alike. Basically, I want to retrieve relative images together with info. Thanks. - Bernie begin:vcard n:Huang;Bernie tel;fax:(604)664-9195 tel;work:(604)664-9172 x-mozilla-html:TRUE org:Environment Canada;Standards and Technolog

[SQL] create constraint trigger

2000-05-29 Thread Kyle Bateman
Hi Jan: In response to your suggestion about possibly being able to use "create constraint trigger," I have tried the following: I have the following trigger function (probably not all that important what it does...): create function prd_parm_tf_iu ()    returns opaque as ' declare     t

[SQL] Max date in the month

2000-05-29 Thread Tubagus Nizomi
hallo help me please how can i select maximal date in the month ?? as may = 31 june = 30 thanks Nizomi