Non Numeric found where a Nnumeric was expected
We are using VB6 as frount end and Oracle8.05 as backend.
We use stored procedures for all truncations.
Some time some of the procedures return error saying that A Non-
numeric is found where a numeric was expected. If I trace that
error through Documentation there it say's use Date format as DD-
MON-YYYY. We are using that format only. Do you know how that
error we are trapping? Just compile the procedure and it will
work and same error will repeat after a 2 to 3 weeks. I have no
idea why it behaves like this.
I have also set these parameter's
NLS_DATE_FORMAT = "DD-MON-YYYY"
NLS_DATE_LANGUAGE="AMERICAN"
If you have any idea about this please let me know.
I hope to hear from you folks.
Suresh
Hi Bharadwaj,
Yes, I believe you are right. And yes that column is designated a primary key. The weird thing is, we do have null values being entered into the table from the flat file, but these values are far from the "OPERATIVE_FLIGHT_LEG_DATE" column (index-wise). Let me give you an example of our case:
this is a row in the flat file: (sample data only)
"2/20/2007","I","0899","N","TPE","MNL","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","750","950","746","955"," P3231",,"04","32","32",,,,,,,,"758","946",,"A000","4","D000","5","000","0","0","0","0","D","P","0","0","0","0","0","0","0","0","0","0","0","2/22/2007","000","012","144","2/20/2007","2/20/2007"
as you can see, I've made the 'null' values bold, as well as the data for OPERATIVE_FLIGHT_LEG_DATE (which shows up, as you can see, at the end of the row).
Now, in the OWB table, the OPERATIVE_FLIGHT_LEG_DATE column is set as a primary key (or foreign, i think, I'll check again) and, thus, is set as one of those columns to first receive data transferred from the flat file.
We see nothing wrong with our mask (which is mm/dd/yyyy by the way) as well as with our data type settings. It has to be with the flat file I guess. We're gonna try putting in dummy values in place of the null ones in the flat file. I'll get back to you asap. Thanks for helping out. :D
Regards,
_lilim
Similar Messages
-
ORA-01858: a non-numeric character found where a digit was expected
Hi,
I'll cut introductions short. We're trying to read data from a flat file (OWB ver.9.2. by the way). After successfully mapping, then generating (with two insignificant warnings), we execute.
Although it says the execution was 'successful', more than a dozen errors return in the form of ORA-01858: a non-numeric character found where a digit was expected
a - Here is the error:
Record 1: Rejected - Error on table "TOPSSTAGE"."FLTR_DCS_IRREG", column "OPERATIVE_FLIGHT_LEG_DATE".
ORA-01858: a non-numeric character was found where a numeric was expected
*it's actually repeated 20 times (Record 1, Record 2, and so on and so forth...) with the same exact error description and details.
b - Here's the part of the OWB-generated script that defines the creation of that field/column:
"OPERATIVE_FLIGHT_LEG_DATE" DATE "mm/dd/yyyy"
c - And here's the data from the flat file (1 of 4 rows)
"2/20/2007","I","0899","N","TPE","MNL","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","750","950","746","955"," P3231",,"04","32","32",,,,,,,,"758","946",,"A000","4","D000","5","000","0","0","0","0","D","P","0","0","0","0","0","0","0","0","0","0","0","2/22/2007","000","012","144","2/20/2007","2/20/2007"
*the part where it is in bold is the one that is mapped from the column OPERATIVE_FLIGHT_LEG_DATE to the OPERATIVE_FLIGHT_LEG_DATE column (flat to physical, right?)
it is set as DATE in all settings (mapping, file, etc..)
Any form of help will be greatly appreciated :)
Thanks!
Regards,
_lilimHi Bharadwaj,
Yes, I believe you are right. And yes that column is designated a primary key. The weird thing is, we do have null values being entered into the table from the flat file, but these values are far from the "OPERATIVE_FLIGHT_LEG_DATE" column (index-wise). Let me give you an example of our case:
this is a row in the flat file: (sample data only)
"2/20/2007","I","0899","N","TPE","MNL","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","750","950","746","955"," P3231",,"04","32","32",,,,,,,,"758","946",,"A000","4","D000","5","000","0","0","0","0","D","P","0","0","0","0","0","0","0","0","0","0","0","2/22/2007","000","012","144","2/20/2007","2/20/2007"
as you can see, I've made the 'null' values bold, as well as the data for OPERATIVE_FLIGHT_LEG_DATE (which shows up, as you can see, at the end of the row).
Now, in the OWB table, the OPERATIVE_FLIGHT_LEG_DATE column is set as a primary key (or foreign, i think, I'll check again) and, thus, is set as one of those columns to first receive data transferred from the flat file.
We see nothing wrong with our mask (which is mm/dd/yyyy by the way) as well as with our data type settings. It has to be with the flat file I guess. We're gonna try putting in dummy values in place of the null ones in the flat file. I'll get back to you asap. Thanks for helping out. :D
Regards,
_lilim -
Ora-01858 a non numeric found where numeric was found
Hello All,
When I am trying to query a view i am getting the follwoing error.
ora-01858 a non numeric found where numeric was found
When checked in all_objects the view status is showing as VALLID.
Please let me know how do we come over this error.
Kind Regards.I can think of two options:
1-Create the view with the same datatype as the underlying column, then in your application handle the logic of conversion
2-Keep the view with the same datatypes, but use a function that takes the value in the column as IN paramter and returns the date. Add exception handling to ignore the exception when a non-date value is encoutered
Regards
AK -
Library info directory path contains a file where a folder was expected
Cannot reopen my Aperture library (Aperture 2) after successfully exporting a few images to desktop as jpegs and then closing Aperture. Tried to reopen Aperture and got the following message:
Library info directory path contains a file where a folder was expected.
The Aperture Library could not be created at “/Volumes/Data/Pictures/Aperture Library.aplibrary/Aperture.aplib”. Check the path and try again.
No idea what has happened here. Anyone know how to fix?
I have a referenced library on my data drive (4 drive Mac Pro) Data drive/d300 Masters folder/another sub folder/then all my images. Did nothing other than to adjust,crop and export images. Images all still there (can open in PS).Sounds strange.
Did you try to double click your "Aperture Library.aplibrary"?
Maybe trying to open backuped library...
Or creating a new library by pressing the alt key when clicking on the Aperture Dock icon. -
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 -
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 -
01858: a non-numeric character was found where a numeric was expected
Hi ,
I had ran a code
SELECT TO_DATE (create_date,'MM/DD/YYYY HH12:MI:SS PM')
FROM TABLE_A
where i got error
-01858: a non-numeric character was found where a numeric was expected
but later i changed to
SELECT TO_CHAR (create_date,'MM/DD/YYYY HH12:MI:SS PM')
FROM TABLE_A
which did the trick for me and i dint get any error.
Hope this helps you.
Documenting this for others.Check the NLS_DATE_FORMAT parameter value of your database.
SELECT sysdate FROM dual; -- You can see the current format
NLS_DATE_FORMAT specifies the default date format to use with the TO_CHAR and TO_DATE functions. The default value of this parameter is determined by NLS_TERRITORY.
The value of this parameter can be any valid date format mask, and the value must be surrounded by double quotation marks. For example:
NLS_DATE_FORMAT = "MM/DD/YYYY"
From the error , I can guess your format would be 'DD-MM-YYYY', thats why when you tried to convert your date (12-AUG-2013) with (MM-DD-YYYY), you are getting the mentioned error.
Set the NLS_DATE_FORMAT value to 'MM-DD-YYYY' as below and try.
ALTER session SET nls_date_format='MM-DD-YYYY' -
Non-numeric character was found where a numeric was expected
getting the error: non-numeric character was found where a numeric was expected
I know it's something with the variable InpMaand and InpJaar who i use in mij select statement of the cursor c_sleutel. But don't know how to fix it. Searched on the forum but no good answer found. Tnx for helping in advanced. see code below:
CREATE OR REPLACE PROCEDURE T05_ins_f (InpJaar in number, InpMaand in number) IS
cursor c_sleutel is
select distinct(sleutel) as sleutel from TR_ROSETTA
where eenheid = 'KPL'
and to_date('01-'||(InpMaand)||'-'||(InpJaar)) between datum_van and datum_tot ;
begin
Message was edited by:
user565199I've fit in the to_date format. but now he say's not a valid month. What i do is the following.
InpMaand and InpJaar are both giving in by the user, like 2 and 2007
after the to_date function, this must be the result: 01-2-2007
otherwise: how to use the variable(InpMaand and InpJaar ) in the to_date function
Message was edited by:
user565199 -
JDBCaccess message ORA-01858: a non-numeric character was found where a num
When trying to read a cloumn from a table using JDBC I get the above message
Below is a copy of the code;
Connection conn=null;
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
System.out.println ("Driver registered"); // Print Driver Connected
try
{ // <-- 1.1
conn = DriverManager.getConnection("jdbc:oracle:thin:@***.******.**:1521:orcl", "********", "*******");
// @machineName:port:SID, userid, password
} // <-- 1.1
catch (SQLException exc_1)
{ // <-- 1.1
//System.out.println("SQL Connect failed with: '" + exc_1.getMessage() + "'");
exc_1.printStackTrace();
System.exit(1);
} //<-- 1.1
System.out.println ("Connected - User/Password"); // Print Connected User/Password
Statement stmt = conn.createStatement();
System.out.println ("Instansiate SQL Statement "); // Print Instansiate
String sql = "select BASE_CURRENCY_CODE from WH_ENT_MODEL.V_FX_DAILY_RATES ";
try
oracle.jdbc.driver.OracleLog.startLogging();
PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
oracle.jdbc.driver.OracleLog.stopLogging();
System.out.println ("Create SQL Statement resultset "); // Print SQL Statement
while (rs.next())
System.out.println (rs.getString("BASE_CURRENCY_CODE")); // Print Base_Currency_Code
stmt.close();
catch(Exception e)
e.printStackTrace();
System.exit(1);
The error I get is;
java.sql.SQLException: ORA-01858: a non-numeric character was found where a numeric was expected
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:153)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:215)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:930)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1131)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:983)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1257)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3467)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3512)
at com.exchange.interfaces.dbAccess.main(dbAccess.java:69)
This is a test class to prove we can access the database from within Java program.
Any help much appreciated.Hi Deepak,
I would first look at your session state, this should show what was passed to the procedure.
I would suggest that if you have a select list showing a null value that that would be the issue as it passes %null% through.
Regards
Michael -
Sqlldr with error: non-numeric character was found when numeric number
Hi,
I have been struggling with this problem for long, can't get to anywhere.
I am trying to use sqlldr to load a CSV file into table, the table looks like this :
AD_ID NUMBER(38)
CNTCT_ID VARCHAR2(60)
AD_FILE_NAME VARCHAR2(80)
AD_TITLE VARCHAR2(300)
AGCY_APRVL_DATE DATE
CORE_APRVL_DATE DATE
ENTR_CMNT CLOB
IC_APRVL_DATE DATE
PURP_TEXT CLOB
RVW_BRD_APRVL_DATE DATE
ACTIVE_FLAG VARCHAR2(1)
.......................................more fields
The control file looks like this:
LOAD DATA
INFILE "C:\ORACLE_IRTMB\IRPADS\SQL_DATA\ADS_T.CSV"
BADFILE "C:\ORACLE_IRTMB\IRPADS\ADS_T.BAD"
DISCARDFILE "C:\ORACLE_IRTMB\IRPADS\ADS_T.DSC"
truncate INTO TABLE ADS_T
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
AD_ID INTEGER ,
CNTCT_ID char ,
AD_FILE_NAME char ,
AD_TITLE char nullif (AD_TITLE=BLANKS) ,
AGCY_APRVL_DATE DATE "MM/DD/YYYY" nullif (AGCY_APRVL_DATE=BLANKS) ,
CORE_APRVL_DATE DATE "MM/DD/YYYY" ,
ENTR_CMNT CHAR(7000) nullif (ENTR_CMNT=BLANKS) ,
PURP_TEXT CHAR(7000) nullif (ENTR_CMNT=BLANKS) ,
RVW_BRD_APRVL_DATE DATE "MM/DD/YYYY" ,
ACTIVE_FLAG char ,
....more fields
The Data file looks like this:
10132,simpsonl,PMSDHHStemplate.pdf,"Depression, Irritability, Mood Swings Sound Familiar?",1/13/2003,11/14/2002,,1/13/2003,"The NIMH is conducting research on premenstrual
10133,jolkovsl,10133ClozapineDHHS ver 0.pdf,Mood Swings? Unpredictable Moods? Are These Moods hard to Treat?,1/28/2003,11/14/2002,,1/28/2003,"The NIMH is conducting a study to test the efficacy of ...
--- and log file looks like this:
Record 5: Rejected - Error on table ADS_T, column RVW_BRD_APRVL_DATE.
second enclosure string not present
Record 7: Rejected - Error on table ADS_T, column RVW_BRD_APRVL_DATE.
second enclosure string not present
Record 9: Rejected - Error on table ADS_T, column RVW_BRD_APRVL_DATE.
second enclosure string not present
Record 2: Rejected - Error on table ADS_T, column AGCY_APRVL_DATE.
ORA-01858: a non-numeric character was found where a numeric was expected
Record 4: Rejected - Error on table ADS_T, column AGCY_APRVL_DATE.
ORA-01858: a non-numeric character was found where a numeric was expected
Record 6: Rejected - Error on table ADS_T, column AGCY_APRVL_DATE.
ORA-01858: a non-numeric character was found where a numeric was expected
IF I use to_date in control file:
LOAD DATA
INFILE "C:\ORACLE_IRTMB\IRPADS\SQL_DATA\ADS_T.CSV"
BADFILE "C:\ORACLE_IRTMB\IRPADS\ADS_T.BAD"
DISCARDFILE "C:\ORACLE_IRTMB\IRPADS\ADS_T.DSC"
truncate INTO TABLE ADS_T
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
AD_ID INTEGER ,
CNTCT_ID char ,
AD_FILE_NAME char ,
AD_TITLE char nullif (AD_TITLE=BLANKS) ,
AGCY_APRVL_DATE "to_date(:AGCY_APRVL_DATE,'MM/DD/YYYY')" ,
CORE_APRVL_DATE DATE "MM/DD/YYYY" ,
ENTR_CMNT CHAR(7000) nullif (ENTR_CMNT=BLANKS) ,
IC_APRVL_DATE DATE "MM/DD/YYYY" ,
PURP_TEXT CHAR(10000) nullif (PURP_TEXT=BLANKS) ,
RVW_BRD_APRVL_DATE DATE "MM/DD/YYYY" ,
I got extracctly same error message as above...
If I use to_char in control file:
LOAD DATA
INFILE "C:\ORACLE_IRTMB\IRPADS\SQL_DATA\ADS_T.CSV"
BADFILE "C:\ORACLE_IRTMB\IRPADS\ADS_T.BAD"
DISCARDFILE "C:\ORACLE_IRTMB\IRPADS\ADS_T.DSC"
truncate INTO TABLE ADS_T
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
AD_ID INTEGER ,
CNTCT_ID char ,
AD_FILE_NAME char ,
AD_TITLE char nullif (AD_TITLE=BLANKS) ,
AGCY_APRVL_DATE "to_char(:AGCY_APRVL_DATE,'MMDDYYYY')" ,
Then it's said a not valid number
Record 2: Rejected - Error on table ADS_T, column AGCY_APRVL_DATE.
ORA-01722: invalid number
Record 4: Rejected - Error on table ADS_T, column AGCY_APRVL_DATE.
ORA-01722: invalid number
Record 6: Rejected - Error on table ADS_T, column AGCY_APRVL_DATE.
ORA-01722: invalid number
Record 8: Rejected - Error on table ADS_T, column AGCY_APRVL_DATE.
ORA-01722: invalid number
someone, please help me out here.
Thanks a lot.
Weihello
pls use to_date
If your session is set to default date format of DD-MON-YY, execute the following and you will receive the error message:
SQL> select to_date('20-JAN-2010', 'DD-MM-YYYY') from dual;
ERROR:
ORA-01858: a non-numeric character was found where a numeric was expected
no rows selected
When you are converting a string to a date, you have specified that the date is being passed in DD-MM-YYYY format. But you have passed the date in DD-MON-YYYY format. As the month is expected as a number by oracle, but you have passed a character, oracle is unable to translate the string to a number.
Do one of the following:
SQL> select to_date('20-JAN-2010', 'DD-MON-YYYY') from dual
2 /
TO_DATE
20-JAN-2010
OR
SQL> select to_date('20-10-2010', 'DD-MM-YYYY') from dual
2 /
TO_DATE
20-JAN-2010
or you can use alter sessin set nls_date_format='.....................';
regards -
A non-numeric character was found ... iAS 8 & ora 8.1.6
I have a problem in iAS 8 and Oracle 8.1.6 under windows 2000.
The problem is calling nested packages using plql gateway, I
mean I call one package and it call's another package, this
operation throws " a non-numeric character was found where a
numeric was expected" even if the procedure only has one
parameter, if you call nested procedures there are no errors, I
had the same problem on Solaris, however changed databases and
it dissapear, I thought that the problem was some
NLS_PARAMETERS however now I'm not pretty sure.
Any Ideas.
Thanks in Advance.
Francisco Castaqeda
Arango Software Int.hello
pls use to_date
If your session is set to default date format of DD-MON-YY, execute the following and you will receive the error message:
SQL> select to_date('20-JAN-2010', 'DD-MM-YYYY') from dual;
ERROR:
ORA-01858: a non-numeric character was found where a numeric was expected
no rows selected
When you are converting a string to a date, you have specified that the date is being passed in DD-MM-YYYY format. But you have passed the date in DD-MON-YYYY format. As the month is expected as a number by oracle, but you have passed a character, oracle is unable to translate the string to a number.
Do one of the following:
SQL> select to_date('20-JAN-2010', 'DD-MON-YYYY') from dual
2 /
TO_DATE
20-JAN-2010
OR
SQL> select to_date('20-10-2010', 'DD-MM-YYYY') from dual
2 /
TO_DATE
20-JAN-2010
or you can use alter sessin set nls_date_format='.....................';
regards -
Non-numeric character was found
SELECT nvl(t1.col11,0) --into DATA
FROM testdata t1
WHERE (to_date(t1.col11,'DD-MM-RR') < '1-MAY-2012' OR to_date(t1.col11,'DD-MM-RR') > '31-MAY-2012')
gives numeric character was found where a numeric was expected.
But when I run it as a block(anonymous block) it runs fine. There are no null values in the table but may the returned value may be null which am trying to replace with NVL but then too am getting this error.
Any suggestions?Hi,
user7351276 wrote:
SELECT nvl(t1.col11,0) --into DATA
FROM testdata t1
WHERE (to_date(t1.col11,'DD-MM-RR') < '1-MAY-2012' OR to_date(t1.col11,'DD-MM-RR') > '31-MAY-2012')
gives numeric character was found where a numeric was expected.
But when I run it as a block(anonymous block) it runs fine. There are no null values in the table but may the returned value may be null which am trying to replace with NVL but then too am getting this error.It looks like you should be getting a different error, due tounmatched single-quotes.
Did this site garble your code? Try again. \ tags often help. If you can't get the site to post exactly what you mean, then explain what you meant to post.
Any suggestions?Don't compare a DATE (such as the value returned by TO_DATE) to a VARCHAR2 (such as the literal '31-MAY-2012'). Compare DATEs to other DATEs.
You can use TO_DATE, like this:WHERE TO_DATE (t1.col1, 'DD-MM-RR') < TO_DATE ('01-MON-2012', 'DD-MON-YYYY')
or a DATE literal, likE this:WHERE TO_DATE (t1.col1, 'DD-MM-RR') < DATE '2012-05-01'
What you posted is definitely a mistake, but I can't tell if it's what's causing the error you mentioned or not.
Whenever you have a question, post a copmplete test script, including CREATE TABLE and INSERT statements for some sample data, that people can run to re-create the problem and test their ideas. Post the results you want from the given data, and explain how you get those results from that data.
As Hoek said, read the forum FAQ {message:id=9360002} -
I am getting error from keyword not found where expected
I am unable to find the error in the following query... its giving from key word not found where expected
select ms.state_name,sum(decode(mp.status,'12',1,0)) cnt_active,sum(decode( mp.status,'12',mh.chargesheet_name,0)) sum_active,
sum(decode(mp.status,'18',1,0))) cnt_inactive, sum(decode( mp.status,'18',mh.chargesheet_name,0)) sum_inactive,
sum(decode(mp.status,'',1,'5',1,'16',1,'17',1,0)) cnt_expired, sum(decode( mp.status,'',mh.chargesheet_name,'5',mh.chargesheet_name,'16',mh.chargesheet_name,'17',mh.chargesheet_name,0)) sum_expired
from mst_pindetails mp,mst_batchno mb,mst_chargesheet_hdr mh,mst_state ms where mp.swhbatchcode=mb.swhbatchcode and mb.chargesheetno = mh.chargesheet_code
and trim(ms.state_id) = mb.statecode group by state_nameok working no problem
-
I am getting the error message, "An expression of non-boolean type specified in a context where a condition is expected, near ',' " when running an ssrs 2008 r2 report.
The sql embedded in the dataset is:
IF @reportID <> 0
BEGIN
SELECT 'Students report 1' AS selectRptName, 1 AS rptNumValue
UNION
SELECT 'Students report 2', 2
UNION
SELECT 'Students report 3', 3
UNION
SELECT 'Students report 4', 4
UNION
SELECT 'Students report 5', 5
ORDER BY selectRptName
END
The sql runs fine in managment studio when I declare @reportID.
The sql runs fine with I comment out 'IF @reportID <> 0'.
The @reportID is a parmeter value that is passed to the applicable dataset.
The @reportID can have more than one value.
Thus can you show me sql and/or tell me what I need to do to solve the issue for me?Hi wendy,
After testing the issue in my environment, I can reproduce it when I select more than one values in the @reportID parameter drop-down list. As per my understanding, it seems that you are trying to filter the dataset with the @reportID parameter. When it
doesn’t contain value ‘0’, the dataset returns values. Otherwise, no value is returned in the dataset.
If in this scenario, we can achieve this requirement with filters in the dataset. For more details, please refer to the following steps:
Modify the dataset with the below query:
SELECT 'Students report 1' AS selectRptName, 1 AS rptNumValue
UNION
SELECT 'Students report 2', 2
UNION
SELECT 'Students report 3', 3
UNION
SELECT 'Students report 4', 4
UNION
SELECT 'Students report 5', 5
ORDER BY selectRptName
Click the Filters in the left pane of Dataset Properties dialog box.
Add a filter as below:
Expression: =INSTR(JOIN(Parameters!reportID.Value,","),"0")>0
Type: Boolean
Operator: =
Value: false
The following screenshot is for your reference:
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
ORA-00923:FROM KEYWORD NOT FOUND WHERE EXPECTED
I have nade a oracle ODBC TO MS-EXCEL.While writting query in microsoft query editor I got the error msg
ORA-00923:FROM KEYWORD NOT FOUND WHERE EXPECTED
The following query runs fine on sql plus editior
wht could be the reason ,pls guide me
select ORDR_H.ORDERDT,ordR_h.orderno,ordr_h.partycd "CODE",
DECODE (PARTY_M.PARTY_TY,1,'TRADE',2,'NTR'),
party_m.party_n1,c1.citee_nm "Stockist Place",
c.citee_nm "CONSIGNEE PLACE"
from citee_m c,citee_m c1,ordr_h,ordr_d,party_m
where
ordr_h.orderno=ordr_d.orderno
and c.citee_cd=ordr_h.destncd
and c1.citee_cd=party_ct
and ordr_h.partycd=party_m.party_cd
and ordr_h.orderdt>='01-jan-09'
order by 2,3One thing that comes to mind is that ODBC does not allow Oracle-specific syntax.
Maybe you are looking for
-
How can I tell if Watercoolant is leaking or about to fail?
I just bought a G5 dual 2.5 ghz on ebay and have now read about these sorts of issues (ugh). The buyer says there's been no issues and it runs excellent. But I want to know if there's an easy way to check if there's something going on that I should b
-
Hi I am trying to use decode function with sql loader.. and gating error SQL*Loader-350: Syntax error at line 8. Expecting "," or ")", found keyword nullif. code(:error_type,'Banned SBI',:error_type)" NULLIF error_type=BLANKS, My ctl file is below...
-
Display the purchase order using plant & material in reports
Hi experts, i wanna print purchase order based on plant and material. in the purchase order i need date(cretion date of po) , po item, po num ,quantity , available quantity. i could not able to find the table in which date
-
F-92 Accumulated depreciation is not showing in the line item
Hi experts I am learning SAP . please let me know how to clear this i bought an asset . when run depreciatiion , the amout of depreciation correctly shown both accumulated depreciation account ( liablity) and depreciation account ( expenses) But w
-
E-Sourcing and SRM Integration
Hi, Has anybody performed SRM 5.0 & E_Sourcing integration 5.0. We are looking that RFx line item could be created manually or automatically copied from shopping cart line item details and later assign source of supply to shopping cart from the award