Sync error....ORA-00932 Inconsistent datatypes
Hey all,
I am getting the following error when syncing:
MS-9109 n@86e554 (this seems to be random string) || ORA-00932: inconsistent datatypes
Now, I've narrowed it down to the field that causes this error to occur. It is important to note that if I don't touch the field (just keep the initial value from the initial sync to 8.1.7, things sync fine.
The error only occurs if I change the field value in 9iLite (which I am doing through me eVB app).
In 9iLite it is defined as:
Data_Type = Number, Len = 5, N = Y, Prec = 5, Scale = 4
In 8.1.7 it is defined as:
Data_type = Number (5,4) Null = N
I'm not sure why in Lite null is Y and in 8.1.7 null is N. I just let Oracle create the lite tables based on my snapshot. At any rate, the field is not null.
Does anyone have any thoughts? Does anyone know what the first part (MS-9109) of the error message is about? I can't find anything on it in Google.
Thx.
Darren
Well,
If fixed my problem. I just re-wrote the sql I had defined in the snapshot for the table in question. Still not sure why it didn't initally work as I didn't change the logic at all.
Darren.
Similar Messages
-
Error: ORA-00932: inconsistent datatypes: expected - got
getting error
OPEN pio_cstdn_extract_cur FOR v_chr_sql;
loop
fetch pio_cstdn_extract_cur bulk collect into l_c1, l_c2, l_c3 limit l_limit;
for i in 1 .. l_c1.count
loop
dbms_output.put_line( l_c1(i) || ',' || l_c2(i) || ',' || l_c3(i) );
end loop;
exit when pio_cstdn_extract_cur%notfound;
end loop;
close pio_cstdn_extract_cur;
_______________________________________________select extractvalue(XMLTYPE('<rrr>13</rrr>'),'/rrr') from dual;
-
Database error -ora-00932: inconsistent datatypes: expected number got date
The above error is generated on our new 11g OAS when we execute a specific workbook with a calculation with a case statement. The case statement is displayed below.
The error does not occur on our 10g OAS. Any ideas as to the cause/solution?
CASE WHEN Organization.Department IN ('1028','1023') THEN Organization."Specific Departments Desc" ELSE Organization."Department Desc" END
Thanks,
JerrePl identify exact version of Discoverer and OS versions, along with how you know this statement is generating this error. Pl see if you can enable a trace to find the cause of the error
How To Find Oracle Discoverer Diagnostic and Tracing Guides (Doc ID 290658.1)
http://download.oracle.com/docs/cd/E12839_01/bi.1111/b40107/logging_diagnostics.htm
HTH
Srini -
Error message - ORA-00932: inconsistent datatypes: expected CHAR got NUMBER
Here is my Report Query...
select
from DW_RFA_JOBDATA
where FINISH_TIME >= :P1_START_DATE
and FINISH_TIME < :P1_END_DATE
AND RFA_FLAG = (CASE :P1_JOB_CLASSIFICATION WHEN '0' THEN 'LSF'
WHEN '1' THEN 'NON-LSF'
ELSE RFA_FLAG END)The column RFA_FLAG data type is NUMBER(*,0)... i am displaying LSF and Non-LSF in the select list box , but i get the error ORA-00932: inconsistent datatypes: expected CHAR got NUMBER >
I have created static LOV with LSF display 0 return
NON-LSF display 1 return..
Could any body please help me in truble shooting the error ? how do i convert datatype into number i dont have any privileges to make changes to the table...Are there multiple columns in the table you are using from your LOV?
Your LOV select is:
select
from DW_RFA_JOBDATA
where FINISH_TIME >= :P1_START_DATE
and FINISH_TIME < :P1_END_DATE
AND RFA_FLAG = (CASE :P1_JOB_CLASSIFICATION WHEN '0' THEN 'LSF'
WHEN '1' THEN 'NON-LSF'
ELSE RFA_FLAG END)Maybe try this:
select
from DW_RFA_JOBDATA
where FINISH_TIME >= :P1_START_DATE
and FINISH_TIME < :P1_END_DATE
AND TO_CHAR(RFA_FLAG) = DECODE(:P1_JOB_CLASSIFICATION,'0','LSF','1','NON-LSF',RFA_FLAG) -
ORA-00932: inconsistent datatypes: expected - got CURSER
Hi all,
I created a Function and tried to execute it from SQL Plus, but am getting an error
ORA-00932: inconsistent datatypes: expected - got CURSER
I have been trying to debug for ages, but cant get to the root of what the problem might be. I would appreciate any help or idea's people could offer
The only comfort I take from this is that Oracle have a typo in one of their error messages :)
SQL PLUS CODE
select * FROM TABLE(CAST(tsoraimpdb.QueryAuthorsFunc(116, 1, -1, 1, 0) as tsoraimpdb.ENTITYIDTABLE));FUNCTION CODE
CREATE OR REPLACE FUNCTION &HKImpDB_Schema_Name..QueryAuthorsFunc
aKGID NUMBER,
aPageNumber NUMBER, -- The page interested
aPageSize NUMBER, -- Number of records per page
aOffset NUMBER, -- The offset = number of records already got
aTotalRecord NUMBER -- Total number of users in the database
RETURN sys_refcursor
as
l_FuncCur sys_refcursor;
l_TotalRecord NUMBER(10) := aTotalRecord;
l_Offset NUMBER(10) := aOffset;
l_PagingTable TEMP_T_TABLE:= TEMP_T_TABLE();
-- paging set up
l_MinRecordsOnAPge NUMBER(10); --last record on the previous page
l_MaxRecordsOnAPge NUMBER(10); --last record on the current page
begin
DBMS_OUTPUT.PUT_LINE('start');
select KnowdePos(rownum,p.ID) bulk collect into l_PagingTable
FROM KnowledgeGene kg
INNER JOIN HKResource r ON kg.KGOwner = r.ID
INNER JOIN Person p ON r.PersonID = p.ID
WHERE kg.kgid = akgid
ORDER BY p.FirstName + ' ' + p.LastName;
l_TotalRecord := l_PagingTable.count; -- get total records
DBMS_OUTPUT.PUT_LINE( l_TotalRecord);
if aPageSize > 0 then
if aPageNumber <= 0 then
Raise_application_error(-20003,'Invalid Page Number');
else
l_MinRecordsOnAPge := (aPageNumber-1)*aPageSize;
l_MaxRecordsOnAPge := aPageNumber*aPageSize;
end if;
else -- if @PageSize < 0 return all records
l_Offset := 0;
l_MinRecordsOnAPge := 0;
l_MaxRecordsOnAPge := l_TotalRecord;
END if;
-- return results for the correct page
open l_FuncCur for
SELECT pos
from HKResource r
INNER JOIN Person p ON r.PersonID = p.ID
inner join TABLE(CAST(l_PagingTable AS TEMP_T_TABLE)) on pos = p.id
WHERE KnowdeID > l_MinRecordsOnAPge - l_Offset AND KnowdeID <= l_MaxRecordsOnAPge - l_Offset;
return l_FuncCur;
EXCEPTION when NO_DATA_FOUND then null;
end;Ok, I think you could rewrite that as:
CREATE OR REPLACE PROCEDURE &HKImpDB_Schema_Name..QueryInterestedUsers
akgid int,
aPageSize int, -- Number of records per page
aPageNumber int, -- The page interested
aOffset int, -- The offset = number of records already got
aExcludeCategoryUser int,-- default(1), -- whether to exclude category users
aTotalRecord out NUMBER, -- Total number of users in the database
aCur out sys_refcursor
AS
-- paging set up
l_MinRecordsOnAPge NUMBER(10); --last record on the previous page
l_MaxRecordsOnAPge NUMBER(10); --last record on the current page
l_TopLevelTopicGroup NUMBER(10);
BEGIN
if aPageSize <= 0 or aPageNumber <= 0 then
Raise_application_error(-20003,'Invalid Page Size or Page Number');
else
l_MinRecordsOnAPge := (aPageNumber-1)*aPageSize;
l_MaxRecordsOnAPge := aPageNumber*aPageSize;
end if;
l_TopLevelTopicGroup := --currently not defined anywhere??!!?!
open aCur for
WITH excluded_users as (--exclude default user
SELECT ID as PersonID
FROM Person
where Username = 'default'
UNION ALL
-- exclude authors
SELECT p.ID as PersonID
FROM KnowledgeGene kg
INNER JOIN HKResource r ON kg.KGOwner = r.ID
INNER JOIN Person p ON r.PersonID = p.ID
WHERE kg.kgid = akgid
UNION ALL
-- exclude categories users if applicable
SELECT ua.PersonID
FROM HKGroup g
INNER JOIN UserAccount ua ON g.AccountID = ua.AccountID
WHERE g.ParentID = l_TopLevelTopicGroup
and aExcludeCategoryUser = 1),
PagingList as (SELECT rownum as ID,
p.ID AS PersonID,
P.Firstname||' '||P.LastName AS UserText,
p.AvatarFilename
FROM PanelKG
INNER JOIN Panel ON PanelKG.PanelID = Panel.PanelID -- MyHyperknowledge panels that contain this KG
INNER JOIN HKResource ON Panel.ResourceID = HKResource.ID -- the people who own the panels
INNER JOIN Person P ON HKResource.PersonID = P.ID
INNER JOIN PanelType pt ON pt.id = panel.panelid
INNER JOIN ProfileVisibility pv ON pv.PersonID = P.ID -- check visibility
INNER JOIN section sn ON sn.id = pv.SectionID
WHERE PanelKG.KGID = akgid
AND pt.name = 'MyHyperknowledge'
AND sn.name = 'MyHyperknowledge'
AND PanelKG.IsValid = 1
AND pv.Visible = 1
AND p.ID NOT IN (SELECT PersonID
FROM excluded_users))
-- return results for the correct page
SELECT PersonId,
UserText,
AvatarFilename
FROM PagingList
WHERE ID > l_MinRecordsOnAPge - aOffset
AND ID <= l_MaxRecordsOnAPge - aOffset;
ORDER BY usertext; -- moved the order here, as it didn't make sense to leave it in the subquery!
END QueryInterestedUsers;
/ Please also take note of the fact that you don't appear to have defined a value for "l_TopLevelTopicGroup" anywhere!
HTH -
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 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!!! -
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 -
ORA-00932 (Inconsistent datatype) on BLOB field in a view using Forms 6i
Hi
I created a table having a BLOB column and populate it with images and also make queries on that table using form 6i but when I use a view to build a form which built on that table when I try to query I receive the following error :
ORA-00932:Inconsistent datatype
The view created as simple as SELECT * FROM MY_TABLE and there is no problem with other columns in that view but BLOB column. I am using FORMS 6i (6.0.8.11.3)
I would be so glad if someone could help me.
thanx.I solved this problem by installing Forms 6i Patch 4a.
It was so easy, but I don't know if there is easier way to solve this problem.
Behrooz. -
Error: PL/SQL ORA-00932 inconsistent datatype when using LONG value
Good morning:
I am using a work PL/SQL script where I am using a LONG value in a cursor. When I execute it, I am receiving:
PL/SQL ORA-00932 inconsistent datatype: expected NUMBER got LONG
set serveroutput ON SIZE 1000000
set heading off
set feedback off
set trimspool off
set echo off
set term off
set pagesize 0
SPOOL &so_outfile;
DECLARE
v_data_file varchar2(30);
-- v_sch_code varchar2(10);
-- v_instance_name varchar2(10);
ws_path payroll.pybutfl.pybutfl_utl_file_path%TYPE;
v_data_line VARCHAR2 (2000) := NULL;
fhandle_o UTL_FILE.file_type;
v_line_count NUMBER := 0;
v_selected_count NUMBER := 0;
v_error_count NUMBER := 0;
v_written_count NUMBER := 0;
v_error_text VARCHAR2 (50) := ' AMACONF_ERR: Unable to write the line. ';
v_errm VARCHAR2 (255);
v_sqlerrm VARCHAR2 (255);
v_payment_type VARCHAR2(10);
CURSOR C1 IS
select RTRIM
AMRCONF_PIDM_ERR ||'|'||
AMRCONF_IDEN_CODE_ERR ||'|'||
AMRCONF_ENTRY_DATE_ERR ||'|'||
AMRCONF_CONFID_IND_ERR ||'|'||
*AMRCONF_COMMENT_ERR ||'|'||*
AMRSUBJ_SUBJ_CODE_ERR ||'|'||
ERROR_CODE ||'|'||
ERROR_CODE_TEXT ) data_line
from WSUALUMNI.AMRCONF_ERR;
BEGIN
DBMS_OUTPUT.put_line ('Program Generating AMACOMT Mass Update Error File ');
IF UTL_FILE.is_open (fhandle_o)
THEN
UTL_FILE.fclose (fhandle_o);
END IF;
/* Name The File Here */
v_data_file := ('Amaconf_error.txt');
SELECT RTRIM (pybutfl_utl_file_path)
INTO ws_path
FROM payroll.pybutfl;
fhandle_o := UTL_FILE.fopen (ws_path, v_data_file, 'w');
DBMS_OUTPUT.put_line ('UTLFILE file for this run is: ' || ws_path||'/'||v_data_file);
v_written_count := 0;
FOR c1_rec IN C1 LOOP
BEGIN
v_selected_count := v_selected_count + 1;
v_data_line := rtrim(c1_rec.data_line);
UTL_FILE.put_line (fhandle_o, v_data_line);
v_written_count := v_written_count + 1;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (v_error_text);
v_error_count := v_error_count + 1;
END;
END LOOP;
DBMS_OUTPUT.put_line ('Number of Records Selected: ' || v_selected_count);
DBMS_OUTPUT.put_line ('Number of Records Written: ' || v_written_count);
IF UTL_FILE.is_open (fhandle_o)
THEN
UTL_FILE.fclose (fhandle_o);
END IF;
END;
SPOOL OFF;If I comment out the "AMRCONF_COMMENT_ERR ||'|'||" line, then the script works fine. The table was created as:
Create Table WSUALUMNI.AMRCONF_ERR
AMRCONF_PIDM_ERR NUMBER (8) NOT NULL,
AMRCONF_IDEN_CODE_ERR VARCHAR2(5) NOT NULL,
AMRCONF_ENTRY_DATE_ERR DATE NOT NULL,
AMRCONF_CONFID_IND_ERR VARCHAR2(1),
AMRCONF_COMMENT_ERR LONG,
AMRSUBJ_SUBJ_CODE_ERR VARCHAR2(5) NOT NULL,
ERROR_CODE VARCHAR2(12) NOT NULL,
ERROR_CODE_TEXT VARCHAR2(50) NOT NULL
); I don't get what is the problem here in the script.Hi,
Feew suggestions
1) LONG is a deprecated type hence if possible start working on changing that column
2) CLOB will your preferred datatype over LONG.
3) you cannot use RTRIM on long.
here is a very quick example
drop table h
create table h (x long,y varchar2(100))
select rtrim(x) from h
select rtrim(y) from hSolution:
[http://www.oracle.com/technology/oramag/code/tips2003/052503.html]
need a better solution change the datatype to clob and
drop table h
create table h (x clob,y varchar2(100))
select dbms_lob.substr( x, 4000, 1 ) from h
select rtrim(y) from hCheers!!!
Bhushan -
Why do I get this error? ORA-00932: inconsistent datatypes
This is my stored procedure I've created to select only the exact amount of records per page for a GridView (for ASP.NET):
CREATE OR REPLACE
PROCEDURE SELECT_COMMAND
(pTable IN VARCHAR2
, pFields IN VARCHAR2
, pSortField IN VARCHAR2
, pPageIndex IN NUMBER
, pTotalRecs IN NUMBER
, pResultSet OUT SYS_REFCURSOR
) AS
BEGIN
EXECUTE IMMEDIATE
'SELECT ' || pFields || ' FROM '
|| '(SELECT '|| pFields ||', ROW_NUMBER() OVER(ORDER BY '|| pSortField ||') ROW_NUM '
|| 'FROM '|| pTable ||') WHERE ROW_NUM BETWEEN '|| to_char(pPageIndex*pTotalRecs) ||' AND '
|| to_char((pPageIndex+1)*pTotalRecs)
INTO pResultSet;
-- Plus 1 to our index because GridView is a zeroth index collection
END SELECT_COMMAND;I then do a test case with the following paremeters:
declare
p_test sys_refcursor;
begin
select_command('v_sig_devices', '"JOB", "LINE"', '"DEVICE_ID"', 0, 10, p_test);
end;But I get the following error:
>
Error report: ORA-00932: inconsistent datatypes: expected - got -
ORA-06512: at "SIM.SELECT_COMMAND", line 10
ORA-06512: at line 4
00932. 00000 - "inconsistent datatypes: expected %s got %s"
>
At first Oracle gave me an error because the numbers were not a string. Then I convert them into a string (with to_char) and Oracle is still not happy! Any ideas as to why this is happening?
Thanks for any help that you can provide.You don't select into ref cursors, you open them:
SQL> create table t(c varchar2(1));
Table created.
SQL> insert into t values ('a');
1 row created.
SQL> insert into t values ('b');
1 row created.
SQL> insert into t values ('c');
1 row created.
SQL> commit;
Commit complete.
SQL> create or replace
2 procedure p (p_ref out sys_refcursor) as
3 begin
4 open p_ref for 'select c from t';
5 end;
6 /
Procedure created.
SQL> var results refcursor
SQL> exec p(:results);
PL/SQL procedure successfully completed.
SQL> print results
C
a
b
c -
Help with error select case statement (ORA-00932: inconsistent datatypes)
Hi,
I'm struggling to get my sql query work on Oracle..
I have a table MyTable with 5 columns ( Column1, Column2, Column3, Column4, Column5 ) all are of type NVARCHAR2.
I need to check whether Column 3, Column 4 are empty or not in that order..and if they values then I wanna append it to Column2.
For example
If a row contains the following values,
Column 2 = a.b
Column 3 = 123
Column 4 = xyz
then column CA = a.b/123/xyz where column CA = temp column
If either Column 3 or Column 4 is empty/null, then I don't need to append value for that column..
For example
Column 2 = a.b
Column 3 = either NULL or ''
Column 4 = xyz
then CA = a.b/xyz where column CA = temp column
similarly..
Column 2 = a.b
Column 3 = 123
Column 4 = either NULL or ''
then CA = a.b/123 where column CA = temp column
Here is my query..
select MyTable.Column1 as CA0,
MyTable.Column2 as CA1,
MyTable.Column3 as CA2,
MyTable.Column4 as CA3,
MyTable.Column5 as CA4,
MyTable.Column2 + CASE WHEN MyTable.Column3 > '' THEN '/' + MyTable.Column3 ELSE '' END + CASE WHEN MyTable.Column4 > '' THEN '/' + MyTable.Column4 ELSE '' END CA
from MyTable;
This query works just fine against SQL Server db, but gainst Oracle I'm getting
ORA-00932: inconsistent datatypes: expected NUMBER got CHAR
00932. 00000 - "inconsistent datatypes: expected %s got %s"
Could you please let me know what I'm doing wrong. I need to get this query working on both SQL Server and Oracle..
Please let me know your suggestions and thoughts..
Cheers,I need to check whether Column 3, Column 4 are empty or not in that order..and if they values then I wanna append it to Column2. In Oracle, you can do it this way - no need to do all kinds of difficult things:
select col2||col3||col4
from tbl -
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
Maybe you are looking for
-
Itunes sync music to ipod but music not visible in ipod once disconnected
Hi, my ipod nano refuses to show any songs I've synchronized. it all started last week, I connected the nano to charge the battery and change my music selection. Itunes (v 8.1 (50)) told me something like it had to erase the ipod for some reasons. I
-
Problem in Final Result in PL/SQL
Dear All, I have a problem in the final output of PL/SQL. I am using cursor and one SQL statement. Following is the complete procedure. First select after BEGIN inserts values in one table and that is fine. When second SQL is called by CURSOR while u
-
5G 30G Ipod won't charge or sync
My Ipod won't charge when connected to my laptop. It does charge when plugged into my car radio transmitter and dock. When I plug it into my laptop fully charged I get a message from windows explorer asking me if I want to scan and clean it to repair
-
Element 9 error "Rolling back the installation of Elements 9" failed.??
I just bought Elements 9 for Windows. And anytime I try to download it, it says "Rolling back the installation of Elements 9" then says "shared technologies failed"? I have tried multiple things listed on here and nothing helps. Does anyone know how
-
how to copy report list to internal table