Numeric OR Non-numeric???!!!
Hi All,
From a string, i retrieve the last character sucessfully...
Need to find, whether the retrieved character is a numeric or non numeric...
and based on that need to check some further conditions...!
Is there any way, to identify whether the retrieved character is a numeric or non numeric????
Kindly, help to throw some lights!!!
Thanks!!!
Cheers,
Sundar.
Hi
You can do something like this.
report zrich_0001.
data: str type string.
data: valid_characters type string.
concatenate '0123456789' sy-abcde into valid_characters.
str = '123ABC'.
if str co valid_characters.
else.
message e001(00) with 'You have a problem'.
endif.
Similar Messages
-
Hi,
I have to check the data in Varchar2 field idtr and if it is numeric some actions are to be done on the data and if it is numeric some other different action is to be done.
So I used some logic for finding whether the data is numeric or non numeric which I got it from the net.
Now my problem is all decimal numbers are to be treated as numeric but this logic is treating decimals as non numeric and I am not able to proceed further.
Can some one help me out in this issue.
Below is the Logic and actions I am doing
select pol_id,lpad(substr(trunc(to_number(idtr),0),1,10),10,0),idtr
from pl_insrd
where length(idtr) - length(translate(idtr,chr(1)||translate(idtr,CHR(1)||'1234567890',CHR(1) ),CHR(1) ) ) = 0
and length(idtr) > 9
UNION
select pol_id,lpad(trunc(idtr,0),10,0),idtr
from pl_insrd
where length(idtr) - length(translate(idtr,chr(1)||translate(idtr,CHR(1)||'1234567890',CHR(1) ),CHR(1) ) ) = 0
and length(idtr) < 10
UNION
select pol_id,substr(idtr,1,10),idtr
from pl_insrd
where length(idtr) - Length(TRANSLATE(idtr,CHR(1)||TRANSLATE(idtr,CHR(1)||'1234567890', CHR(1) ), CHR(1) ) ) > 0
and length(idtr) > 9
UNION
select pol_id,lpad(idtr,10,0),idtr
from pl_insrd
where length(idtr) - Length(TRANSLATE(idtr,CHR(1)||TRANSLATE(idtr,CHR(1)||'1234567890', CHR(1) ), CHR(1) ) ) > 0
and length(idtr) < 10<quote>One I provided was I found at asktom.oracle.com</quote>
So? ... If you'd provided a link then one could see the entire context for that particular snippet of code and decide if it is indeed appropriate. As shown by Angus it is not always appropriate ... add to that, NULL is not a number as that function reports.
<quote>It's using replace and transalate functions which are less expensive then To_Number function.</quote>
Proof?
<quote>I agree with you [John], that's the best function you can use to validate data for numeric.<quote>
I don't agree to_number() is [always] the best way ... the easiest way? ... maybe.
My personal view is that there is no universal way to determine if a string, in all circumstances, can be translated into a number. One has to have knowledge of the source data domain ... only you know if, in your particular circumstance, '1e4' is or is not a NUMBER represented as a string.
flip@FLOP> select to_number('1e3') from dual;
TO_NUMBER('1E3')
1000 -
CONVERT NUMERIC TO NON NUMERIC
Hi experts,
How can i convert from numeric field into non numeric field i.e) if i declare a type c and b type i.
i want to convert b to type c. how can i do ...help me please....Hi Manjula
use this FM : CONVERT_STRING_TO_INTEGER
else tyr using Field symbols:
field-symbols: <fs> type any.
a type c,
b type i.
assign a to <fs>
move <fs> to b. -
Numeric and non numeric question
i have a question regarding value in column
if certain value in column is text i need to display 'abc'
if it is numeric then 'efg'
how to check that..i mean what function i need to useToon Koppelaars wrote:
You could create a function to test this:
If OP is on 10g, he can use REGEXP_LIKE:
SELECT CASE
WHEN :p_input IS NULL THEN '"" is NULL'
WHEN REGEXP_LIKE(:p_input,'^( *)(\+|-)?((\d*[.]?\d+)|(\d+[.]?\d*)){1}(e(\+|-)?\d+)?(f|d)?$','i') THEN '"' || :p_input || '" is a number'
ELSE '"' || :p_input || '" is not a number'
END is_number
FROM dual
/For example:
SQL> SELECT CASE
2 WHEN :p_input IS NULL THEN '"" is NULL'
3 WHEN REGEXP_LIKE(:p_input,'^( *)(\+|-)?((\d*[.]?\d+)|(\d+[.]?\d*)){1}(e(\+|-)?\d+)?(f|d)?$','i') THEN '"' || :p_input || '" is a number'
4 ELSE '"' || :p_input || '" is not a number'
5 END is_number
6 FROM dual
7 /
IS_NUMBER
"-7.8E+12" is a number
SQL> EXEC :p_input := '-7.8E+12.5';
PL/SQL procedure successfully completed.
SQL> /
IS_NUMBER
"-7.8E+12.5" is not a number
SQL> REGEXP_LIKE pattern is based on number diagram posted in Oracle docs.
SY. -
I'm trying to pull data from an Oracle database using SSIS. When I try to select a few fields from the source table, it returns the following error message:
[OLE DB Source [47]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14.
An OLE DB record is available. Source: "OraOLEDB" Hresult: 0x80040E14 Description: "ORA-01858: a non-numeric character was found where a numeric was expected".
An OLE DB record is available. Source: "OraOLEDB" Hresult: 0x80004005 Description: "ORA-01858: a non-numeric character was found where a numeric was expected".
The source columns are a combination of numeric and texts, and I've also tried selecting one of them, which didn't work. I'm using the Oracle client 11.2.0.1, and it works fine with any other data sources I have connected to so far. How can I resolve this
error?Hi H.James,
According to your description, the issue is a non-numeric character was found where a numeric was expected while pulling data from an Oracle database in SSIS.
Based on the error message, the issue should be you are comparing a number column to a non-number column in a query. Such as the query below (ConfID is a number, Sdate is a date):
where C.ConfID in (select C.Sdate
from Conference_C C
where C.Sdate < '1-July-12')
Besides, a default behavior for the Oracle OleDb Provider that change the NLS Date Format of the session to 'YYYY-MM-DD HH24:MI:SS can also cause the issue. For more details about this issue, please refer to the following blog:
http://blogs.msdn.com/b/dataaccesstechnologies/archive/2012/01/20/every-bug-is-a-microsoft-bug-until-proven-otherwise.aspx
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
This is my error:
javax.servlet.ServletException: ORA-01858: a non-numeric character was found where a numeric was expected
This is my code:
ResultSet myRs = myStmt.executeQuery("select count(*) dexCount from cs_dexia where userid = '" + vUserid + "'");
int vCount = 0;
while(myRs.next()){
vCount = myRs.getInt("dexCount");
out.println(vCount);
if(vCount > 0)
response.sendRedirect("swapform.jsp");
What have I done wrong?I have changed that and am now getting:
javax.servlet.ServletException: ORA-00904: invalid column name
the query runs in my sql tool no problem, could it be something to do with the alias? -
ORA-01858: a non-numeric character was found where a numeric was expected
hi ,
This was the code which shows the sales rep invoice amount and collected amount but while running report thru concurrent program its showing the following error:
ORA-01858: a non-numeric character was found where a numeric was expected
WHERE TO_CHAR ( TO_DATE ( PS.GL_DATE , 'DD/MON/YY' ) , 'MON-YYYY' ) BETWEEN TO_CHAR ( TO_DATE ( : ==> P_todate , 'YYYY/MM/DD' ) , 'MON-YYYY' ) AND TO_CHAR ( TO_DATE ( : P_todate , 'YYYY/MM/DD' ) , 'MON-YYYY' ) AND ps.customer_id = cust.custome
The Actual Code was this
SELECT SUBSTR(SALES.name,1,50) salesrep_name_inv,
--ps.CLASS,
SUM(ABS(ps.acctd_amount_due_remaining)) acctd_amt,
SUM(ABS(ps.amount_due_remaining)) amt_due_remaining_inv,
SUM(ABS(ps.amount_adjusted)) amount_adjusted_inv,
SUM(ABS(ps.amount_applied)) amount_applied_inv,
SUM(ABS(ps.amount_credited)) amount_credited_inv,
SALES.salesrep_id,
NULL "REMARKS"
-- ps.gl_date gl_date_inv,
FROM ra_cust_trx_types ctt,
ra_customers cust,
ar_payment_schedules ps,
ra_salesreps SALES,
ra_site_uses site,
ra_addresses addr,
ra_cust_trx_line_gl_dist gld,
gl_code_combinations c,
ra_customer_trx ct
WHERE TO_CHAR(TO_DATE(PS.GL_DATE,'DD/MON/YY'),'MON-YYYY')
BETWEEN TO_CHAR(TO_DATE(:P_todate,'YYYY/MM/DD'),'MON-YYYY') AND TO_CHAR(TO_DATE(:P_todate,'YYYY/MM/DD'),'MON-YYYY')
AND ps.customer_id = cust.customer_id
AND ps.customer_trx_id = ct.customer_trx_id
AND ps.cust_trx_type_id = ctt.cust_trx_type_id
AND NVL(ct.primary_salesrep_id, -3) = SALES.salesrep_id
AND ps.customer_site_use_id+0 = site.site_use_id(+)
AND site.address_id = addr.address_id(+)
AND TO_CHAR(TO_DATE(PS.GL_DATE_CLOSED,'DD/MON/YY'),'MON-YYYY')
BETWEEN TO_CHAR(TO_DATE(:P_todate,'YYYY/MM/DD'),'MON-YYYY') AND TO_CHAR(TO_DATE(:P_todate,'YYYY/MM/DD'),'MON-YYYY')
--AND ps.gl_date_closed > TO_DATE(:P_todate,'MON-YYYY')
AND ct.customer_trx_id = gld.customer_trx_id
AND gld.account_class = 'REC'
AND gld.latest_rec_flag = 'Y'
AND gld.code_combination_id = c.code_combination_id
AND sales.salesrep_id is not null and sales.name is not null
-- and ps.payment_schedule_id+0 < 9999
-- AND SALES.salesrep_id ='1001'
GROUP BY SALES.name,
--ps.CLASS,
SALES.salesrep_idSo to_date function accepts a string as input and returns a date. When a date is input instead, it is implicity converted to the required type of the function paremeter, which is a string, so that to_date can convert it back to a date again.
If you are lucky with the implicit conversion, you get the same date back, if you are not you might get a different date or an error.
From your query it appears that this conversion from a date, to a string, to a date, and then back to a string using to_char this time, is being done to remove the time or day part of the date. The actual range comparison is being done on strings rather than dates, which is dangerous as strings sort differently than dates.
In this example if I sort by date, Jan 01 comes between Dec 00 and Feb 01 as you would expect.
SQL> select * from t order by d;
D
12-01-2000
01-01-2001
02-01-2001When converted to strings, Feb 01 comes between Dec 00 and Jan 01, which is probably not the desired result
SQL> select * from t order by to_char(d,'DD-MON-YY');
D
12-01-2000
02-01-2001
01-01-2001If you want to remove time and day parts of dates you should use the trunc function
trunc(d) removes the time, trunc(d,'mm') will remove the days to start of month.
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/functions201.htm#i79761 -
Non numeric value in numeric field giving error
Hi All
I am using BAPI for creating sales order. If user is giving non numeric value in Quantity field it is giving error. Because quantity field data type is Double.
Please Help.
Thanks
RaktimHi Banerjee,
Create a String/int/long Context variable and point it to UI Input element.Do the validation for correct input value. once the validation is succesful assign that value to RFC BigDecimal variable by Explicit casting.
Hope this might solve your problem .
Thanks
Madhan -
Hi,
I am using the following code.
Tables : vbap.
DATA: t_vbap TYPE STANDARD TABLE OF vbap,
x_vbap TYPE vbap.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECT-OPTIONS: s_vbeln FOR vbap-vbeln.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
SELECT * FROM vbap
INTO TABLE t_vbap
WHERE vbeln IN s_vbeln.
LOOP AT t_vbap INTO x_vbap.
at new vbeln.
write:'new vbeln'.
ENDAT.
ENDLOOP.
In debugging mode, the non-numeric fields on x_vbap becomes ****
I want to know whether this can be done using oops.. any methods available for at new
Moderator message: please search for available information/documentation before asking (as you can tell from some of the replies so far)
locked by: Thomas Zloch on Oct 1, 2010 3:25 PMsee documentation:
"If the INTO addition is used in the LOOP statement to assign the content of the current line to a work area wa, its content is changed upon entry into the AT-ENDAT control structure as follows:
The components of the current control key remain unchanged.
All components with a character-type, flat data type to the right of the current control key are set to character "*" in every position.
All the other components to the right of the current control key are set to their initial value.
When the AT-ENDAT control structure is exited, the content of the current table line is assigned to the entire work area wa. " -
How to check a field in Message mapping wether it is Non Numeric?
Hi XI Guru's
I am totally new to XI world, Kindly help hopw can I chexk a field while doing message mapping whether the field is non numeric or not.
I dont find any built in function for the same.
If it is using UDF can some body help me in providoing a UDF for this.
Many Thanks
ArunHi Arun,
In SAP PI, all the XML contents by default treated as STRINGS.
So if u want to check whether the incoming field is numeric or not... the only way is to write a UDF code for the same.
the UDF will be,
1. At first
import java.util.regex.Matcher;
import java.util.regex.Pattern;
in functions.
2.UDF content:
input: field,container
output:boolean
Code
boolean return_Value;
Pattern p = Pattern.compile("[0-9]*"); // If u are using the decimals please change the regular expression accordingly.
Matcher m = p.matcher(field);
if(m.matches())
retuen_Value = true;
else
return_Value = false;
return return_Value ;
I hope this will solve ur problem....
Babu -
Safari "tel:" phone number links stripping non-numeric characters
After a week of owning my iPhone (two weeks after it launched) I made myself a little web interface that contain various iPhone-helpful links. Four of these were AT&T specific telephone links:
*646# - check how many minutes remaining
*729 - pay your bill
etc etc..
(e.g. <a href="tel:*729">click here to pay your bill</a>)
Well, needless to say this was a very convenient feature, however these links no longer function properly. It seems that the iPhone is now stripping any/all non-numeric characters from the link (although I haven't done extensive testing to see exactly which characters .. only with * and $ in particular).
I've even tried HTML entities but they were stripped too.
Now I know apple had a security fix a few patches back, one that fixed a vulnerability involving "tel:" links (CVE-2007-3755), but I haven't found any documentation regarding special characters now being ignored/stripped.
So, my question is does anyone know if there is a workaround for this, or did the patch inadvertently and permanently destroy the ability to send these very helpful text messages via a web interface?
Thanks,
MarcI'm having a similarly annoying behavior with "tel:" links. I'm doing the same thing -- writing a web page to store some convenient numbers, but for me, it's for teleconference numbers. You dial into a toll-free number, then after a pause, dial in a passcode.
On the iPhone's contact list, you can program in the pauses as the letter "p."
However, in a tel: link, the p's change to 7's. Interesting!
What I've discovered is that, for me (FW 1.1.2), alphabetical characters are translated into their numerical equivalents. So 1-800-COMCAST (a number I've had to dial all too much recently) gets rendered to 18002662278.
This is a difference between Safari 3 and the iPhone version. On Safari 3 on the Mac, both the HTML and a mouseover shows that the tel link contains the letters. On the iPhone, though, clicking the link brings up a dialog box with the letters "translated."
So, interesting -- but now I have a problem. How do I enter a pause into a tel link? -
How to check non-numeric value in a field
Hi all,
I have a field 'MVALUE'. HOw can I check if I have a non-numeric value in my field. Let us say if I have a value '<25' in this field. How can I check if the value in this field is non-numeric. The field MVALUE is of CHAR datatype.
Please help. Waiting.........Might have to add a space in the string...
if not mvalue co ' 0123456789'.
* error
endif.
if you allow decimals and commas...
if not mvalue co ' .,0123456789'.
* error
endif. -
Check for non-numeric characters in textbox input
I have a form with several textboxes, each of which can accept numeric input. I want to write a validation/ plsql block that checks for a non-numeric character in the input, so that my user sees a customized error message rather than a database error. Any tips on how I can achieve that? Is there any function like "isalpha" in C, which can directly do the job?
Also, some of these numeric fields should allow commas, since people put commas in larger numbers.
Any help is greatly appreciated.Arie,
i figured it out. turns out, i had some confusion in my mind. i modified Taneal's solution to use it in my already existing validations of type 'function returning error text' and it works fine.
the problem before was that i was running 2 separate validations on the same field, and probably due to the sequence numbers, i was getting a numeric or value error. now, i've combined all validations into a single validation and it works fine.
and honestly, i'm pretty bad with reg. ex. :D -
How can I remove non-numeric characters from a cell?
I have a file an rtf file that I can open in Numbers. It puts each line in a separate cell. Each cell contains non-numeric and numeric characters. I'd like to delete the non-numeric characters so that I can add the numbers together. Is there a way to do this easily in Numbers that doesn't require doing it manually?
Thanks,
DavidOk, David,
This solution will work for vlaues up to 99,000 and if there is a space in front of your amount. There are two parts for clarity but you could wrap them up into one formula if you wanted to.
B2 =FIND(" ",A2,LEN(A2)−9)
C2 =MID(A2,B2,10)
If there is a return before your amount (certain cells in your screenshot got me wondering) then the formula in column B
=FIND("
",A2,1)
It looks funny because it is finding the return.
Let me know if this works for you.
quinn -
Replace Non-Numeric Characters with a Numeric Character in a String
Hi Guys,
I need to replace all the non-numeric characters (including embedded blanks & hyphen) in a string to a numeric character '1'.
The trailing blanks should not be replaced.
e.g. "P22233344455566" should be changed to "122233344455566"
& "49-1234567 " should be changed to "4911234567 "
Please help.Use [replace|http://help.sap.com/abapdocu_70/en/ABAPREPLACE_IN_PATTERN.htm] with a regular expression to translate any non-numeric character (i.e. any character not between 0 and 9) to 1:
REPLACE ALL OCCURENCES OF REGEX '[^0-9]' IN value WITH '1'.
Cheers, harald
p.s.: In older releases [translate|http://help.sap.com/abapdocu_70/en/ABAPTRANSLATE.htm] would also do the trick, but is more lengthy, because one would need to specify each individual character that should be replaced, e.g.:
TRANSLATE value TO UPPER CASE.
TRANSLATE value USING
' 1_1-1a1b1c1d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w1x1y1z1'.
Maybe you are looking for
-
Also my whole famil shares the same iTunes account, if I want to make a new one for just me to use can I get all my purchases transfered to the new account? and if I want to create a new iCloud account will I loose everythime that is on the old one?
-
PRINTER_FRIENDLY View and how to restrict number of rows
Dear apex community, I am on the APEX 4.2 and OracleXE11g. I have created a page with the classic SQL report based on the table. The pagination style is "Row Ranges 1-15 16-30 (with set pagination)". Enable Partial Page Refresh: Yes. The table contai
-
I have Snow Leopard on a Mac Pro with two hard disks. I have files on the secondary disk that will not delete. It gives an error code of 1407. When I check file information, the file is locked. I unlock it but it does not stay unlocked. Any suggestio
-
Is there a missing feature in iCloud Tabs?..
Hello. I have installed iOS6 on my iPhone4 and everything works fine, so far. However, I have a minor problem, rather a puzzlement: I am trying to figure out, how (on earth) one can delete the contents of the "iCloud Tabs" on the iPhone! There is no
-
Can't start XI Directory but XI Repository works
Hi I can successfully start the XI Repository and logon but when I start the XI Directory it fails when trying to load one of the jar files from the server. The error(see below - codebase is wrong) is obvious but how can I correct the path so that it