Re: [GENERAL] Unable To Change Data Type

2011-06-10 Thread John R Pierce
On 06/10/11 11:02 AM, Carlos Mennens wrote: On Fri, Jun 10, 2011 at 1:57 PM, Bill Moran wrote: I don't think ALTER COLUMN TYPE will implicitly convert from varchar to INT. Try: ALTER TABLE reference ALTER COLUMN color TYPE INT USING CAST(color AS INT); Your command suggestion worked

Re: [GENERAL] Unable To Change Data Type

2011-06-10 Thread Bill Moran
In response to Carlos Mennens : > On Fri, Jun 10, 2011 at 1:57 PM, Bill Moran wrote: > > I don't think ALTER COLUMN TYPE will implicitly convert from varchar > > to INT. > > > > Try: > > ALTER TABLE reference > >  ALTER COLUMN color > >    TYPE INT > >    USING CAST(color AS INT); > > Your comma

Re: [GENERAL] Unable To Change Data Type

2011-06-10 Thread Carlos Mennens
On Fri, Jun 10, 2011 at 1:57 PM, Bill Moran wrote: > I don't think ALTER COLUMN TYPE will implicitly convert from varchar > to INT. > > Try: > ALTER TABLE reference >  ALTER COLUMN color >    TYPE INT >    USING CAST(color AS INT); Your command suggestion worked perfect but can you explain why yo

Re: [GENERAL] Unable To Change Data Type

2011-06-10 Thread Andreas Kretschmer
Carlos Mennens wrote: > For some reason I'm unable to change a column's TYPE from VARCHAR(20) > to INTERGER or SMALLINT. I'm required to note the manufactures color > code (value = 198) in the table data but keep getting this error and I > don't understand why: > > The error I'm recieving is: >

Re: [GENERAL] Unable To Change Data Type

2011-06-10 Thread Bill Moran
In response to Carlos Mennens : > For some reason I'm unable to change a column's TYPE from VARCHAR(20) > to INTERGER or SMALLINT. I'm required to note the manufactures color > code (value = 198) in the table data but keep getting this error and I > don't understand why: > > The error I'm recievi

[GENERAL] Unable To Change Data Type

2011-06-10 Thread Carlos Mennens
For some reason I'm unable to change a column's TYPE from VARCHAR(20) to INTERGER or SMALLINT. I'm required to note the manufactures color code (value = 198) in the table data but keep getting this error and I don't understand why: The error I'm recieving is: ERROR: column "color" cannot be cast