Hi,

  i've structure table like below and want to load data from temp table into table below :


    dwnc=> \d cust_lo_dim
                          Table "biosadm.cust_lo_dim"
  Column   |         Type          |                 Modifiers
-----------+-----------------------+------------------------------------------
 lo_key    | integer               | not null default nextval('clo_seq'::text)
 lo_no     | character varying(25) | not null
 lo_date   | date                  |
 rcvdate   | date                  |
 lo_status | character varying(15) |
Indexes: cust_lo_dim_pkey primary key btree (lo_key)


my temp table as below:

   dwnc=> \d custlo_temp;
     Table "biosadm.custlo_temp"
  Column  |     Type      | Modifiers
----------+---------------+-----------
 lono     | text          |
 lodate   | text          |
 rcvdate  | text          |
 loamount | numeric(10,2) |
 custname | text          |
 status   | text          |


My SELECT STATEMENT :  

 dwnc=> insert into cust_lo_dim
dwnc-> (lo_no,lo_date,rcvdate,lo_status)
dwnc-> select c.lono,c.lodate,c.rcvdate,c.status
dwnc-> from custlo_temp c ;
ERROR:  column "lo_date" is of type date but _expression_ is of type text
        You will need to rewrite or cast the _expression_
Questions :

  1)  How to rewrite /cast the _expression_ above ???  same goes to others column .
2) lo_key is the column which values comes from sequence clo_seq. what should i do first b4 insert into cust_lo_dim ????


i appreciate  for the help. TQ

Reply via email to