Inconsistent datatypes: expected TIMESTAMP got TIMESTAMP
Yes, that's the error message when I do:
select from_tz(systimestamp,'US/Pacific') from dual;
I get a rather funny error message:
ORA-00932: inconsistent datatypes: expected TIMESTAMP got TIMESTAMP
What gives?
Check this
hr@XE> create table sun_tz_test(col1 TIMESTAMP, col2 TIMESTAMP WITH TIME ZONE);
Table created.
1* insert into sun_tz_test values(TIMESTAMP '2006-12-13 18:30:39', current_timestamp)
hr@XE> /
1 row created.
hr@XE> select * from sun_tz_test;
COL1 COL2
13-DEC-06 06.30.39.000000 PM 13-DEC-06
06.16.32.081000 PM -05:00
Similar Messages
-
ORA-00932: inconsistent datatypes: expected NUMBER got DATE
I have a DAC task that is failing and I am getting the message below in the logs
ORA-00932: inconsistent datatypes: expected NUMBER got DATE
Attached below is the SQL for the mapping concerned, I am trying to figure this out so that I can run this ETL successfully.
Any leads would be greatly appreciated.
READER_1_1_1> CMN_1761 Timestamp Event: [Fri Nov 15 17:00:29 2013]
READER_1_1_1> RR_4035 SQL Error [
ORA-00932: inconsistent datatypes: expected NUMBER got DATE
ORA-00932: inconsistent datatypes: expected NUMBER got DATE
Database driver error...
Function Name : Fetch
SQL Stmt : SELECT
PS_ITEM_DST.BUSINESS_UNIT_GL , PS_ITEM_DST.ACCOUNT , PS_ITEM_DST.ALTACCT , PS_ITEM_DST.DEPTID , PS_ITEM_DST.OPERATING_UNIT , PS_ITEM_DST.PRODUCT , PS_ITEM_DST.FUND_CODE , PS_ITEM_DST.CLASS_FLD , PS_ITEM_DST.PROGRAM_CODE , PS_ITEM_DST.BUDGET_REF , PS_ITEM_DST.AFFILIATE , PS_ITEM_DST.AFFILIATE_INTRA1 , PS_ITEM_DST.AFFILIATE_INTRA2 , PS_ITEM_DST.CHARTFIELD1 , PS_ITEM_DST.CHARTFIELD2 , PS_ITEM_DST.CHARTFIELD3 , PS_BI_LINE.PROJECT_ID , PS_ITEM_DST.STATISTICS_CODE , PS_ITEM.CUST_ID , PS_ITEM.ADDRESS_SEQ_NUM , PS_BI_HDR.SHIP_TO_CUST_ID , PS_BI_HDR.SHIP_TO_ADDR_NUM , PS_BI_HDR.SOLD_TO_CUST_ID , PS_BI_HDR.SOLD_TO_ADDR_NUM , PS_ITEM_DST.FOREIGN_AMOUNT , PS_ITEM_DST.MONETARY_AMOUNT , PS_ITEM_DST.FOREIGN_CURRENCY , PS_ITEM_DST.CURRENCY_CD , PS_ITEM_DST.BUSINESS_UNIT , PS_ITEM_DST.ITEM , PS_ITEM_DST.ITEM_LINE , PS_ITEM_DST.ITEM_SEQ_NUM , PS_ITEM_DST.DST_SEQ_NUM , PS_ITEM_DST.JOURNAL_ID , PS_ITEM_DST.JOURNAL_DATE , PS_ITEM_DST.JOURNAL_LINE , PS_ITEM_DST.GL_DISTRIB_STATUS , PS_ITEM_DST.LEDGER_GROUP , PS_ITEM_DST.LEDGER , SALESPERSON.EMPLID , PS_ITEM_ACTIVITY.COLLECTOR , PS_ITEM_ACTIVITY.ENTRY_TYPE , PS_ITEM_ACTIVITY.ENTRY_REASON , PS_ITEM_ACTIVITY.BANK_SETID , PS_ITEM_ACTIVITY.BANK_CD , PS_ITEM_ACTIVITY.BANK_ACCT_KEY , PS_ITEM_ACTIVITY.DEPOSIT_ID , PS_ITEM_ACTIVITY.PAYMENT_SEQ_NUM , PS_ITEM_ACTIVITY.GROUP_TYPE , PS_ITEM_ACTIVITY.POST_DT , PS_ITEM_ACTIVITY.ACCOUNTING_DT , PS_ITEM.BAL_AMT , PS_ITEM.ORIG_ITEM_AMT , PS_ITEM.ITEM_STATUS , PS_ITEM.PYMNT_TERMS_CD , PS_ITEM.DUE_DT , PS_ITEM.PO_REF , PS_ITEM.PO_LINE , PS_ITEM.ASOF_DT , PS_BI_HDR.DT_INVOICED , PS_BI_HDR.INVOICE_DT , PS_GROUP_CONTROL.OPRID , PS_ITEM.BUSINESS_UNIT_OM , PSPRCSRQST.RUNDTTM , PS_JRNL_HEADER.DTTM_STAMP_SEC , PSPRCSRQST1.RUNDTTM , PS_BI_HDR.LAST_UPDATE_DTTM , PS_JRNL_HEADER.JRNL_HDR_STATUS , PS_BI_LINE.TAX_CD , PS_BI_LINE.QTY , PS_BI_LINE.LAST_UPDATE_DTTM , PS_JRNL_HEADER.UNPOST_SEQ , PS_ITEM_DST.BUSINESS_UNIT_PC , PS_ITEM_DST.ACTIVITY_ID , PS_ITEM_DST.ANALYSIS_TYPE , PS_ITEM_DST.RESOURCE_TYPE , PS_ITEM_DST.RESOURCE_CATEGORY , PS_ITEM_DST.RESOURCE_SUB_CAT , PS_BI_LINE.CONTRACT_NUM
FROM
PS_ITEM_DST,
PS_ITEM_ACTIVITY,
PS_ITEM,
PS_BI_HDR,
PS_BI_LINE,
PS_GROUP_CONTROL,
PSPRCSRQST,
PSPRCSRQST PSPRCSRQST1,
PS_JRNL_HEADER,
(SELECT A.SETCNTRLVALUE, B.SUPPORT_TEAM_MBR, B.EMPLID
FROM PS_SET_CNTRL_REC A, PS_MEMBER_PERSON B
WHERE A.SETID = B.SETID AND A.RECNAME = 'MEMBER_PERSON') SALESPERSON
WHERE
PS_ITEM_DST.BUSINESS_UNIT = PS_ITEM_ACTIVITY.BUSINESS_UNIT(+) AND PS_ITEM_DST.CUST_ID = PS_ITEM_ACTIVITY.CUST_ID(+) AND PS_ITEM_DST.ITEM = PS_ITEM_ACTIVITY.ITEM(+) AND PS_ITEM_DST.ITEM_LINE = PS_ITEM_ACTIVITY.ITEM_LINE(+) AND PS_ITEM_DST.ITEM_SEQ_NUM = PS_ITEM_ACTIVITY.ITEM_SEQ_NUM(+) AND PS_ITEM_DST.BUSINESS_UNIT = PS_ITEM.BUSINESS_UNIT(+) AND PS_ITEM_DST.CUST_ID = PS_ITEM.CUST_ID(+) AND PS_ITEM_DST.ITEM = PS_ITEM.ITEM(+) AND PS_ITEM_DST.ITEM_LINE = PS_ITEM.ITEM_LINE(+) AND PS_ITEM.BUSINESS_UNIT_BI = PS_BI_HDR.BUSINESS_UNIT(+) AND PS_ITEM.ITEM = PS_BI_HDR.INVOICE(+) AND PS_ITEM_DST.BUSINESS_UNIT_GL = PS_BI_LINE.BUSINESS_UNIT(+) AND PS_ITEM_DST.ITEM = PS_BI_LINE.INVOICE(+) AND PS_ITEM_DST.ITEM_SEQ_NUM = PS_BI_LINE.LINE_SEQ_NUM(+) AND PS_ITEM_ACTIVITY.GROUP_ID = PS_GROUP_CONTROL.GROUP_ID(+) AND PS_ITEM_ACTIVITY.GROUP_BU = PS_GROUP_CONTROL.GROUP_BU(+) AND PS_ITEM_DST.PROCESS_INSTANCE = PSPRCSRQST.PRCSINSTANCE(+) AND PS_ITEM_DST.BUSINESS_UNIT_GL = PS_JRNL_HEADER.BUSINESS_UNIT(+) AND PS_ITEM_DST.JOURNAL_ID = PS_JRNL_HEADER.JOURNAL_ID(+) AND PS_ITEM_DST.JOURNAL_DATE = PS_JRNL_HEADER.JOURNAL_DATE(+) AND PS_JRNL_HEADER.UNPOST_SEQ(+) = 0 AND PS_JRNL_HEADER.PROCESS_INSTANCE = PSPRCSRQST1.PRCSINSTANCE(+) AND PS_ITEM_ACTIVITY.BUSINESS_UNIT = SALESPERSON.SETCNTRLVALUE(+) AND PS_ITEM_ACTIVITY.SALES_PERSON = SALESPERSON.SUPPORT_TEAM_MBR(+)
AND PS_ITEM_ACTIVITY.ENTRY_TYPE <> 'CR'
--AND PS_ITEM_DST.GL_DISTRIB_STATUS <> 'I'
--AND PS_ITEM_DST.GL_DISTRIB_STATUS ='D'It might be data issue.
You may narrow down using length of the particular column.
ex: date column length less than 8 or 10 might be an issue -
ORA-00932: inconsistent datatypes: expected NUMBER got INTERVAL
DEAR JDEV TEAM,
I JUST TRY TO RUNNING ITERATE SAMPLE OF OTN SAMPLE.
I RECEIVE ABOVE MENTION ERROR. HOW TO FIX IT ?
BEST REGARDS
BORISSQL> create table test (c1 timestamp);
Table created.
SQL> insert into test values(systimestamp);
1 row created.
SQL> select trunc(86400*(sysdate-c1)/60/60) as hours from test;
select trunc(86400*(sysdate-c1)/60/60) as hours from test
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND
SQL> select trunc(86400*(sysdate-cast(c1 as date))/60/60) as hours from test;
HOURS
0Edited by: jeneesh on Oct 20, 2008 5:27 PM
And you can understnad the reason for the error from the below output
SQL> select systimestamp - c1 from test;
SYSTIMESTAMP-C1
+000000000 00:02:35.329017 -
PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got NUMBER
Hi all,
Wondering if you could assist? I'm exploring User Types and having a small problem. I'm getting the above error for a user type I have created which I'm calling in a function. Here's what my code looks like which I'm running the 'scott' schema for testing purposes
SQL> CREATE OR REPLACE TYPE NBR_COLL AS TABLE OF NUMBER;
2 /
Type created.
SQL> create or replace FUNCTION first_rec_only
2 (
3 NUM_ID IN NUMBER
4 ) RETURN NUMBER IS
5 v_num NBR_COLL;
6 BEGIN
7 select deptno into v_num from dept;
8 RETURN v_num(v_num.FIRST);
9 END first_rec_only;
10 /
Warning: Function created with compilation errors.
SQL> show errors
Errors for FUNCTION FIRST_REC_ONLY:
LINE/COL ERROR
7/4 PL/SQL: SQL Statement ignored
7/11 PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got
NUMBER
SQL>
Any clues to what I'm doing wrong? Cheers.The deptno column is a number, you cannot directly select a number into your type, you need to use your type's constructor.
Something like:
CREATE OR REPLACE FUNCTION first_rec_only (NUM_ID IN NUMBER) RETURN NUMBER IS
v_num NBR_COLL;
BEGIN
SELECT nbr_coll(deptno) INTO v_num from dept;
RETURN v_num(v_num.FIRST);
END first_rec_only;Note that although this will compile, it will throw ORA-01422: exact fetch returns more than requested number of rows when you run it. you need to either use the input parameter as a predicate on your query against dept, use rownum = 1 in the query or use bulk BULK COLLECT INTO, depending on what exactly you want to accomplish.
John -
PL/SQL: ORA-00932: inconsistent datatypes: expected REF got CHAR
SQL> desc o.rel_module;
Name Null? Type
ID NOT NULL NUMBER(6)
TYPE NOT NULL CHAR(7)
BUILDDATE NOT NULL NUMBER(4)
DESIGNROOT NOT NULL NUMBER(6)
SQL> desc rel_module
Name Null? Type
ID NOT NULL NUMBER(6)
DESIGNROOT NOT NULL NUMBER(6)
REL_COMPOSITEPARTS REL_COMPOSITEPART_TAB
SQL> desc REL_COMPOSITEPART_TAB
REL_COMPOSITEPART_TAB TABLE OF REL_COMPOSITEPART
SQL> desc REL_COMPOSITEPART
Name Null? Type
TYPE CHAR(7)
BUILDDATE NUMBER(4)
SQL> create or replace procedure rel_module_p
2 as
3 cursor c is select ID, TYPE, BUILDDATE, DESIGNROOT from o.rel_module;
4 begin
5 FOR i in c
6 LOOP
7 INSERT into rel_module(id,REL_CompositeParts,DESIGNROOT)
Values (i.ID,REL_CompositePart_TAB(i.type,i.builddate), i.designroot);
8 END LOOP;
9 END;
10 /
Warning: Procedure created with compilation errors.
SQL> show err
Errors for PROCEDURE REL_MODULE_P:
LINE/COL ERROR
7/1 PL/SQL: SQL Statement ignored
7/93 PL/SQL: ORA-00932: inconsistent datatypes: expected REF got CHAR
Can you please tell me where needs correction.801556 wrote:
Can you please tell me where needs correction.Just a fix would be:
create or replace procedure rel_module_p
as
cursor c is select ID, TYPE, BUILDDATE, DESIGNROOT from o.rel_module;
begin
FOR i in c
LOOP
INSERT into rel_module(id,REL_CompositeParts,DESIGNROOT)
values (i.ID,REL_CompositePart_TAB(REL_COMPOSITEPART(i.type,i.builddate)), i.designroot);
END LOOP;
END;
/However, I'd assume what you want is:
create or replace procedure rel_module_p
as
cursor c is select ID,CAST(COLLECT(REL_COMPOSITEPART(TYPE,BUILDDATE)) AS REL_CompositePart_TAB) REL_COMPOSITEPARTS, DESIGNROOT
from rel_module
group by id,DESIGNROOT;
begin
FOR i in c
LOOP
INSERT into rel_moduleX(id,REL_CompositeParts,DESIGNROOT)
values (i.ID,i.REL_COMPOSITEPARTS, i.designroot);
END LOOP;
END;
/SY. -
Inconsistent datatypes: expected DATE got NUMBERORA-06512
Hi,
Sporadically getting this exception.I am using .Net 2.0 with ODP .net 2.112.1.0 . Oracle version is 11g . I have used BindByName = true.
declare
bv_EFFECTIVEFROM date := to_date('2008/05/30 02:04:21', 'YYYY/MM/DD HH:MI:SS');
bv_EFFECTIVEFROM_c141 date := to_date('2008/05/30 02:04:32', 'YYYY/MM/DD HH:MI:SS');
bv_EFFECTIVEFROM_c22 date := to_date('2008/05/30 02:04:20', 'YYYY/MM/DD HH:MI:SS');
bv_EFFECTIVEFROM_c33 date := to_date('2008/05/30 02:04:28', 'YYYY/MM/DD HH:MI:SS');
bv_EFFECTIVEFROM_c36 date := to_date('2008/05/30 02:04:29', 'YYYY/MM/DD HH:MI:SS');
bv_EFFECTIVEFROM_c48 date := to_date('2008/05/30 02:04:30', 'YYYY/MM/DD HH:MI:SS');
bv_EFFECTIVEFROM_c50 date := to_date('2008/05/30 02:04:31', 'YYYY/MM/DD HH:MI:SS');
bv_EFFECTIVEFROM_c56 date := to_date('2008/05/30 02:04:22', 'YYYY/MM/DD HH:MI:SS');
bv_EFFECTIVETO date := null;
bv_ENTITYTYPE number := 1;
bv_FileNameID number := 153;
bv_MarketDateDeleted date := null;
bv_MarketDateModified date := to_date('2012/07/27 12:00:00', 'YYYY/MM/DD HH:MI:SS');
bv_MarketDateVerified date := to_date('2012/07/27 12:00:00', 'YYYY/MM/DD HH:MI:SS');
bv_MASTERFILESETFILEID number := 1;
bv_MASTERFILESETFILEID_c187 number := 0;
bv_RELATEDFROMENTITYID number := 4295903973;
bv_RELATEDFROMENTITYTYPE varchar2(12) := 'Organization';
bv_RELATEDTOENTITYID number := 8590944794;
bv_RELATEDTOENTITYID_c100 number := 8590945304;
bv_RELATEDTOENTITYID_c101 number := 8590945305;
bv_RELATEDTOENTITYID_c102 number := 8590945312;
bv_RELATEDTOENTITYID_c103 number := 8590945316;
bv_RELATEDTOENTITYID_c104 number := 8590945318;
bv_RELATEDTOENTITYID_c105 number := 8590945320;
bv_RELATEDTOENTITYID_c106 number := 8590945337;
bv_RELATEDTOENTITYID_c107 number := 8590945347;
bv_RELATEDTOENTITYID_c108 number := 8590945350;
bv_RELATEDTOENTITYID_c109 number := 8590945357;
bv_RELATEDTOENTITYID_c110 number := 8590945359;
bv_RELATEDTOENTITYID_c23 number := 8590944822;
bv_RELATEDTOENTITYID_c24 number := 8590944824;
bv_RELATEDTOENTITYID_c25 number := 8590944876;
bv_RELATEDTOENTITYID_c26 number := 8590944881;
bv_RELATEDTOENTITYID_c27 number := 8590944954;
bv_RELATEDTOENTITYID_c28 number := 8590944956;
bv_RELATEDTOENTITYID_c29 number := 8590944960;
bv_RELATEDTOENTITYID_c30 number := 8590944964;
bv_RELATEDTOENTITYID_c31 number := 8590944968;
bv_RELATEDTOENTITYID_c32 number := 8590944973;
bv_RELATEDTOENTITYTYPE varchar2(10) := 'Instrument';
bv_RELATIONSHIPTYPECODE varchar2(10) := 'IsIssuerOf';
bv_SOURCE number := 3;
bv_SOURCEENTITYID nvarchar2(10) := '4295903973';
bv_StatusCode number := 96;
bv_StatusLockKey nvarchar2(1) := null;
begin
begin
begin
begin
begin
insert into oa.organization_isissuerof (effectivefrom, effectiveto, entitytype, masterfilesetfileid, relatedfromentityid, relatedfromentitytype, relatedtoentityid, relatedtoentitytype, relationshiptypecode, source, sourceentityid) values (bv_effectivefrom, bv_effectiveto, bv_entitytype, bv_masterfilesetfileid, bv_relatedfromentityid, bv_relatedfromentitytype, bv_relatedtoentityid, bv_relatedtoentitytype, bv_relationshiptypecode, bv_source, bv_sourceentityid) ;
end;
end;
begin
update fpf.ascollectedsourceentityids set filenameid = bv_filenameid , marketdatedeleted = bv_marketdatedeleted , marketdatemodified = bv_marketdatemodified , marketdateverified = bv_marketdateverified , statuscode = bv_statuscode , statusdate = sysdate , statuslockkey = bv_statuslockkey where source = bv_source and entitytype = bv_entitytype and masterfilesetfileid = bv_masterfilesetfileid_c187 and sourceentityid = bv_sourceentityid;
end;
commit work;
exception when others then begin
rollback;
raise;
end;
end;
end;
end;
Regards,
RakeshHi,
please find the exception.
Exception: Exception: ORA-00932: inconsistent datatypes: expected DATE got NUMBERORA-06512: at line 1StackTrace: at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, Boolean bCheck) at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery(DbCommand command) at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand command) at ThomsonReuters.Database.Access.CommandManager.ExecuteNonQuery(DbCommand dbCommand) in D:\ICW\Sprint6\Src\ICW ESP Source Code\Database\Access\CommandManager.cs:
This exception is getting sporadically only. I have loaded a file containing 300000 records. The data loading is buffer by buffer. But very few buffers got failed with this kind of exception.The earlier code snapshot is from a failing buffer. It seems alright from the dynamic sql.
I have seen some other helps related to this and reconfirmed that BindByName = true is set.
Kindly let me know if I need to share any more information.
Code snippet.
CommandManager cmdMgr = new CommandManager(_dbMgr);
// we can use LastKeyInDataBuffer because there is only 1 entity per buffer
DbCommand dbCmd = GenerateDML(entityDataBuffer.EntityData
, entityDataBuffer.EntityStatus
, ThreadItem.DataBufferKey.ToString()
, entityDataBuffer.AsCollectedMetaData
, entityDataBuffer.TransMetaData
, entityDataBuffer.AsCollectedSourceEntityIDMapping
, entityDataBuffer.CurrentEntityType);
cmdMgr.AddDbCommand(dbCmd);
DateTime start = DateTime.Now;
_eventMgr.Trace(start
, string.Format("ThreadPool: {0} ExecDML", _threadPool.PoolName)
, TraceLevelEnum.High);
// do not process empty transactions
if (!cmdMgr.IsNullDbCommand)
cmdMgr.ExecuteNonQuery();
//_eventMgr.Trace(string.Format("DEBUG Info [DML] EntityID: {0}, {1} {2}", ThreadItem.DataBufferKey.ToString(), Environment.NewLine, cmdMgr.CompoundCommandTextAsDebugScript), TraceLevelEnum.Low);
Thanks,
Rakesh -
Inconsistent datatypes: expected NUMBER got CHAR error
Hi,
I have the following table
create GLOBAL TEMPORARY TABLE br_total_rtn_data_tmp
code varchar(50) NOT NULL,
name varchar(255),
cum_ytd_rtn_amt varchar(255),
cum_one_mon_rtn_amt varchar(255) ,
cum_thr_mon_rtn_amt varchar(255) ,
cum_six_mon_rtn_amt varchar(255),
cum_nine_mon_rtn_amt varchar(255),
cum_one_yr_rtn_amt varchar(255),
cum_thr_yr_rtn_amt varchar(255),
cum_five_yr_rtn_amt varchar(255),
cum_ten_yr_rtn_amt varchar(255),
cum_lof_rtn_amt varchar(255),
avg_anl_one_yr_rtn_amt varchar(255),
avg_anl_thr_yr_rtn_amt varchar(255),
avg_anl_five_yr_rtn_amt varchar(255),
avg_anl_ten_yr_rtn_amt varchar(255),
avg_anl_lof_rtn_amt varchar(255),
cum_prev_1m_month_end varchar(255),
cum_prev_2m_month_end varchar(255)
)ON COMMIT PRESERVE ROWS;
I have a case statement
CASE
WHEN code = 'MDN' THEN
max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.mdn /100 else null end)
WHEN code = 'QRT' THEN
max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.quartile else null end)
WHEN code = 'PCT' THEN
max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.pct_beaten / 100 else null end)
WHEN code = 'RNK' THEN
case when (p.m_date = v_prev2_yr_mon and p.period_type = '1M' and p.rank is null and p.cnt is null)
THEN
P.RANK
else
p.rank||'/'||p.cnt
end
ELSE NULL
END CASE The output for code = RNK should be somewhat like 3/5 which is rank/count
but i get the error "Inconsistent datatypes: expected NUMBER got CHAR error" when i put p.rank||'/'||p.cnt
How can that be solved.
ORacle version is 10g.Taken from the documentation of the CASE expression:
"For a simple CASE expression, the expr and all comparison_expr values must either have the same datatype (CHAR, VARCHAR2, NCHAR, or NVARCHAR2, NUMBER, BINARY_FLOAT, or BINARY_DOUBLE) or must all have a numeric datatype. If all expressions have a numeric datatype, then Oracle determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that datatype, and returns that datatype.
For both simple and searched CASE expressions, all of the return_exprs must either have the same datatype (CHAR, VARCHAR2, NCHAR, or NVARCHAR2, NUMBER, BINARY_FLOAT, or BINARY_DOUBLE) or must all have a numeric datatype. If all return expressions have a numeric datatype, then Oracle determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that datatype, and returns that datatype."
You need to use the same data type for all your expressions. If you want to return a string, then you need to convert the remaining numbers explicitly to strings. E.g. you could try something like this:
CASE
WHEN code = 'MDN' THEN
to_char(max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.mdn /100 else null end), 'TM')
WHEN code = 'QRT' THEN
to_char(max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.quartile else null end), 'TM')
WHEN code = 'PCT' THEN
to_char(max(case when p.m_date = v_prev2_yr_mon and p.period_type = '1M' then p.pct_beaten / 100 else null end), 'TM')
WHEN code = 'RNK' THEN
case when (p.m_date = v_prev2_yr_mon and p.period_type = '1M' and p.rank is null and p.cnt is null)
THEN
to_char(P.RANK, 'TM')
else
p.rank||'/'||p.cnt
end
ELSE NULL
END CASE I see another potential issue, you're mixing aggregate functions with non-aggregate expressions, this can only work if these non-aggregate expressions are part of the group by clause, but you haven't posted the complete statement so I can only guess.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle:
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Inconsistent datatypes: expected CHAR got NUMBER...
I am trying to run the following statement and get an error "ORA-00932: inconsistent datatypes: expected CHAR got NUMBER":
SELECT UNIQUE ((CASE WHEN AF.asset_flow_type IS NULL THEN decode(sum(3),0,NULL, sum(4)) ELSE 11 END)) * NULLIF (SUM (asset_flow_amount), 0) from O_ASSET_FLOW AF where AF.asset_flow_type = 39
Any suggestions? Thanks!If I run the following, I don't get any error:
SELECT UNIQUE ((CASE WHEN AF.asset_flow_type IS NULL THEN 33 ELSE 11 END)) from O_ASSET_FLOW AF where AF.asset_flow_type = 39
Something goes wrong with the decode(sum(3),0,NULL, sum(4)) statement.
Any suggestions would be MOST appreciated. Thanks! -
ORA-00932: inconsistent datatypes: expected NUMBER got BLOB
Hello,
My query:
select name,mime_type,blob_content
from htmldb_application_files
error:ORA-00932: inconsistent datatypes: expected NUMBER got BLOB
What's going on?
TomHi,
So how can I check content of 'blob_content'?
Tom -
hello,
from the forum general questions invited me to enter this thread.
Re: ORA-00932: inconsistent datatypes: expected NUMBER got REF db.emp_person_ty
Can you help me?here's all the transactions after downloading oracle:
-start application start database;
-started get started with oracle database application 11g express edition;
-selected application express menu;
-'re logged in with the credentials defined sys + password to the installation;
created a workspace with:
- Username: db;
- Application username: dbase;
- Added password;
- Open the workspace I went on sql workshop;
- Then I clicked on sql commands;
- And I put the following commands:
- CREATE TYPE emp_person_typ AS OBJECT (
name VARCHAR2(30),
manager REF emp_person_typ );
-CREATE TABLE emp_person_obj_table OF emp_person_typ;
-INSERT INTO emp_person_obj_table VALUES (
emp_person_typ ('John Smith', NULL));
-SELECT *
FROM emp_person_obj_table;
-at this point I will get the following errors:
ORA-00932: inconsistent datatypes: expected NUMBER got REF db.emp_person_typ
I only do these operations I did! I did not change anything but these problems presented to me.
I also tried on two different machines but nothing changes. help me!!! -
ORA-00932: inconsistent datatypes: expected %s got %s
Hi All,
I am facing the following error while querying a form.
ORA-00932: inconsistent datatypes: expected %s got %s
Can anyone please help me with this.
Regards,
Shrutiuser11272043 wrote:
Hi All,
I am facing the following error while querying a form.You can query a table, Not sure how you query a form. What do you mean by form?
ORA-00932: inconsistent datatypes: expected %s got %sSomewhere (As you dint give us much to work with) you are using a incorrect datatype. For example Something that expects date and you pass number you will get this error.
Can anyone please help me with this.No, with what ever you have supplied its hard to help. Give us more details. -
ORA-00932: inconsistent datatypes: expected UDT got NUMBER
Hello Friends...
i got this error while inserting record ..
ORA-00932: inconsistent datatypes: expected UDT got NUMBER
wht is that UDT ??
Thanks..You cannot insert into your table STUDENT using the COURSE_TAB collection, since the column SUB is defined as a single object type.
So either you have to modify your insert into two inserts as follows;
INSERT INTO STUDENT VALUES(1,COURSE('1','ORACLE') )
INSERT INTO STUDENT VALUES(1,COURSE('2','JAVA') )
/or you have to modify your table structure so you can store a nested table, which will allow you to have a single insert
something like this:
drop table s
drop type course_tab
create or replace type course_type as object (
CNO CHAR(1),
C_CNAME VARCHAR2(10)
CREATE or replace TYPE course_tab AS TABLE OF course_type;
create table s ( c course_tab )
nested table c store as course_list
-- You can now have a single insert as follows:
1* insert into s (c) values ( course_tab ( course_type('1','Java'), course_type('2','Oracle')) )
SQL> /
1 row created.Be careful of using nested tables though. asktom reckons one should not use them.
P; -
ORA-00932: inconsistent datatypes: expected NUMBER got LONG
Hi,
I am facing problem while issuing the command:
ORA-00932: inconsistent datatypes: expected NUMBER got LONG
SELECT TEXT FROM USER_VIEWS WHERE TEXT LIKE '%ASCII%'
Any help will be needful for me
Thanks and RegardsPlease go through this
If you try to search a LONG column, this is what will happen:
SQL> select record_no, comments
2 from long_demo
3 where
4 comments like '%LONG%';
comments like '%LONG%'
ERROR at line 4:
ORA-00932: inconsistent data types
That's right; you can't search the contents of a LONG column. Here's what happens if you try to apply a function to a LONG column.
SQL> select record_no, substr(comments,1,5)
2 from long_demo;
select record_no, substr(comments,1,5)
ERROR at line 1:
ORA-00932: inconsistent data types
Again, Oracle won't enable you to apply a function to a LONG column. In a sense, you can think of a LONG column as a large container into which you can store or retrieve data--;but not manipulate it.
I have taken this content from
http://docs.rinet.ru/Oru7na95/ch10.html
which I refer to when I get stuck up. Hope this helps you. -
Ora-00932 inconsistent datatypes expected udt got char
I am getting the beloe exception while insert:
ora-00932 inconsistent datatypes expected udt got char
How to overcome this issue?
Query:
INSERT INTO syncdiffassociatedobject
(syncdiffassociatedobjectid,
sdao2syncdiff,
sdao2dimobject,
sdao2object,
sdao2upk,
sdao2udmclass,
NAME, nestedlevel, behaviour
VALUES (seq_sas.NEXTVAL,
TREAT (:b1 AS o_sync_differenceobject).sdo2syncdiff,
NVL (TREAT (:b2 AS o_sync_differenceobject).dimobjectid,
(SELECT udmclass2dimobject
FROM udmclass
WHERE udmclassid =
TREAT (:b8 AS o_sync_differenceobject).udmclassid)
TREAT (:b3 AS o_sync_differenceobject).objectid,
TREAT (:b4 AS o_sync_differenceobject).upk,
TREAT (:b5 AS o_sync_differenceobject).udmclassid,
TREAT (:b6 AS o_sync_differenceobject).NAME, 0, :b7desc syncdiffassociatedobject;
Column Name
ID
Pk
Null?
Data Type
Default
Histogram
Encryption Alg
Salt
SYNCDIFFASSOCIATEDOBJECTID
1
1
N
NUMBER
Yes
SDAO2SYNCDIFF
2
N
NUMBER
Yes
SDAO2DIMOBJECT
3
N
NUMBER
Yes
SDAO2OBJECT
4
Y
NUMBER
Yes
SDAO2UPK
5
Y
VARCHAR2 (240 Char)
Yes
SDAO2UDMCLASS
6
Y
NUMBER
Yes
NAME
7
Y
VARCHAR2 (240 Char)
Yes
OBJECTCONTEXT
8
Y
VARCHAR2 (2000 Char)
Yes
NESTEDLEVEL
9
N
NUMBER
Yes
BEHAVIOUR
10
N
NUMBER
Yes -
Hi Friends,
I am getting this error : ORA-00932: inconsistent datatypes: expected DATE got NUMBER at OCI call OCIStmtExecute when I am trying to put the filter condition on the date column.
"Dim-Time"."Day" <= cast(MAX("Dim-Time"."Day") as date) and "Dim-Time"."Day" >= TIMESTAMPADD(SQL_TSI_MONTH, -1,cast(MAX("Dim-Time"."Day") as date).
I have casted the max date but though I am getting the above error. I am thinking max(date) is creating the problem.
Please suggest your on opinion this.
Thanks.Not sure why you need cast in your statement if at all it is required then you need to do as below
cast("Dim-Time"."Day" as date)<= cast(MAX("Dim-Time"."Day") as date) and cast("Dim-Time"."Day" as date) >= TIMESTAMPADD(SQL_TSI_MONTH, -1,cast(MAX("Dim-Time"."Day") as date).
~ http://cool-bi.com -
ORA-00932: inconsistent datatypes: expected NUMBER got LABEL
Hello,
I get this error:
ORA-00932: inconsistent datatypes: expected NUMBER got LABEL
During an export of a rather large database. I've seen some threads that are similar to this issue but never one relating to doing a table export to .dmp file.
Can anyone help me understand it?Forgot to mention...
9.2.0.4 Database
9.2.0.6 Clusterware for RAC
Maybe you are looking for
-
Error while running ejbc - Deployment time
Whilst trying to deploy my WSE through J2EE deploy tool i get the follwoing error: Deployment failed on target Server localhost:4848 : Deployment Error -- Error while running ejbc -- Fatal Error from EJB Compiler -- jaxrpc compilation exception I am
-
Balance transaction currency in J1IH Additional excise
Dear All, I would like to add some additional excise for capital goods through J1IH Program and additional tab. I updated BED amount INR 2000 , ECESS ,INR 40 ,SCESS INR 20. Now i click the GL determination screen ,so that shown account entry as follo
-
Hi, I'm trying to parse an xml document using JSTL XML libraries. The following is a code snippet from my app: <x:parse var="ox" xml="${xml}"/> <x:set var="pageItemCount" select='count($ox/osSummary/summaryGroup/summaryItem)'/> <x:set var="
-
My itunes software crashes when accessing the music downloads. I use window 8.1
Is there a fix for itunes crashing when accessing the music download. I use windows 8.1?
-
Problem with refresh button in tool bar in ALV
hello experts, I am displaying a report using OOPS ALV. Here i am deleting one row. After deleting the row, if i clicked on REFRESH button in the tool bar, it should display the table newly with all updations which i made. w