SQL & PL/SQL :: How To Convert A String Into Numeric Other Than To_number

Dec 30, 2012

I have a column which has has all numeric values 3 digits to 7 digits in length but all in string format, I want to use seomthing other than to_number function.

Would like to use within the ETL tool, where to_number function isn't getting recognized.

select EMP_NO from employees;

View 2 Replies


ADVERTISEMENT

SQL & PL/SQL :: Convert To Numeric / Date

Jan 30, 2013

I currently have a table with a VARCHAR column which is used to store notes. Currently the notes read something like 'Verified 01/01/2012'. I am trying to convert it to a date column so I can run reports using the date (select between dates etc).

I have tried with the substr function but since the records are all different doesn't really work. (plus that doesn't make it a date so not sure it would work for searching).

how to proceed?

View 3 Replies View Related

SQL & PL/SQL :: Convert Date To Numeric

Oct 8, 2012

I currently have a field which stores a date (date employer started with the company). I want to create a view which stores this as number of days employed (e.g. if star date 1st October view will say 8). How to convert a date to a number?

View 14 Replies View Related

SQL & PL/SQL :: Convert The Field Value Into Numeric Form?

Apr 27, 2010

I want to convert the field value into numeric form using the formula:

∑[((radix)^ position * alphvalue) mod PR]
where alphvalue A= 10, B = 11, C = 12, D = 13,E = 14............. S = 28, ...........Z = 35, radix = 36, PR= 731
The value of position is marked from right to left starting with 0.

For Example:
ASIN
Let PR = 731 (large prime number)

∑[((36)^3 * 10)mod 731) + ((36)^2 * 28)mod 731)+
((36)^1 * 18)mod 731) + ((36)^0 * 22)mod 731) ]
= 182+ 469 + 648 + 22
= 1321

is it possible that it pick the field value and convert it into numeric form.

View 34 Replies View Related

SQL & PL/SQL :: Last Numeric Character In Alphanumeric String

Feb 8, 2011

How can I find the last numeric value in the alphanumeric string?

Example:

LS14160220SPAD show me 0
MN23160224N show me 4
SP34524442 show me 2

View 9 Replies View Related

PL/SQL :: ORA-01722 / Numeric Or Value Error String

Jul 25, 2012

I have an error with this request :

SELECT SEQ_ENTITE.nextval, ENT_CODE_ENT, ENT_GPL_ID, TO_NUMBER('2012')+1,
pkg_etl_fdx.f_getseqexe('LPG_TYE', 'TYE_CODE_CON', ENT_CODE_TEN, 'TYE_SEQ', TO_NUMBER('2012')),
ENT_LIB_ENT, ENT_SEUIL, 'O', 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, ENT_CODE_UNI, ENT_CODE_MERE, ENT_IND_FIN, 0,
0, 0, ENT_NIVEAU, ENT_CODE_TEN, CHAR_TO_LABEL('EXERCICE', 'PUB:EXE'||TO_NUMBER('2012')+1||':'), OLS_GRP
FROM ENTITE
WHERE ENT_OLS_EXE = TO_NUMBER('2012');How to fix ORA-01722 PL/SQL: numeric or value error string ?

The description of the table Entite :

desc entite
Nom           NULL     Type             
------------- -------- -----------------
ENT_SEQ       NOT NULL NUMBER(38)       
ENT_CODE_ENT  NOT NULL VARCHAR2(6 CHAR) 
ENT_GPL_ID    NOT NULL NUMBER(10)       
ENT_OLS_EXE   NOT NULL NUMBER(38)       
ENT_TYE_SEQ            NUMBER(38)       

[code]....

View 3 Replies View Related

PL/SQL - Numeric Or Value Error / Character String Buffer Too Small

May 24, 2011

when I want to create a table.When I run my procedure I received :
PL/SQL: numeric or value error: character string buffer too small

create or replace PROCEDURE p_create_tmp_tables (p_result OUT NUMBER ) IS
string_sql varchar2(1000);
result NUMBER;
BEGIN
string_sql := 'CREATE TABLE TMP_CATEGORIES (CODE_CATEGORY NUMBER(6,0), NAME_CATEGORY VARCHAR2(25 BYTE))';
execute immediate string_sql;
[code]...

View 10 Replies View Related

SQL & PL/SQL :: Numeric Or Value Error - Character String Buffer Too Small

May 6, 2008

I am trying to execute this

begin
-- Initialize owa with an empty array, just so we can use htp.
owa.init_cgi_env( param_val=>owa.cgi_var_name );
-- Add a header to avoid dealing with header-related code in htp.
htp.prn('Content-Type:text/plain');
htp.print('');

