SQL & PL/SQL :: Convert Character Into Number

Jul 30, 2010

the basic salary has data type character.when i write

select basic_salary from table_name

it shows output.but when i need annul for that basic salary(basic_salary*12) it shows error. invalid number.

View 6 Replies


ADVERTISEMENT

SQL & PL/SQL :: How To Convert Decimal Number To A Character

Aug 14, 2013

I want to convert decimal number 44 to character(" ' " i.e single quotation);

I have already tried to_char function but it's not working.

View 2 Replies View Related

SQL & PL/SQL :: Extract Number And Previous Character From Where 5 Digit Number Starting

Oct 21, 2011

I have a text field and if the text field has 5 consecutive numbers then I have to extract the number and the previous character from where the 5digit number starting

For example i/p asdfasfsdS251432dasdasd o/p should be S251432

View 10 Replies View Related

Character Set - Convert Source From WE8MSWIN1252 To Unicode

Feb 5, 2013

I want to convert my database characterset from WE8MSWIN1252 from any UNICODE, because i have to transportable tablespace to the destination, the destination is unicode and source is WE8MSWIN1252. While importing transportable tablespace i was not able to do because of this reason, so i want to convert lets say source from WE8MSWIN1252 to unicode.

View 7 Replies View Related

SQL & PL/SQL :: Convert Data Back To Special Character Values?

Nov 4, 2011

Enterprise Edition Release 10.2.0.5.0

SQL> SELECT * FROM NLS_DATABASE_PARAMETERS where parameter = 'NLS_CHARACTERSET';
PARAMETER VALUE
------------------------------ ----------------------------------
NLS_CHARACTERSET AL32UTF8
SQL>

There is table (VIN_TEMP) in my company database containing following records. It seems like this table should contain some greek language special chracter values instead of this weird data.

SQL> select * from vin_temp;
ATTR
--------------------------------------------------------------------------------
���9999
���9998
���9997
���9997

[code]....

Client are reporting these records as invalid and requesting us to fix. As i investigated i found out, this table was created and loaded few year back. Client sent us one time files which we loaded into this table. I was able to find the code which was actually used to load this table, but unfortunately i was not able to find the raw files where we load this data from...

It seems like Previous Developer specified character set "UTF8" statement, in his sql loader script, to load this data. It seem those file contain some Greek language special character data which was not support by "UTF8" charater set and result in creating those invalid data. My Job is to fix these invalid records and convert them back to its original values which were present in the raw file. I tried to contact client and see if i can find out the raw files but no luck. I tried to use convert function as mention to convert this data from "UTF8" to our current character set format but no luck.

