Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Can You Convert a Field ???..

Re: Can You Convert a Field ???..

From: Paul Q <paulq_at_home.com>
Date: Tue, 29 Jun 1999 21:43:30 GMT
Message-ID: <66be3.17535$o6.295594@news2.rdc1.on.home.com>


First you need to alter your table

alter table name
add ( new_field type(size));

then update table
 set new_field = household_num+acc_num_display+bran; .. problem here is your fields are numeric so instead you should use
set new_field=household_num||acc_num_display||bran

P.S. Size of new field better be at least 33
> HOUSEHOLD_NUM NOT NULL VARCHAR2(13)
> ACCT_NUM_DISPLAY NOT NULL VARCHAR2(16)
> BRANCH_NUM NOT NULL CHAR(4)
     13+16+4 = 33

As to your question about converting a field ,, look at to_number,to_char,to_date etc functions.

Angelica Veron wrote in message <37793FA2.8220A595_at_globalserve.net>...
>Consider the following 3 fields :
>
>HOUSEHOLD_NUM ACCT_NUM_DISPLAY BRAN
>------------- ----------------
>----
>8427400003321 0000000574724777 2827
>8427400005053 0000000017560888 2827
>8427400005323 0000000500001670 2827
>8427400006144 0000000025590888 2807
>8427400006616 5000575
>2827
>8427400007776 0000000AB0045467 2827
>8427400007776 007800146220002 2827
>8427400009756 007300062620001 2827
>8427400009756 0360756
>2827
>8427400009756 3812853
>2827
>
> These 3 fields are
>
> Name Null? Type
> ------------------------------- -------- ----
> HOUSEHOLD_NUM NOT NULL VARCHAR2(13)
> ACCT_NUM_DISPLAY NOT NULL VARCHAR2(16)
> BRANCH_NUM NOT NULL CHAR(4)
>
>
> I need to combine the total of each 3 given fields as a new field of
>type NUMBER(10), called Service_id . So service_id would be a new 4th
>field (numerical) which has the total of Household_NUM, ACCT_NUM_DISPLAY
>and BRANCH_NUM, how do I do that ??.... how do I create a new field
>called Service_id in the above table ?. Can anyone help ?? I would be
>realy grateful for any help, thank you so much for your time.
>
Received on Tue Jun 29 1999 - 16:43:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US