[code]....

The error I am getting is

ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.HTP", line 1550
ORA-06512: at line 32

what i feel is that oracle Database UTF8 or AL32UTF8 characterset does not support htp package properly. When i run the code on another characterset, it runs errorfree except in UTF8 or AL32UTF8.

View 7 Replies View Related

Forms :: ORA - 6502 (numeric Or Value Error String) / FRM - 40735?

Mar 14, 2013

I have made a report with sql injection. there is no problem with the report. but when i run from the form with following string it gives error.

:global.where_clause := 'where request_type = 5 and request_status in (3, 4, 5) and list_approval_date is null';

And no error is there if i passed the string as

:global.where_clause := 'where request_status in (3, 4, 5) and list_approval_date is null';

REQUEST_TYPE is a database column and it is of number type.

View 9 Replies View Related

SQL & PL/SQL :: ORA-06502 Numeric Or Value Error / Character String Buffer Too Small

Jul 14, 2011

i am getting above error while doing

ORA-06502 numeric or value error: character string buffer too small
ORA-06512 itw_item_add_ch at line 17

CREATE OR REPLACE procedure itw_item_add_ch (header_id1 number, folio out varchar2,tariff out varchar2) as
cursor item_add(header_id1 number) is
SELECT
DISTINCT c.attribute4 item_tariff_no,
c.attribute5 item_folio
FROM OE_ORDER_LINES_ALL b,

[code].....

View 11 Replies View Related

SQL & PL/SQL :: ORA-06502 - Numeric Or Value Error - Character String Buffer Too Small?

Jul 10, 2012

Following are my declarations and query inside my procedure.i am getting "ORA-06502: PL/SQL: numeric or value error: character string buffer too smal" error when i try to execute the procedure

code :

request_owner request.SCC_USER_ID%TYPE := NULL;
receipt_location request.RECEIPT_LOCATION_LKP_ID%TYPE := NULL;
receipt_type request.RECEIPT_TYPE_LKP_ID%TYPE := NULL;
item_id request.ITEM_ID%TYPE := NULL;

[code]...

View 3 Replies View Related

SQL & PL/SQL :: Two Variables - Numeric Or Value Error / Character String Buffer Too Small

Jan 24, 2011

I am learning pl/sql and this is procedure i had created which got created successfully.then i created two variables name v_name, v_loc with command.

variable v_name varchar2; etc.
and executed procedure like
execute dept_proc2(10, :v_name, :v_loc);
and i am getting the error

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

1 create or replace procedure dept_proc2
2 (v_dno in number, v_name out varchar2, v_loc out varchar2)
3 is
4 cursor dept_cur is select dname, loc from dept
5 where deptno=v_dno;
[code]...

View 12 Replies View Related

ORA-06502 - PL/SQL / Numeric Or Value Error / Character String Buffer Too Small

Oct 8, 2012

Actually I have an existing table in LOG RAW instead of BLOB. Which stores some transaction XML data. The data is very huge. When i trying with the following, gives me following error

SQL> declare
2 a varchar(255);
3 B LONG RAW;
4 cursor c1 is select xml FROM LOG_tab WHERE ID='13148' ;
5 begin
6 open c1;
7 loop
8 fetch c1 into b ;

[code]....

ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 10

Since dbms_output.put_line has buffer limitation.Can we write the result of a select statement into client LOCAL disk files using PL/SQL.

View 1 Replies View Related

SQL & PL/SQL :: Getting ORA-06502 - Numeric Or Value Error - Character String Buffer Too Small?

Jun 7, 2012

I am getting an error as below
ORA-06502: PL/SQL: numeric or value error: character string buffer too small.

Here is complete code

