Re: Re: INSERT INTO problem - Mailing list pgsql-general

From Tom Jenkins
Subject Re: Re: INSERT INTO problem
Date
Msg-id 3A92D011.10602@devis.com
Whole thread Raw
In response to INSERT INTO problem  (Tom Jenkins <tjenkins@devis.com>)
List pgsql-general
Heh, I originally had that in the message then deleted it as possible noise.

My original insert had
  1 as isdepartment

I then migrated to
  1::int2 as isdepartment

and finally to the version I had posted.  All returned the same error,
unfortunately.

Alfonso Peniche wrote:

> Did you try removing the quotes from    '1'::int2 as isdepartment
> so that it looks:
>
> insert into reportentity
>    select 'D0'||text(departmentid) as reportentityid,
>    departmentname as reportentityname,
>    1 as isdepartment,
>    departmentdescription as reportentitydescription,
>    departmentsummary as reportentitysummary
> from department where isreportentity > 0;
>
>
> Tom Jenkins wrote:
>
>> Hello all,
>> I'm trying to do an INSERT INTO using a UNION of two selects.  I
>> received an error:
>>   "ERROR:  Unable to convert varchar to int2 for column isdepartment"
>>
>>

Tom Jenkins
devIS - Development Infostructure
http://www.devis.com



pgsql-general by date:

Previous
From: "Len Morgan"
Date:
Subject: Re: Printing PostgreSQL reports
Next
From: Stephan Szabo
Date:
Subject: Re: INSERT INTO problem