Number to Varchar2???

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc

Poston Thu, 14 Feb 2008 5:11 pm

I have a serious problem, was in charge of a communication interface between two systems and received a from-to the tables and fields that will be loaded.

What is happening is that a column of a table that is receiving a value is of type NUMBER (15) and the supplier table is VARCHAR2 (15). The two tables has hundreds of thousands of records that cannot be erased and that's why I can't do an ALTER TABLE MODIFY this table that has the field NUMBER (15).

Does anyone have any idea what I can do in this situation being that I have no choice as the tables/fields and have to be the same?

Thank you.
Location: Canoas RS

Poston Thu, 14 Feb 2008 5:20 pm

This field NUMBER in the target table is part of the primary key?

you already checked in the source table that have this field Varchar2 data is alpha-numeric? IE has letters in field or maybe it's just numbers that are entered in this case you could give a to_number.

Another thing .... If you need to alter table you will not lose the table records, what can happen is decompile the procedures that use this table or column, which makes this change a little bit dangerous, where would have to verify that objects dotas references to this field.
Location: Campo Grande - MS

Thiago Bourscheidt
Analista de Sistemas

Poston Mon, 18 Feb 2008 7:16 pm

Kara ... If the field that is sending the data is of type VARCHAR2 (15) contains only numbers, so you can pass the data without problem ... no need to convert that oracle recognizes that!!
Renan Orati
Location: São José do Rio Preto - SP

Poston Mon, 25 Feb 2008 10:56 pm

Child uses the TO_NUMBER () can do select and everything.
If you want to change the type, can also ...
But if there are data cracteres will give Dick ... but also how to solve ...
Location: sp

Return to SQL

Who is online

Users browsing this forum: No registered users and 8 guests