CREATE OR REPLACE
TYPE MDI.ACCUM_STRING_TYPE2 AS OBJECT (
rvalue VARCHAR2 (32767
STATIC FUNCTION odciaggregateinitialize (sctx IN OUT accum_string_type2)
RETURN NUMBER

[code]...

View 4 Replies View Related

SQL & PL/SQL :: ORA-06502 - Numeric Or Value Error / Character String Buffer Too Small

Feb 17, 2012

ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8

I am reexecuting this view:

set serveroutput on buffer 2560000
;
CREATE OR REPLACE VIEW VIEW_TRIP_ASSIGNMENTS
(COMPANY_ID, TRIP_ID, TRIP_STOP_ID, TRIP_CODE, TRIP_NAME,
TRIP_DESC, TRIP_NUMBER, TRIP_START_TIME, TRIP_END_TIME, TRIP_LOADING_TIME,
TRIP_UNLOADING_TIME, FREQUENCY_ID, FREQUENCY_CODE, FREQUENCY_NAME, FREQUENCY_DESC,
FREQUENCY_CODE_NUMBER, CUSTOMER_ID, CUSTOMER_NUMBER, CUSTOMER_NAME, CUSTOMER_DESCRIPTION,
CUSTOMER_TYPE_ID, CUSTOMER_TYPE_NAME, CUSTOMER_TYPE_CODE, DAY_PHONE_NUMBER, EMAIL_ADDRESS,
CONTRACT_ID, CONTRACT_NUMBER, CONTRACT_DESCRIPTION, WORK_LOCATION_ID, ROUTE_ID,

[code]....

before reexecuting above view I was counting the column and was getting below error:

ora-00600 internal error code,arguments:[qctopn1], [],[],[]...

View 14 Replies View Related

Forms :: ORA-06502 - PL/SQL - Numeric Or Value Error - Character String Buffer Too Small

Oct 2, 2010

i am generating html format mail from oracle 10g database.

For displaying data into html format, message body data is exceeding more than 32k.

ORA-06502: PL/SQL: numeric or value error:character string buffer too small

i am using long data type for message body data.

View 4 Replies View Related

Client Tools :: ORA-06502 - Numeric Or Value Error / Character String Buffer Too Small

Mar 28, 2013

Trying to learn and understand Triggers, PL/SQL code, etc. When I execute a simple insert using Toad for Oracle, all is fine. When I try the identical insert in SQL*Plus, it throws error ORA-06502 during execution of the trigger.

Here is the error info:

insert into AAAJOB(PROCEDURENAME,DESCRIPTION) VALUES('OOO','PPP')
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "PMSC0.AAAJOB_TIMING", line 10
ORA-04088: error during execution of trigger 'PMSC0.AAAJOB_TIMING'
===

Here is the table and the trigger:

CREATE TABLE PMSC0.AAAJOB
(
CREATETS TIMESTAMP(0) DEFAULT current_timestamp,
PROCEDURENAME VARCHAR2(100 CHAR),
DESCRIPTION VARCHAR2(100 CHAR),
LASTUPDATEDBY VARCHAR2(9 CHAR)
)

[code]....

The error seems to be on this:

SELECT current_timestamp
INTO :new_row.createTS

View 5 Replies View Related

How To Convert String To Date

Apr 15, 2007

I have a date saved in varchar2 colomn.

how can I convert the vaules into date, so I can use the date to compare data.

Ex: I have the value '20-03-2007 05:31:29', but this value is saved as varchar2.

how can I take from this value the date '20-03-2007' as date format?

View 6 Replies View Related

SQL & PL/SQL :: Convert Alphabet To String?

May 30, 2013

I want to make a query in which i can convert
alphabet
A
B
C
D

asume i have column name alphabet have data A B C D.But i want to retrieve data like this
Apple
Boy
Cow
Duck

View 2 Replies View Related

SQL & PL/SQL :: How To Convert String To Ascii

May 20, 2011

I can't think of a clue how to get the desired results.

I have table column with varchar2 type. I need to convert the strings in this column to ascii values. Now I know Oracle function ascii() converts a character to ascii values. But it just converts the first character of the string and ignore the others. I need to convert the whole string to ascii values. For example, if I need to convert the string "USA", the result should be '858365' (as in U decimal value is 85, S decimal value is 83 and A decimal is 65).

I think I need to use instr() function and also PL/SQL to pass all these strings through a cursor and then use a loop but I'm still confused about it.

View 5 Replies View Related

SQL & PL/SQL :: How To Convert String To Date Format

Jun 12, 2011

I have a string in this format '2011/06/01 00:00:00'. How do I convert this to date format.I tried to_date,to_char and they give errors invalid number & literal does not math format string. I don't have much control on the string since that is the way is comes from the application.

View 3 Replies View Related

SQL & PL/SQL :: Convert One String Into Multiple Strings?

Aug 31, 2010

i have a column 'name' in which value is 'Shailesh Negi',i have to insert 'shailesh' into'first name' column and 'Negi' into 'last name' column respectively.

View 20 Replies View Related

SQL & PL/SQL :: Convert Column Value To Delimited String Using Query?

Jan 10, 2012

I want to convert a column value to a delimited string using a query.

Example

TableA
Col1 Col2 Col3
1 x200 MIS-X
2 x200 BTS-X
3 x200 TYR-X
4 x100 YRY-X

Select Col3 From TableA where Col2 = 'x200'

Expected Output:

'MIS-X','BTS-X','TYR-X'

View 4 Replies View Related

SQL & PL/SQL :: Convert String Of Flags Into List Of Labels

Apr 21, 2011

I have a varchar2 column that contains something like this:

10100010

Each digit represents a flag that corresponds to a certain label:

1 - Bananas
0 - Oranges
1 - Apples
0 - Tomatos
0 - ..
0 - ..
1 - Kiwi
0 - Others

What I want to do is, translate '10100010' into the string '(Bananas,Apples,Kiwi)' using SQL-only. As a bonus it would be nice if the string is completely empty if all flags are '0', so no '()'.

View 6 Replies View Related

SQL & PL/SQL :: Convert A String In Date Obtaining Just A Year?

Nov 12, 2012

basically I have to insert in a date field a string that is a year(four characters).

The problem is that I have to convert a string in date obtaining just a year. How can i do this?

View 14 Replies View Related

PL/SQL :: How To Convert BLOB To BASE64 String And Back

Aug 15, 2012

We have a forms application in Forms 10g. We scan a document and gets it to a image item in the Form. Now, we need to pass this image to a 3rd party application (document mgt. system, ). They have given us a web-service for this. We have to convert the image to a BASE64 string and then invoke the web-service method and input it.

The, 3rd party application document management system will also send images as BASE64 strings through the web-service. We need to convert them back to a blob and put to an image item in the form so that it can be viewed by the end-user.

So, how can we convert a image item in form (as BLOB) to a base64 string and also do the reverse???

View 2 Replies View Related

SQL & PL/SQL :: Trigger - Non-numeric Character Was Found Where Numeric Was Expected

Oct 10, 2011

I have an sqlldr process running loading data into my database. I have created a trigger to run before inserts on each row to start gathering summary data from the basic underlying data. The trigger compiles ok and the procedures the trigger is calling compile ok, but when the sqlldr process runs I get errors in the log files.

Here is the sqlldr control file:

LOAD data
APPEND INTO TABLE cdr.day_tables
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
RecordCode
,CdrStart DATE 'YYYY DDD SSSSS'
[code].......,

Next is my trigger

create or replace TRIGGER BNUMBER_SUMMARY_INS
BEFORE INSERT ON DAY_TABLES
FOR EACH ROW
DECLARE
[code]......

Next are the procedures that are called by the trigger:

create or replace PROCEDURE BNUMBER_SUMMARY
( BNUMBER IN VARCHAR2
, CALLDATE IN DATE
, CALLDURATION IN NUMBER
) AS
record_found NUMBER;
BEGIN
[code].......

The error messages I am getting are:

Record 1: Rejected - Error on table CDR.DAY_TABLES, column CDREND.
ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at "CDR.BNUMBER_SUMMARY_INS", line 6
ORA-04088: error during execution of trigger 'CDR.BNUMBER_SUMMARY_INS'

I need to find out what field it is complaining about, especially since I am not even using the cdrend field from the input record?

View 14 Replies View Related

SQL & PL/SQL :: ORA-01858 / Non-numeric Character Was Found Where Numeric Was Expected

Apr 22, 2013

select ORDER_NUMBER from OE_ORDER_HEADERS_ALL
WHERE ordered_date=to_char(to_date(substr(ORDERED_DATE,1,10),'YYYY/MM/DD'),'DD-MON-YYYY');

Error:-ORA-01858: a non-numeric character was found where a numeric was expected

View 13 Replies View Related

Non-numeric Character Found Where Numeric Was Expected?

Jun 1, 2007

I get the error message mentioned in the subject with this SELECT-statement

....where (t.cfonte=14 and t.data_ultima_modifica between sysdate -4000/(24*60*60) and sysdate ) or (t.data_ultima_modifica > to_date('%TIMESTAMP%','ddmmyyhh24miss'))]]>

If I substitute %TIMESTAMP% with 310507143709 then it works

View 6 Replies View Related

SQL & PL/SQL :: Non-numeric Found Where Numeric Was Expected

Dec 7, 2010

We are getting an error : a non numeric was found where a numeric was expected sometimes when this statement is executed:

INSERT INTO training select * from temp_training where class_id='xyz';
all columns and their datatypes are the same in both the tables

however if i replace the * with the column names as shown below it seems to work fine without giving an error

insert into training (a,b,c) select a,b,c from temp_training where class_id='xyz'

wanted to understand the subtle difference between the 2 statements

View 5 Replies View Related







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