SQL> SELECT attr, dump(attr), convert(attr,'UTF8', 'AL32UTF8') from vin_temp;
ATTR DUMP(ATTR) CONVERT(ATTR,'UTF8','AL32UTF8'
------------------ ---------------------------------------------------------------- -----------------------------
���9999 Typ=1 Len=13: 239,191,189,239,191,189,239,191,189,57,57,57,57 ���9999
���9998 Typ=1 Len=13: 239,191,189,239,191,189,239,191,189,57,57,57,56 ���9998
���9997 Typ=1 Len=13: 239,191,189,239,191,189,239,191,189,57,57,57,55 ���9997
���9997 Typ=1 Len=13: 239,191,189,239,191,189,239,191,189,57,57,57,55 ���9997

[code]....

Here is the script to create table with those type of invalid records.

create table VIN_TEMP
(
attr VARCHAR2(50 CHAR)
);
insert into VIN_TEMP (attr) values ('���9999');
insert into VIN_TEMP (attr) values ('���9998');

[code]....

View 1 Replies View Related

Globalization :: Convert Chinese Character From US7ASCII To AL32UTF8?

Sep 17, 2012

Source Database: AMERICAN_AMERICA.US7ASCII
Target Database: AMERICAN_AMERICA.AL32UTF8

From the source database, the chinese characters are stored in some schema table. From the csscan result, there are convertiable, truncate, data lossy character. So, I have tried to use exp/imp for the conversion. However, all chinese characters are invalided and cannot be read anymore. How can I convert them from US7ASCCI to UTF8 database?

Also, I have tried build up another database with AMERICAN_AMERICA.ZHT16MSWIN950. The exp/imp is used for conversion again. The chinese characters are readable in AL32UTF8 database.

- source database (US7ASCII)
export NLS_LANG=AMERICAN_AMERICA.US7ASCII
export LANG=AMERICAN_AMERICA.US7ASCII
exp userid='/ as sysdba' file=export.dmp full=y

- target database (AL32UTF8)
export NLS_LANG=AMERICAN_AMERICA.US7ASCII
export LANG=AMERICAN_AMERICA.US7ASCII
imp userid='/ as sysdba' file=export.dmp full=y ignore=y

Result:
from US7ASCII to AL32UTF8:
the chinese characters cannot be read

from US7ASCII to ZHT16MSWIN950:
the chinese characters cannot be read

from ZHT16MSWIN950 to AL32UTF8:
the chinese characters can be read

How can I convert the chinese character from US7ASCCI to UTF8 database?

View 6 Replies View Related

SQL & PL/SQL :: Number In Character Field

Dec 1, 2011

A column in a table contains the Numeric and Character. I Require the Numeric Value in that Column, if the Value is Character then null value is require to display.

View 4 Replies View Related

SQL & PL/SQL :: How To Convert RAW To Number

Sep 27, 2013

can we convert RAW to number in sql.because i have to bitand of one raw and number variable.

View 3 Replies View Related

PL/SQL :: Convert Number?

Jun 14, 2013

would need to convert a number in this way:10.1 ---> 10101.90 ----> 190  How can i?

View 1 Replies View Related

SQL & PL/SQL :: Convert Char To Number

Mar 16, 2011

I've got a table with varchar records and I need to separate numerical value and convert into the number datatype.

create table tmp_mape

(remark varchar2(100) )

insert into tmp_mape values ('Dobitie zdarma 3,32EUR 0910105067 02/02')
insert into tmp_mape values ( 'Dobitie pravidelné 9,00EUR' )

I just need to get values 3.32 and 9 from that example into the new column.

The select below returns ORA-01722: invalid number

how to solve it?

select remark,
to_number( to_number(REGEXP_SUBSTR (remark, '[[:digit:]]+', 1) ) ||','|| to_number(substr(REGEXP_SUBSTR (remark, ',[^EUR]+', 1) ,2) ) )
from tmp_mape

View 7 Replies View Related

SQL & PL/SQL :: How To Convert Varchar2 To Number

Jan 15, 2013

How to convert varchar2 to number data?

View 8 Replies View Related

SQL & PL/SQL :: How To Convert Number To Date

Oct 28, 2011

how can convert this number 00001021992 to this format

1-02-1992

i used thie query but no result

select substr(to_date('00001021992','dd-mm-yyyy'),(6,6)) from dual;

View 6 Replies View Related

PL/SQL :: Convert Number To Hours

Jan 1, 2013

I want to convert below MS-SQL query in oracle 10g.

for eg:

Select numasdate,
Cast(numasdate / 60 as Varchar) + ' hours ' +
Cast(numasdate % 60 as Varchar) + ' minutes'
as [TotalHoursAndMinutes]
From
#SampleTable

Output:

9436 157 hours 16 minutes
537 8 hours 57 minutes
9323 155 hours 23 minutes
12525 208 hours 45 minutes

View 8 Replies View Related

PL/SQL :: Convert Number Into Time?

Mar 8, 2013

I need a query that convert number into time.

View 5 Replies View Related

PL/SQL :: Convert To Number Without Decimals

Sep 10, 2012

I have a value that I need in the number format, but without decimals. Is this possible?

TO_NUMBER(SY_KEY1,'9999999') AS SY_KEY1The result I get back is:

1114225.0So, I need a result of 1114225 and in the number format.

View 2 Replies View Related

SQL & PL/SQL :: Stored Procedure - Character To Number Conversion Error

Mar 14, 2011

I have written a stored procedure that has started returning the error:

Error starting at line 1 in command:
call p_glpost('DSTUK', 'L', '2008-01-01', '2008-01-01', '2011-02-18', 1, 1, 1, 0, 'Hi there')

Error report:
SQL Error: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at "CLARITY.P_GLPOST", line 173
06502. 00000 - "PL/SQL: numeric or value error%s"

I can't seem to find a tool that will let me step into the actual stored procedure line by line to see where the error occurs. It mentions line 173, which seems to be a red-herring, as line 173 is simply one of the 'END IF' lines within this block:

IF NVL(r_dist.transtype,'wild') = 'wild' THEN
NULL;
elsif r_wip.transtype = r_dist.transtype THEN
v_matchCount := v_matchCount+1;
elsif r_wip.transtype <> r_dist.transtype THEN
[code]......

Tell me if it is possible to trace through a SP, and which tool is best (I am trying to use Oracle SQL Developer).

View 8 Replies View Related

SQL & PL/SQL :: ORA-06502 - Numeric Or Value Error - Character To Number Conversion?

Aug 4, 2011

I got a string in the form 1+2+4.If we write select 1+2+4 from dual;then we get o/p as 7.but the same thing iam trying to do in a bit of pl/sql program by passing the string 1+2+4 value to a number variable as below.

COUNT_TASK := TO_NUMBER(TASK6_STATUS);

TASK6_STATUS value is 1+2+4 (this thing i got by replacing the string and lots of stuff) but i need the result after adding these 3 numbers in the string. and i declare COUNT_TASK as NUMBER;and i am very well aware that it gives me the error ORA-06502: PL/SQL: numeric or value error: character to number conversion error

how to add these numbers in my program to get the result 7.

View 6 Replies View Related

PL/SQL :: ORA-06502 - Numeric Or Value Error - Character To Number Conversion?

Jun 20, 2013

1 error has occurred  ORA-06502: PL/SQL: numeric or value error: character to number conversion error

I get the above error when I try to compare the below dates in a Pl/sql process in APEX environment.

Is there a work around for it? or (to_char(V_SERVFROM,'mm/dd/yyyy')) != (to_char(:P29_SERVFROM,'mm/dd/yyyy'))

View 4 Replies View Related

SQL & PL/SQL :: Convert Varchar2 To Date Or Number

Jun 18, 2011

I created table Contains then following columns

cheq varchar2(50)
date_due varchar2(50)

and data entry in this columns

cheq 500,1500,5000 all values numbers in this columns

date_due 1-1-2012 , 15-9-2010 all values in this columns date

i want sum the column "cheq"

when used this code but it's not working

select sum(to_number(cheq))
from table_name but the code not working

second column "date_due"

i want search between to date i used this code but also not working

select cloumn1,cloum2
from table_name
where to_char(date_due,'dd-mm-yyyy')
between to_char(date_due,'dd-mm-yyyy') and
(date_due,'dd-mm-yyyy')

but not work

View 13 Replies View Related

PL/SQL :: How To Convert Number (15 Characters) To Date

Jun 23, 2013

One table ACCOUNT_T.CREATED_T is number (38). It is mapped to /ACCOUNT's PIN_FLD_CREATED_T, which is timestamp. ACCOUNT_T table has one record, CREATED_T = 1362063600. This field is displayed at the GUI (Customer Center) as Feb 28, 2013 So my question, how to convert the number value (1362063600) to a date value (Feb 28, 2013)?

View 4 Replies View Related

PL/SQL :: Convert A Number To Years And Months

Jul 30, 2012

I would like to convert a number to years & months.

e.g. 119 = 9 years and 11 months

This would be displayed as 9.11

Is there an oracle function or sql that can calculate this value,

View 8 Replies View Related

Forms :: How To Convert Exponent Into Pure Number

Nov 22, 2006

I have to convert the following

3.3767E+14
4.40453E+15
4.40453E+15

into

337670137917014.00
4404530588226230.00
4404530588226230.00

Any function or formula for this one?

View 35 Replies View Related

SQL & PL/SQL :: Convert Number To Specific Format Using Query

Apr 14, 2011

I want to convert a number to this format using below query but i'm getting error. how to correct the below query.

SELECT TO_CHAR(12345678, '99G9999D99') FROM dual;

error:-###########

View 2 Replies View Related

SQL & PL/SQL :: Convert Year / Quarter Number To Date Format

Oct 5, 2010

I have year/quarter number field (200903 3-rd quarters of 2009) and I need to convert to data format.

View 5 Replies View Related

Server Administration :: How To Know Character Set As Single Character Or Multi Character

Sep 26, 2013

how do we know database character set is either single character set or multi character set?

While changing character-set from AL32UTF8 to WE8MSWIN1252 got "ORA-12712: new character set must be a superset of old character set".

Below are steps taken to resolve the issue -

ALTER DATABASE CHARACTER SET WE8MSWIN1252;

i got this error: ORA-12712: new character set must be a superset of old character set

below are the commands executed by me:

SQL> SHUTDOWN IMMEDIATE;
SQL> CONNECT SYS/password AS SYSDBA;
SQL> STARTUP MOUNT;
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL> ALTER DATABASE OPEN;
SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE WE8MSWIN1252;
SQL> SHUTDOWN;
SQL> STARTUP;
SQL> QUIT;

And its working...

I have not done it in proper order. Neither have done ccsscan. Still, no user reported any issues. Do my changes truncated the data?

View 11 Replies View Related

Reports & Discoverer :: Convert Exponential Number Into Pure While Writing On Excel Using Builder

May 16, 2013

How to convert exponential number into pure number while writing on excel using report builder.Excel only takes 15 digit as pure number and remaining number it converts into zero or you can say in exponential form.

View 4 Replies View Related

Reports & Discoverer :: Convert Number From Arabic To English In Oracle Report Builder

Aug 5, 2011

how can convert number from Arabic to English in oracle report builder

View 2 Replies View Related

SQL & PL/SQL :: How To Insert Special Character / ORA-00911 / Invalid Character

May 25, 2010

We have Oracle 10g and user trying to Insert following in one of our table field and getting error:

'REVOLUCIÃ"N Historical Corruptions Agenda'

Getting follwoing error:

ORA-00911: invalid character
create table Employee
(Emp_ID Varchar2 (10),
Company_Name Varchar2 (40)
)
Insert into Employee
values ('Emp1', 'REVOLUCIÃ"N Historical Corruptions Agenda');

View 5 Replies View Related

Inserting Character From Extended ASCII Character Set?

Mar 8, 2007

I'm trying to insert a character from the extended ascii character set. Specifically, there's a company that has an accented e (�) in the name. Right now, the company name doesn't have the e at all, accent or no accent. So I'm trying to do an update, something like

update table1 set company_name='blah�" where company='blah'

It runs, but doesn't do the update. Even when I try to forcefully do an insert (instead of an update) I get nowhere; the accented is simply dropped. So the basic question is, how do you insert extended ascii characters into oracle?

View 3 Replies View Related

PL/SQL :: How To Select String Between Nth Specific Character To Nth+1 Character

Aug 9, 2012

I have one string 'SWAP_20120224_MEGAMART_MAR_Sales.csv'

I want to get the string between second underscore and third underscore i.e. 'MEGAMART'

How to achieve this in sql statement?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved