Re: [SQL] Determine length of numeric field

2011-02-19 Thread Jasen Betts
On 2011-02-15, Tony Capobianco wrote: > I'm altering datatypes in several tables from numeric to integer. In > doing so, I get the following error: > > dw=# \d uniq_hits > Table "support.uniq_hits" >Column | Type | Modifiers > +-+--- > sourceid | numer

Re: [SQL] Is it possible to get DISTINCT rows from RETURNING clause?

2011-02-19 Thread Dmitriy Igrishin
Hey Gnanakumar, You can wrap you UPDATE query into SQL function returning TABLE, e.g: CREATE OR REPLACE FUNCTION public.update_mytable() RETURNS TABLE(email text, column1 text, column2 text, column3 text) LANGUAGE sql AS $function$ UPDATE MYTABLE SET ABOOLEANCOLUMN = true FROM MYTEMPTABLE WHERE

Re: [SQL] Retrieve the column values of a record without knowing the names

2011-02-19 Thread Dmitriy Igrishin
Hey, 2011/2/16 arthur_info > > Hello, > > I've got the following function and I want to access the fields values of > my > record by index. The problem is that my select is retrieving each record > line with all values and not each one of each row on my view... How can I > solve this problem? >