Re: [SQL] Inc

2007-03-06 Thread Ezequias Rodrigues da Rocha
I did like this: update base.destinationTable set MyCountField = MyCountField + 1 where id = new.keyField_ID; I think it works becouse my tests are ok. My really thank you all. Ezequias 2007/3/6, Richard Huxton : Ezequias Rodrigues da Rocha wrote: > Thank you but I must inc an specific row. H

Re: [SQL] Inc

2007-03-06 Thread Richard Huxton
Ezequias Rodrigues da Rocha wrote: Thank you but I must inc an specific row. How to do that ? I'm not sure I understand. A row in a different table? ... BEGIN UPDATE some_table SET counter = counter + 1; END; ... -- Richard Huxton Archonet Ltd ---(end of broad

Re: [SQL] Inc

2007-03-06 Thread Ezequias Rodrigues da Rocha
Now that's ok. Thank you all. I just thought that there was a function to inc an integer field in postgresql. Best regards Ezequias 2007/3/6, Andreas Kretschmer <[EMAIL PROTECTED]>: Richard Broersma Jr <[EMAIL PROTECTED]> schrieb: > --- Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote: >

Re: [SQL] Inc

2007-03-06 Thread Andreas Kretschmer
Richard Broersma Jr <[EMAIL PROTECTED]> schrieb: > --- Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote: > > > Thank you but I must inc an specific row. How to do that ? > > > > Does, > > UPDATE your_table > SET your_row = your_row +1 > WHERE your_pkey = ; > > not do what you need? I th

Re: [SQL] Inc

2007-03-06 Thread Andreas Kretschmer
Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> schrieb: > Thank you but I must inc an specific row. How to do that ? Read the answer again. Please, no silly TOFU (german synonym for text above, fullquote below). > >> For example. I have a table with a field that on each update it > >> incremen

Re: [SQL] Inc

2007-03-06 Thread Richard Broersma Jr
--- Ezequias Rodrigues da Rocha <[EMAIL PROTECTED]> wrote: > Thank you but I must inc an specific row. How to do that ? > Does, UPDATE your_table SET your_row = your_row +1 WHERE your_pkey = ; not do what you need? Regards, Richard Broersma Jr. ---(end of broadcast)

Re: [SQL] Inc

2007-03-06 Thread Ezequias Rodrigues da Rocha
Thank you but I must inc an specific row. How to do that ? Ezequias 2007/3/6, Richard Huxton : Ezequias Rodrigues da Rocha wrote: > Hi list, > > There is any function to increment with 1 some field. > > For example. I have a table with a field that on each update it > incrementes a field that i

Re: [SQL] Inc

2007-03-06 Thread Richard Huxton
Ezequias Rodrigues da Rocha wrote: Hi list, There is any function to increment with 1 some field. For example. I have a table with a field that on each update it incrementes a field that is allways configured to 0 before the starting of updates. Something like: CREATE FUNCTION my_autoinc() R

[SQL] Inc

2007-03-06 Thread Ezequias Rodrigues da Rocha
Hi list, There is any function to increment with 1 some field. For example. I have a table with a field that on each update it incrementes a field that is allways configured to 0 before the starting of updates. Regards -- Ezequias Rodrigues da Rocha http://ezequiasrocha.blogspot.com/ use Mozil