ODI11g Union error
Hi ALl,
When I try tp do the union operation in ODI 11g in two tables from the same schema. I am getting the following error and in the code it s is not taking the Union while it is inserting to I$ table.can anyone help me with this
Hi,
I am getting the follwoing error on union of two tables from same schema and target table is belongs to another schema..
Source 1 : SCHEMA A
Source 2 : SCHEMA A
Target : SCHEMA B
ODI-1228: Task INF_claim_DIM (Integration) fails on the target ORACLE connection ODS_DDS.
Caused By: java.sql.SQLSyntaxErrorException: ORA-00904: "C3_CLAIM_CODE": invalid identifier
ODI CODE at Insert flow into I$ table : Note : It is not showing the union
insert into ODS_DDS.I$_CLAIM_DIM
CLAIM_NAME,
CLAIM_DESCRIPTION,
CLAIM_CODE
select
C1_CLAIM_NAME,
C2_CLAIM_DESCRIPTION,
C3_CLAIM_CODE
from _ ODS_DDS.C$_1CLAIM_DIM
where
(1=1)
The ODI process created two work tables C$_0 tablename with columns C1,C2,C3 and another table C$_1tablename with C4,C5,C6 columns.
But when the process inserting into I$(integration) it was trying to get data from C$_1 with C1,C2,C3 columns so throwing an error as invalid identifier C1.
because C1,C2,C3 columns from C$_0 not in C$_1tablename work table
Please help me
Thanks
Similar Messages
-
Hi,
I am trying to implement Union All in ODI11g. I have a plsql procedure and want to re-implement it in ODI11G.
Mine procedure is like:
INSERT INTO STAGE_TABLE1
(CustomerType, other fields)
select 'RETAILER' AS customertype,other fields
from table1 ,table2, table3
where table1.col1= table2.col2
and table2.col2 = table3.col3
UNION ALL
SELECT 'SUPERMARKET' AS CUSTOMERTYPE, OTHER FIELDS
FROM TABLE4, TABLE5, TABLE6
WHERE TABLE4.COL1 = TABLE5.COL7
AND TABLE6.COL8 = TABLE5.COL3
For applying Union, I add two datasets in the interface. Dataset1 is the first part of the insert script and dataset2 is the second part of the insert script.
In the select scripts, customer type retailer and supermarket are hardcoded literals , they are not a column of a table.
So I took the error message below when I want to execute the interface:
I am having the error message below:
"Target Mapping for Column CustomerType in DataSet DATASET1 A mapping executed on source must contain references to source columns in the implementation code or a source datastore be explicitly set in the execution location. Check this mapping code, "Thank you.
I changed the Execute On option.
Then ODI requests Primary Key for tables; then I add primary keys.
Now I simulated and try to execute; but there is no union opertor in the generated sql.
I checked the address: http://odiexperts.com/tag/union
They are using java code for implementing multiple datasets with different sources.
In some other examples, they are using same tables from different schemes like HR.EMPLOYEES and SCOTT.EMPLOYEES
But I have two tables within the same scheme like hr.employees and hr.managers
Generated sql is like:
insert into EDM_PRD.I$_TARGET_TABLE
NAME,
SURNAME,
ID,
IND_UPDATE
select
HR.EMPLOYEES.NAME,
HR.EMPLOYEES.SURNAME,
HR.EMPLOYEES.ID ,
'I' IND_UPDATE
from HR.MANAGERS MANAGERS
where (1=1) -
LOV with Select Union - ERROR 30049
Hi, guys.
I'm facing some troubles to deal with Select Union in a Lov.
When I'm trying to run the forms, it shows me the error FRM-30049 in column mapping properties.
Actually, I don't know if Forms supports it. The code below worked out in ORACLE SQLPLUS.
Follows the code:
SELECT (SUBSTR(cust_name,1,15) ||' - '||'Customer'),
cust_cod
FROM customers
UNION
SELECT (SUBSTR(supl_name,1,15)||' - '||'Supplier'),
supl_COD
FROM suppliers;
May someone give me a hint?
Thanks in advance.I'm sorry.
I've found my error. It was just necessary adjust the column mapping long propertie.
Now, it's working.
Sorry, again.
Have a nice day.
Thanks anyway. -
Error while using Group By on 2 Querys joined by union
Hello Everyone
I have a situation where in one report i cannot group the data and in another report when i group the data i am unable to view subject area.
I Had a Complex Request from my client , i have to claculate a report based on 2 dimensions i.e i am calculating 2 measures from one dimension and other 3 measures from other dimension and then using UNION to join both the querys , for the same description the data is being displayed in 2 rows , then i i tried to combine both the querys from union and trying to select from those then i am getting the result and the problem is i am unable to access the subject area , its giving "Either you do not have permission to use the subject area within Answers, or the subject area does not exist." Error , i am unable to add prompts to these request
I want the investor Grants Row to be displayed in one Column , I am already using Group by in one of the querys.
Study Cost Approved Committed Earned Paid Balance
Investigator Grants 350,000.00 113,770.78 0.00 0.00 0.00
Investigator Grants 350,000.00 113,770.78 42,403.13 19,905.90 22,497.23
Labs 23,000.00 0.00 0.00 0.00 0.00
Study Drug 47,000.00 0.00 0.00 0.00 0.00
Other 0.00 0.00 0.00 0.00 0.00
Here is my query
SELECT "- Protocol"."Protocol #" saw_0, "- Protocol"."Working Title" saw_1, CURRENT_DATE saw_2, "- Administration"."Display Currency Code" saw_3, "- Protocol"."Managing Country" saw_4, "- Protocol".Country saw_5, "- Protocol"."Country OPS" saw_6, "- Protocol"."EU Country" saw_7, "- Protocol"."GCO Region" saw_8, "- Protocol"."GPB Region" saw_9, "- Administration"."Study Cost" saw_10, SUM (IfNull("- Budget and Payment Facts"."Protocol Cost Line Item Amount - Display CCY",0) BY "- Administration"."Study Cost" ) saw_11, SUM(IfNull("- Budget and Payment Facts"."Committed Amount - Display CCY",0) BY "- Administration"."Study Cost") saw_12, SUM(IfNull("- Budget and Payment Facts"."Actual Amount - Display CCY",0) BY "- Administration"."Study Cost") saw_13, SUM(IfNull("- Budget and Payment Facts"."Amount Paid (SP) - Display CCY",0) BY "- Administration"."Study Cost") saw_14, SUM(IfNull("- Budget and Payment Facts"."Actual Amount - Display CCY",0)-IfNull("- Budget and Payment Facts"."Amount Paid (SP) - Display CCY",0) BY "- Administration"."Study Cost") saw_15, CASE WHEN "- Administration"."Study Cost" = 'Other' THEN 1 END saw_16 FROM "SPECTRUM Reporting" WHERE ("- Administration"."Display Currency Code" = 'USD') AND ("- Protocol"."Protocol #" = 'P31248') UNION SELECT "- Protocol"."Protocol #" saw_0, "- Protocol"."Working Title" saw_1, CURRENT_DATE saw_2, "- Administration". "Display Currency Code" saw_3, "- Protocol"."Managing Country" saw_4, "- Protocol".Country saw_5, "- Protocol"."Country OPS" saw_6, "- Protocol"."EU Country" saw_7, "- Protocol"."GCO Region" saw_8, "- Protocol"."GPB Region" saw_9, "- Administration"."Study Cost" saw_10, IfNull("- Budget and Payment Facts"."Protocol Cost Line Item Amount - Display CCY",0) saw_11, IfNull("- Budget and Payment Facts"."Committed Amount - Display CCY",0) saw_12, 0.00 saw_13, 0.00 saw_14, 0.00 saw_15, CASE WHEN "- Administration"."Study Cost" = 'Other' THEN 1 END saw_16 FROM "SPECTRUM Reporting" WHERE ("- Protocol"."Protocol #" = 'P31248') AND ("- Administration". "Display Currency Code" = 'USD') ORDER BY saw_16 DESC
Any help is appreciated ..!
~SrixHere is the query i used to group the data but i cannot access Answers with this query
SELECT saw_0 saw_0, saw_1 saw_1, saw_2 saw_2, saw_3 saw_3, saw_4 saw_4, saw_5 saw_5, saw_6 saw_6, saw_7 saw_7, saw_8 saw_8, saw_9 saw_9, saw_10 saw_10, SUM(saw_11 BY saw_10) saw_11, SUM(saw_12 BY saw_10 ) saw_12, SUM(saw_13 BY saw_10) saw_13, SUM(saw_14 BY saw_10) saw_14, SUM(saw_15 BY saw_10) saw_15, saw_16 saw_16 FROM (SELECT "- Protocol"."Protocol #" saw_0, "- Protocol"."Working Title" saw_1, CURRENT_DATE saw_2, "- Administration"."Display Currency Code" saw_3, "- Protocol"."Managing Country" saw_4, "- Protocol".Country saw_5, "- Protocol"."Country OPS" saw_6, "- Protocol"."EU Country" saw_7, "- Protocol"."GCO Region" saw_8, "- Protocol"."GPB Region" saw_9, "- Administration"."Study Cost" saw_10, SUM (IfNull("- Budget and Payment Facts"."Protocol Cost Line Item Amount - Display CCY",0) BY "- Administration"."Study Cost" ) saw_11, SUM(IfNull("- Budget and Payment Facts"."Committed Amount - Display CCY",0) BY "- Administration"."Study Cost") saw_12, SUM(IfNull("- Budget and Payment Facts"."Actual Amount - Display CCY",0) BY "- Administration"."Study Cost") saw_13, SUM(IfNull("- Budget and Payment Facts"."Amount Paid (SP) - Display CCY",0) BY "- Administration"."Study Cost") saw_14, SUM(IfNull("- Budget and Payment Facts"."Actual Amount - Display CCY",0)-IfNull("- Budget and Payment Facts"."Amount Paid (SP) - Display CCY",0) BY "- Administration"."Study Cost") saw_15, CASE WHEN "- Administration"."Study Cost" = 'Other' THEN 1 END saw_16 FROM "SPECTRUM Reporting" WHERE ("- Administration"."Display Currency Code" = 'USD') AND ("- Protocol"."Protocol #" = 'P31248') AND ("- Payment"."Payment Number"="- Payment"."Related Payment Request Number")
UNION SELECT "- Protocol"."Protocol #" saw_0, "- Protocol"."Working Title" saw_1, CURRENT_DATE saw_2, "- Administration". "Display Currency Code" saw_3, "- Protocol"."Managing Country" saw_4, "- Protocol".Country saw_5, "- Protocol"."Country OPS" saw_6, "- Protocol"."EU Country" saw_7, "- Protocol"."GCO Region" saw_8, "- Protocol"."GPB Region" saw_9, "- Administration"."Study Cost" saw_10, IfNull("- Budget and Payment Facts"."Protocol Cost Line Item Amount - Display CCY",0) saw_11, IfNull("- Budget and Payment Facts"."Committed Amount - Display CCY",0) saw_12, 0.00 saw_13, 0.00 saw_14, 0.00 saw_15, CASE WHEN "- Administration"."Study Cost" = 'Other' THEN 1 END saw_16 FROM "SPECTRUM Reporting" WHERE ("- Administration"."Display Currency Code" = 'USD') AND ("- Protocol"."Protocol #" = 'P31248')) T GROUP BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6, saw_7, saw_8, saw_9, saw_10 , saw_11, saw_12, saw_13, saw_14, saw_15, saw_16 ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6 -
Error while executing UNION ALL query
Hello everyone,
I'm executing the below query on Oracle 9.2.0.8 version.
select hdr.*
from ttl_hdr hdr, ttl_service ser
where hdr.cus_nbr = ser.cus_nbr
and hdr.dn in ('1232','2342',343','343')
union all
select hdr.*
from ttl_hdr_his hdr, ttl_service ser
where hdr.cus_nbr = ser.cus_nbr
and hdr.dn in ('1232','2342',343','343')
and I encounter following error:
ORA-01790: expression must have same datatype as corresponding expression
But instead of * if I'm specifying a list of few columns, it executes the query properly.
Can anybody tell me what the problem is ?
regards,
RossyHi,
All columns in your tables TTL_HDR and TTL_HDR_HIS are not with same data type.
I'm sure you get same error if you specify all columns that * brings.
Specify column names and use conversion function to get data type same to column from both selects.
PS: and I think this is not Application Express related
Br, Jari -
Re Creating a chart getting an error with a 'Union All' statement
Hi
I have some data to chart with the following fields;
Product , Jul-08 , Aug-08, Sep-08 etc ...... to Jan-10.
The PRODUCT field is text showing the numerous Product Names
The Jul-08 & other month fields have numbers per product that is to be aggregated for that month & plotted on the line graph.
My SQL to create the first point on the chart is as below;
select null link, PRODUCT label, SUM(JUL-08) "FFF"
from "SCHEMANAME"."TABLENAME"
WHERE PRODUCT = 'FFF'
GROUP by PRODUCT
ORDER BY PRODUCT
This works fine until I want add the second point of this line graph using a 'union all' join as follows;
select null link, PRODUCT label, SUM(JUL_08) "FFF"
from "SCHEMANAME"."TABLENAME"
WHERE PRODUCT = 'FFF'
UNION ALL
select null link, PRODUCT label, SUM(AUG_08) "FFF"
from "SCHEMANAME"."TABLENAME"
WHERE PRODUCT = 'FFF'
I can't work out how I can join the other months on the line graph in one series.
The error is as follows;
1 error has occurred
Failed to parse SQL query:
select null link, PRODUCT label, SUM(OCT_09) "NCDS - STD" from "BI_A_DATA"."CDW_VS_NCDS_CALLS" WHERE PRODUCT = 'NCDS - STD' UNION ALL select null link, PRODUCT label, SUM(NOV_09) "NCDS - LOCAL" from "BI_A_DATA"."CDW_VS_NCDS_CALLS" WHERE PRODUCT = 'NCDS - LOCAL'
ORA-00937: not a single-group group function
Certain queries can only be executed when running your application, if your query appears syntactically correct, you can save your query without validation (see options below query source).
Can anyone assist?
I want a continuous Line Graph that shows all the months from Jul-08 , Aug-08, Sep-08 etc ...... to Jan-10 for the same product.
I will then add other series for the other products, ThanksOK, I thought each month would be separated by the different months in each selct subquery, but I see what you mean.
I'm creating a line graph for various PRODUCTS that has a numeric value for each month, from JUL_08 ..... for a number of months.
I want a LINE graph that shows the different totals each month for that PRODUCT.
The error advises that there are more values in the SELECT statement than the expected and to use Use the following syntax:
SELECT LINK, LABEL, VALUE
FROM ...
I then went on to use the '[ ]' brackets to separate data but this didn't fix the problem.
I've changed the script to suit as per your 'PERIOD' addition but now have the error as per below;
error script
1 error has occurred
Invalid chart query: SELECT null link, PRODUCT label, PERIOD, SUM(ABC) FROM (SELECT null link, PRODUCT, 'JUL_08' PERIOD,SUM(JUL_08)ABC FROM BI_A_DATA.APEX_TEST WHERE PRODUCT = 'ABC' GROUP BY PRODUCT UNION ALL SELECT null link, PRODUCT, 'AUG_08' PERIOD,SUM(AUG_08)ABC FROM BI_A_DATA.APEX_TEST WHERE PRODUCT = 'ABC' GROUP BY PRODUCT UNION ALL SELECT null link, PRODUCT, 'SEP_08' PERIOD,SUM(SEP_08)ABC FROM BI_A_DATA.APEX_TEST WHERE PRODUCT = 'ABC' GROUP BY PRODUCT) GROUP BY link, PRODUCT, PERIOD
Use the following syntax:
SELECT LINK, LABEL, VALUE
FROM ...
Or use the following syntax for a query returning multiple series:
SELECT LINK, LABEL, VALUE1 [, VALUE2 [, VALUE3...]]
FROM ...
LINK URL
LABEL Text that displays along a chart axis.
VALUE1, VALUE2, VALUE3... Numeric columns that define the data values.
Note: The series names for Column and Line charts are derived from the column aliases used in the query.
My script amended;
SELECT null link, PRODUCT label, PERIOD, SUM(ABC)
FROM
(SELECT null link, PRODUCT, 'JUL_08' PERIOD,SUM(JUL_08)ABC
FROM BI_A_DATA.APEX_TEST
WHERE PRODUCT = 'ABC'
GROUP BY PRODUCT
UNION ALL
SELECT null link, PRODUCT, 'AUG_08' PERIOD,SUM(AUG_08)ABC
FROM BI_A_DATA.APEX_TEST
WHERE PRODUCT = 'ABC'
GROUP BY PRODUCT
UNION ALL
SELECT null link, PRODUCT, 'SEP_08' PERIOD,SUM(SEP_08)ABC
FROM BI_A_DATA.APEX_TEST
WHERE PRODUCT = 'ABC'
GROUP BY PRODUCT)
GROUP BY link, PRODUCT, PERIOD -
Error on union with order by clause
here is my sql.
i want sort this sql by start_timestamp.
select name,
enumber,
to_char(new_time(start_TimeStamp,'gmt','edt'),'MM/DD/YY HH24:MI:SS'),
ssn
from emp
where
ename = 'joh%'
and
start_TimeStamp9 > TO_DATE('2007-01-15 00:00:01','YYYY-MM-DD HH24:MI:SS')
and end_TimeStamp11 < TO_DATE('2007-01-18 22:59:59','YYYY-MM-DD HH24:MI:SS')
union
select name,
enumber,
to_char(new_time(start_TimeStamp,'gmt','edt'),'MM/DD/YY HH24:MI:SS'),
ssn
from emp
where
ename = 'joh%'
and
start_TimeStamp9 > TO_DATE('2007-01-15 00:00:01','YYYY-MM-DD HH24:MI:SS')
and end_TimeStamp11 < TO_DATE('2007-01-18 22:59:59','YYYY-MM-DD HH24:MI:SS')
union
select name,
enumber,
to_char(new_time(start_TimeStamp,'gmt','edt'),'MM/DD/YY HH24:MI:SS'),
ssn
from emp
where
ename = 'kris%'
and
start_TimeStamp9 > TO_DATE('2007-01-15 00:00:01','YYYY-MM-DD HH24:MI:SS')
and end_TimeStamp11 < TO_DATE('2007-01-18 22:59:59','YYYY-MM-DD HH24:MI:SS')
union
select name,
enumber,
to_char(new_time(start_TimeStamp,'gmt','edt'),'MM/DD/YY HH24:MI:SS'),
ssn
from emp
where
ename = 'wal%'
and
start_TimeStamp9 > TO_DATE('2007-01-15 00:00:01','YYYY-MM-DD HH24:MI:SS')
and end_TimeStamp11 < TO_DATE('2007-01-18 22:59:59','YYYY-MM-DD HH24:MI:SS')
order by 3;
i got this error.
ORA-01785: ORDER BY item must be the number of a SELECT-list expression
start_timestamp is the 3rd column of the sql.
why i am getting this error.
i tried this also.
order by to_char(new_time(start_TimeStamp,'gmt','edt'),'MM/DD/YY HH24:MI:SS');
still i got error.Also, be ready for a few surprises when you try to sort dates as strings (by using TO_CHAR):
[email protected]> alter session set nls_date_format = 'mm/dd/yyyy hh24:mi:ss';
Session altered.
[email protected]>
[email protected]> --
[email protected]> -- incorrect order
[email protected]> --
[email protected]> select num, dt
2 from (
3 select 1 as num, to_char(new_time(to_date('10/12/01 07:20:33',
4 'mm/dd/yy hh24:mi:ss'),'gmt','edt')) as dt from dual
5 union
6 select 2, to_char(new_time(to_date('07/22/07 08:10:23',
7 'mm/dd/yy hh24:mi:ss'),'gmt','edt')) as dt from dual
8 union
9 select 3, to_char(new_time(to_date('11/29/99 15:34:49',
10 'mm/dd/yy hh24:mi:ss'),'gmt','edt')) from dual
11 )
12 order by dt;
NUM DT
2 07/22/2007 04:10:23
1 10/12/2001 03:20:33
3 11/29/2099 11:34:49
[email protected]>
[email protected]> --
[email protected]> -- correct order
[email protected]> --
[email protected]> select num, dt
2 from (
3 select 1 as num, new_time(to_date('10/12/01 07:20:33',
4 'mm/dd/yy hh24:mi:ss'),'gmt','edt') as dt from dual
5 union
6 select 2, new_time(to_date('07/22/07 08:10:23',
7 'mm/dd/yy hh24:mi:ss'),'gmt','edt') from dual
8 union
9 select 3, new_time(to_date('11/29/99 15:34:49',
10 'mm/dd/yy hh24:mi:ss'),'gmt','edt') from dual
11 )
12 order by dt;
NUM DT
1 10/12/2001 03:20:33
2 07/22/2007 04:10:23
3 11/29/2099 11:34:49
[email protected]>
[email protected]>I'd say it's best to sort dates as dates always, and never as strings.
isotope -
Error when I change UNION to UNION ALL
Hi,
In the SQL below, I have a union in which I dont care about duplicates (in fact I know there wont be any). Hence, I want to avoid any overhead of sorting and checking for same, by replacing it with UNION ALL. The SQL runs fine with UNION, but complains when I change it to UNION ALL, which I cannot explain. The error message is "Error: java.sql.SQLException: ORA-00936: missing expression, SQL State: 42000, Error Code: 936"
Here is the SQL:
SELECT activ_I, activ_C, cases.I_OCCASTYP_CASES, cases.C_OCCASTYP_CASES FROM TOCCASE cases JOIN (
SELECT I activ_I, C activ_C, I_OCCASE_RESULTINGFROM, C_OCCASE_RESULTINGFROM FROM TOCPROCESSINSTANCE activ JOIN (
SELECT I_OCACTVTY_CHANGES, C_OCACTVTY_CHANGES FROM TOCTransferActivityChange x
WHERE I_TO IN (2)
AND C_TO = 1009
AND CHANGEDATE <= to_date('2009-05-16 00:00:00','YYYY-MM-DD HH24:MI:SS')
AND CHANGEDATE = (SELECT MAX(z.CHANGEDATE) FROM TOCTransferActivityChange z WHERE z.I_OCACTVTY_CHANGES = x.I_OCACTVTY_CHANGES AND z.C_OCACTVTY_CHANGES = x.C_OCACTVTY_CHANGES)
) latest_user_tx ON activ.I = latest_user_tx.I_OCACTVTY_CHANGES AND activ.C = latest_user_tx.C_OCACTVTY_CHANGES
WHERE activ.C = 11200 AND activ.I_OCCASE_RESULTINGFROM IS NOT NULL AND activ.C_OCCASE_RESULTINGFROM IS NOT NULL
UNION ALL (
SELECT I activ_I, C activ_C, I_OCCASE_RESULTINGFROM, C_OCCASE_RESULTINGFROM FROM TOCTASK activ JOIN (
SELECT I_OCACTVTY_CHANGES, C_OCACTVTY_CHANGES FROM TOCTransferActivityChange x
WHERE I_TO IN (2)
AND C_TO = 1009
AND CHANGEDATE <= to_date('2009-05-16 00:00:00','YYYY-MM-DD HH24:MI:SS')
AND CHANGEDATE = (SELECT MAX(z.CHANGEDATE) FROM TOCTransferActivityChange z WHERE z.I_OCACTVTY_CHANGES = x.I_OCACTVTY_CHANGES AND z.C_OCACTVTY_CHANGES = x.C_OCACTVTY_CHANGES)
) latest_user_tx ON activ.I = latest_user_tx.I_OCACTVTY_CHANGES AND activ.C = latest_user_tx.C_OCACTVTY_CHANGES
WHERE activ.C = 11554 AND activ.I_OCCASE_RESULTINGFROM IS NOT NULL AND activ.C_OCCASE_RESULTINGFROM IS NOT NULL
) activity_transfers ON activity_transfers.I_OCCASE_RESULTINGFROM = cases.I AND activity_transfers.C_OCCASE_RESULTINGFROM = cases.C
If I run the UNION ALL as is without the join to TOCCASE it works fine as well. The columns in each part of the union are the same so I have no idea why its failing.
I am running the following version of Oracle:
"Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production" (as returned from "select * from v$version")
thanks for any info
Edited by: user11176141 on 18-May-2009 03:15Thanks for the input!
When I remove the bracket after the ALL keyword, I get the an error "Error: java.sql.SQLException: ORA-00920: invalid relational operator
, SQL State: 42000, Error Code: 920". I assume this is because I had a corresponding closing bracket, so I removed that as well. However, I now get the error "Error: java.sql.SQLException: ORA-00920: invalid relational operator, SQL State: 42000, Error Code: 920". so as it is now the SQL reads
SELECT activ_I, activ_C, cases.I_OCCASTYP_CASES, cases.C_OCCASTYP_CASES FROM TOCCASE cases JOIN (
SELECT I activ_I, C activ_C, I_OCCASE_RESULTINGFROM, C_OCCASE_RESULTINGFROM FROM TOCPROCESSINSTANCE activ JOIN (
SELECT I_OCACTVTY_CHANGES, C_OCACTVTY_CHANGES FROM TOCTransferActivityChange x
WHERE I_TO IN (2)
AND C_TO = 1009
AND CHANGEDATE <= to_date('2009-05-16 00:00:00','YYYY-MM-DD HH24:MI:SS')
AND CHANGEDATE = (SELECT MAX(z.CHANGEDATE) FROM TOCTransferActivityChange z WHERE z.I_OCACTVTY_CHANGES = x.I_OCACTVTY_CHANGES AND z.C_OCACTVTY_CHANGES = x.C_OCACTVTY_CHANGES)
) latest_user_tx ON activ.I = latest_user_tx.I_OCACTVTY_CHANGES AND activ.C = latest_user_tx.C_OCACTVTY_CHANGES
WHERE activ.C = 11200 AND activ.I_OCCASE_RESULTINGFROM IS NOT NULL AND activ.C_OCCASE_RESULTINGFROM IS NOT NULL
UNION ALL
SELECT I activ_I, C activ_C, I_OCCASE_RESULTINGFROM, C_OCCASE_RESULTINGFROM FROM TOCTASK activ JOIN (
SELECT I_OCACTVTY_CHANGES, C_OCACTVTY_CHANGES FROM TOCTransferActivityChange x
WHERE I_TO IN (2)
AND C_TO = 1009
AND CHANGEDATE <= to_date('2009-05-16 00:00:00','YYYY-MM-DD HH24:MI:SS')
AND CHANGEDATE = (SELECT MAX(z.CHANGEDATE) FROM TOCTransferActivityChange z WHERE z.I_OCACTVTY_CHANGES = x.I_OCACTVTY_CHANGES AND z.C_OCACTVTY_CHANGES = x.C_OCACTVTY_CHANGES)
) latest_user_tx ON activ.I = latest_user_tx.I_OCACTVTY_CHANGES AND activ.C = latest_user_tx.C_OCACTVTY_CHANGES
WHERE activ.C = 11554 AND activ.I_OCCASE_RESULTINGFROM IS NOT NULL AND activ.C_OCCASE_RESULTINGFROM IS NOT NULL
) activity_transfers ON activity_transfers.I_OCCASE_RESULTINGFROM = cases.I AND activity_transfers.C_OCCASE_RESULTINGFROM = cases.C -
Union of non-compatible types error in column formula in obiee
Hi Experts,
Error: Union of non-compatible types
I used Case function in my column formula and got above error as a result.
The column formula goes below:
IFNULL(CASE WHEN EDM_TRD_IR_LEG.LEG_ID=1 THEN (EDM_TRD_IR_LEG.PAY_RECV_IND) ELSE 0 END, 0)
LEGID is numeric type. PAY_RECV_IND is varchar type.
Please let me know how to resolve this error.
Thanks in Advance.
-Regards
Mayuri898221 wrote:
Hi Experts,
Error: Union of non-compatible types
I used Case function in my column formula and got above error as a result.
The column formula goes below:
IFNULL(CASE WHEN EDM_TRD_IR_LEG.LEG_ID=1 THEN (EDM_TRD_IR_LEG.PAY_RECV_IND) ELSE 0 END, 0)
LEGID is numeric type. PAY_RECV_IND is varchar type.
Please let me know how to resolve this error.
Thanks in Advance.
-Regards
[email protected], you have syntax errors in your solution. If you're casting as varchar, then your syntax should read '1' instead of 1. Also at the end, it should be '0' instead of 0.
Mayuri,
To use your syntax, try this:
IFNULL(CASE WHEN EDM_TRD_IR_LEG.LEG_ID=1 THEN CAST(EDM_TRD_IR_LEG.PAY_RECV_IND AS INTEGER) ELSE 0 END, 0)
...if you need the result as a numeric for aggregation purposes... -
Hello!
I need some correction in the following query. I am trying to make a 2 page QPLD so I am joining 2 queries and then printing the report into 2 pages.
SELECT T0.[U_OANumber], T0.[custmrName], T0.[U_Inspection], T0.[U_Cust_PO_Num],
T0.[U_ModelType], T0.[U_Duty], T0.[U_NamePlate],
T0.[U_Indicator_Obs], T0.[U_Fastners], T0.[U_Mounting_Type], T0.[U_Casing_Orientation], T0.[U_Impeller_Dia],
T0.[U_Bearing_Style], T0.[U_Motor_HP_Size], T0.[U_InsulationWedges], T0.[U_Varnish], T0.[U_Paint_Shade],
T0.[U_PlugsSeal], T0.[U_Remarks], T0.[U_Despatch]
FROM OINS T0 WHERE T0.[U_OANumber] = '[%0]' or T0.[customer] = '[%1]' or T0.[manufSN] = '[%2]'
Union all
SELECT T0.[U_ModelType], T0.[U_Size], T0.[U_Discharge], T0.[U_Head], T0.[U_RPM], T0.[U_YOM], T0.[U_HP],
T0.[U_Amps], T0.[U_Insulation_Class], T0.[U_Winding_Connection]
FROM OINS T0 WHERE
T0.[U_OANumber] = '[%0]' or T0.[customer] = '[%1]' or T0.[manufSN] = '[%2]'
Do I have to use the where clause just once since it is identical to both statements?
I get the error stating that all queries using Union, Intersect or Except must have an equal number of expressions. what does this mean?
scorp
Edited by: scorpion 666 on Feb 12, 2009 1:30 PMUnion has to have exact same numbers of fields to combine two results. Your query shows no need of union because your where clauses are identical.
Right syntax would be like this:
SELECT T0.[U_OANumber], T0.[custmrName], T0.[U_Inspection], T0.[U_Cust_PO_Num],
T0.[U_ModelType], T0.[U_Duty], T0.[U_NamePlate],
T0.[U_Indicator_Obs], T0.[U_Fastners], T0.[U_Mounting_Type], T0.[U_Casing_Orientation], T0.[U_Impeller_Dia],
T0.[U_Bearing_Style], T0.[U_Motor_HP_Size], T0.[U_InsulationWedges], T0.[U_Varnish], T0.[U_Paint_Shade],
T0.[U_PlugsSeal], T0.[U_Remarks], T0.[U_Despatch], T0.[U_Size], T0.[U_Discharge], T0.[U_Head], T0.[U_RPM], T0.[U_YOM], T0.[U_HP],
T0.[U_Amps], T0.[U_Insulation_Class], T0.[U_Winding_Connection]
FROM DBO.OINS T0 WHERE T0.[U_OANumber] = '[%0]' or T0.[customer] = '[%1]' or T0.[manufSN] = '[%2]'
Thanks,
Gordon -
When I want to sort an union query by using substr I get the error ora-01785. I have tried to solve the problem but still I can't solve it. pls help...
select count(*), dealer.locid ,locname
from dealer,loc
where dealer.locid=loc.locid
group by dealer.locid,locname
union
select count(*)-1,locid,locname
from loc
where locid not in(select dealer.locid
from dealer,loc
where dealer.locid=loc.locid
group by locid,locname
order by substr(locname,2,5) <<---- ora-01785Achyot,
I think in the two queries you should select the same set of data.But in your query
select count(*), dealer.locid ,locname --you have selected count(*), dealer.locid ,locname
from dealer,loc
where dealer.locid=loc.locid
group by dealer.locid,locname
union
select count(*)-1,locid,locname --dealer is missing here
from loc
where locid not in(select dealer.locid
from dealer,loc
where dealer.locid=loc.locid
group by locid,locname
order by substr(locname,2,5)
In the 2 nd query select dealer also. I don't think the problem is with substr.Try it.
I saw by mistake dealer,locid.Never mind.
Message was edited by:
Manas -
Pipelined function with Union clause(Invalid Number(ORA-01722) error )
Hi,
I have a pipelined function.
I am fetching the data with the use of a REF cursor.
The query has two part: query1 and query2
when I am opeing the cursor with query1 UNION query2,it is giving me Invalid Number(ORA-01722) error.
but when I open the cursor separately for query1 and query2,I am getting the resultset for each of the query.
query1 and query2 are running fine with UNION in the sql editor.
But,when I put them into two variables (var1 :='query1' and var2:='query2' and try to open the cursor with var1 UNION var2 , it's giving me the error.
But when I put query2 as 'Select ..... from dual' and then try to open the cursor for query1 UNION query2,
then getting the result of query1 and one extra row for query2(dual).
The FROM table set is same for query1 and query2..
can anyone please help me , why this Invalid Number(ORA-01722) error is coming.query1 := 'SELECT to_char(st.store_no) STORE_NUMBER,pp.name PROGRAM_NAME, ''HBS'' DISPENSING_SYSTEM,
pt.PATIENT_SRC_NO SOURCE_ID, null RX2000_PATIENT_IDENTIFIER, pt.last_name PATIENT_LAST_NAME, pt.first_name
PATIENT_FIRST_NAME, to_char(LPAD (pppd.rx_number, 7, '' '')|| ''-''|| LPAD (pppd.refill_number, 2, 0)) RX_REFILL
FROM
pega_patient_program_dispense pppd,pega_patient_program_reg pppr,health_care_profs hcp1,
health_care_profs hcp2,prescription_dispenses pd,prescriptions p, pega_program_status_reason ppsr ,master_doctors md,
prescription_disp_orders pdo, hbs_shipment_extract hse,stores st,master_stores ms,pega_programs pp,patients pt,master_patients mpt
WHERE
pppr.referring_hcp_id=md.id(+) and md.dispensing_system_id=hcp1.hcp_id and
pppr.ID=pppd.PEGA_PATIENT_PROGRAM_REG_ID and pppd.prescription_dispense_id=pd.id and pd.prescriptions_id=p.id and
p.hcp_id=hcp2.hcp_id and ppsr.ID=pppd.PEGA_PROGRAM_STATUS_REASON_ID and pppd.prescription_dispense_id = pdo.prescriptions_dispenses_id(+) AND
pdo.shipment_number = hse.shp_no(+) and pppd.store_id=ms.id and st.id=ms.dispensing_system_id and pppr.pega_program_id=pp.id
and pppr.patient_id=mpt.id and pt.patient_id=mpt.dispensing_system_id and pppd.dispensing_system=''HBS'' and pp.name LIKE ''REV%''
AND
((pppd.prescription_dispense_id IS NOT NULL AND pppd.quantity_dispensed > 0 AND pppd.reported_date IS NULL AND
pppd.src_delete_date IS NULL AND ((pppr.program_specific_patient_code IS NULL ) OR (hcp1.last_name IS NULL) OR
(hcp1.first_name IS NULL) OR (hcp2.first_name IS NULL) OR (hcp2.last_name IS NULL) OR (hcp2.address_1 IS NULL) OR
(hcp2.city IS NULL) OR (hcp2.state_cd IS NULL) OR (hcp2.zip_1 IS NULL)OR (pppr.referral_date is NULL) OR
(hcp1.state_cd IS NULL) OR (hcp1.zip_1 IS NULL)
OR (hcp2.zip_1 IS NULL) OR (pppr.last_status_change_date IS NULL) OR (pppr.varchar_1 IS NULL) OR
(pppr.varchar_7 IS NULL OR pppr.varchar_7 LIKE ''NOT AVAILABLE AT REFERRAL%'') OR (pppr.varchar_5 IS NULL OR
pppr.varchar_5 LIKE ''NOT AVAILABLE AT REFERRAL%'')) ) AND ppsr.INCLUDE_ON_EXCEPTION_RPT_IND=''Y'')
OR
((pppd.authorization_number IS NULL OR NVL(TRUNC(pdo.shipped_date),TRUNC(hse.shp_act_date_dt)) NOT BETWEEN
TRUNC(pppd.date_1) AND TRUNC(pppd.date_2)) OR (pppd.varchar_4 IS NULL OR NVL(TRUNC(pdo.shipped_date),
TRUNC(hse.shp_act_date_dt)) NOT BETWEEN TRUNC(pppd.date_3) AND TRUNC(pppd.date_5)))
OR
(pppr.pega_program_competitors_id IS NULL AND (ppsr.manufacturer_status=''TRIAGE'' AND ppsr.manufacturer_reason=''COMPETITOR''))
OR
(ppsr.manufacturer_reason IS NULL)
query2 := ' SELECT ''150'' STORE_NUMBER,''test'' PROGRAM_NAME , ''RX2000'' DISPENSING_SYSTEM
,''01'' SOURCE_ID, null RX2000_PATIENT_IDENTIFIER, ''test'' PATIENT_LAST_NAME, ''test'' PATIENT_FIRST_NAME,
''rx01'' RX_REFILL
FROM
pega_patient_program_reg pppr,health_care_profs hcp1, pega_program_status_reason ppsr ,
master_doctors md,stores st,master_stores ms,pega_programs pp,patients pt,master_patients mpt
WHERE
pppr.referring_hcp_id=md.id(+) and md.dispensing_system_id=hcp1.hcp_id and
ppsr.ID=pppr.REFERRAL_STATUS_ID and st.store_type=''M'' and pppr.store_id=ms.id and st.id=ms.dispensing_system_id
and pppr.pega_program_id=pp.id and pppr.patient_id=mpt.id and pt.patient_id=mpt.dispensing_system_id and pp.name LIKE ''REV%''
AND
((((pppr.program_specific_patient_code IS NULL ) OR (hcp1.last_name IS NULL) OR (hcp1.first_name IS NULL) OR
(pppr.referral_date is NULL) OR (hcp1.state_cd IS NULL) OR (hcp1.zip_1 IS NULL) OR (pppr.last_status_change_date IS NULL)
OR (pppr.varchar_1 IS NULL) OR (pppr.varchar_7 IS NULL) OR (pppr.varchar_5 IS NULL OR pppr.varchar_5 LIKE
''NOT AVAILABLE AT REFERRAL%'')) ) AND ppsr.INCLUDE_ON_EXCEPTION_RPT_IND=''Y'')
OR
(pppr.pega_program_competitors_id IS NULL AND (ppsr.manufacturer_status=''TRIAGE'' AND ppsr.manufacturer_reason=''COMPETITOR''))
OR
(ppsr.manufacturer_reason IS NULL)
AND
pppr.id NOT IN(select pppd.PEGA_PATIENT_PROGRAM_REG_ID from PEGA_PATIENT_PROGRAM_DISPENSE pppd)';
BUT IF I put
query2 := ' SELECT ''150'' STORE_NUMBER,''test'' PROGRAM_NAME , ''RX2000'' DISPENSING_SYSTEM
,''01'' SOURCE_ID, null RX2000_PATIENT_IDENTIFIER, ''test'' PATIENT_LAST_NAME, ''test'' PATIENT_FIRST_NAME,
''rx01'' RX_REFILL
FROM DUAL';
then it is giving result. -
Error "Invalid Fetch Size" in ODi11g 11.1.1.6.0 version
Hi Experts,
I am doing Data integration from Excel (using mutltiple sheets data) to Oracle table and now I am facing an below issue
Error:
ODI-1217: Session EMP_ST1 (24202) fails with return code 8000.
ODI-1226: Step EMP_ST1 fails after 1 attempt(s).
ODI-1240: Flow EMP_ST1 fails while performing a Loading operation. This flow loads target table EMP_MULTI.
ODI-1227: Task SrcSet0 (Loading) fails on the source MICROSOFT_EXCEL connection EMP_TEST.
Caused By: java.sql.SQLException: Invalid Fetch Size
Note: When i google it, I came to know that there is a patch Doc ID: 13528165 to resolve the same issue in ODI 11g (ver 11.1.1.5.0)
Is there any patch to resolve same issue in ODI11g version 11.1.1.6.0 for windows 32-bit
Thanks in advance
Regards,
PK
Edited by: 917775 on May 21, 2012 11:37 PMHi,
You better get in touch with Oracle Support people and get it clarified .
If there is no patch available for ODI 11.1.1.6 , but the bug is still there then they will create a forward porting request for the patch into ODI 11.1.1.6
Thanks,
Sutirtha -
32-bit Java error with Navy Federal Credit Union eScan Deposit
I am trying to do eScan Deposit. The first time it said it needed to download a Java applet, and I said yes, after the download was complete it still did not recognize the scanner. It gave me an error saying "This system does not support 64-Bit Java. Select 32-Bit Java". I verified with Apple Support that both 32 and 64-bit Java come with snow leeopard and the Java Prefs were correct. Could this be the printer, or is this a Navy Federal web site issue? Anyone know how to fix the problem? Thanks in advance.
The browser does not allow created files to be uploaded, it wants to manage that process. This worked fine for my windows latop, but I had the full HP driver installed. HP has not made one availabile yet for 10.7.2 and recommeds using the Apple drivers. I can do that fine for printing and scanning (with the Image software). But not with the application. The Credit Union sais it "should work with MAC" provided I have the right printer driver and TWAIN compliant scanner. The HP 7780is TWAIN compliant. HP recommended gong to www.twain.org and downloading TWAIN s/w for MACs. I started to, but the s/w was dated 2002 and won't help for newer MAC operating systems.
-
SELECT distinct m_product_id,m_locator_id, sum(movementqty) AS opstk,to_char('0') as clstk,to_char('0') as movementqty,to_char('0')as MI,to_char('0') as INV,to_char('0') as GR,to_char('0') as GS,to_char('0') as MO
from m_transaction
where m_product_id='1136094' and m_locator_id='1000021'
and movementdate < '09-oct-2010'
GROUP BY m_product_id,m_locator_id
union
SELECT distinct m_product_id,m_locator_id, to_char('0') as opstk,sum(movementqty) AS clstk,to_char('0') as movementqty,to_char('0')as MI,to_char('0') as INV,to_char('0') as GR,to_char('0') as GS,to_char('0') as MO
from m_transaction
where m_product_id='1136094' and m_locator_id='1000021'
and movementdate <'22-oct-2010'
GROUP BY m_product_id,m_locator_id
when using this query it shows error message in oracle 10g
"expression must have same datatypes as corresponding expression"
How to rectify it.
please give suggestions urgent.Hi,
you use sum, but in the opposite select a "to_char('0')", so the first one will be number, the second a char. Use just a "0" for the opposite of the sum:
SELECT distinct m_product_id,m_locator_id, sum(movementqty) AS opstk, 0 as clstk, 0 as movementqty, 0 as MI, 0 as INV,0 as GR,0 as GS,0 as MO
from m_transaction
where m_product_id='1136094' and m_locator_id='1000021'
and movementdate <'22-oct-2010'
GROUP BY m_product_id,m_locator_id
union
SELECT distinct m_product_id,m_locator_id, 0 as opstk,sum(movementqty) AS clstk, 0 as movementqty, 0 as MI, 0 as INV, 0 as GR,0 as GS,0 as MO
from m_transaction
where m_product_id='1136094' and m_locator_id='1000021'
and movementdate <'22-oct-2010'
GROUP BY m_product_id,m_locator_idHerald ten Dam
http://htendam.wordpress.com
Maybe you are looking for
-
Add Text Justification Options
For text fields added to slides, the ability to control justification (e.g., Left, Center, Right), would be very helpful.
-
Kobo app no longer compatibile with IOS 6 IPOD touch
The updated version of Kobo App is no longer compatible with my IPOD Touch 4th generation (IOS 6). Can I find an earlier, compatible version of the Kobo app to reinstall it on my IPOD touch? Or is there any possibility of upgrading to IOS 7 without
-
Opening images in Firefox and Safari
I do a lot of shopping online, and recently when I try to open the "enlarge image" or "multiple views" of an item I only get a new window of the site's homepage. Since it happens in both of my browsers I am not sure where to fix it.
-
Best practice for Wireless ap vlan
Is there a best practice for grouping lightweight access points in one vlan or allowing them to be spread across several ??
-
Hello I recently tried to upgrade the hard-drive in my macbook pro 2010 13". I backed up the old drive using SuperDuper to my external drive. I replaced the original internal hard-drive with my newly purchased Western Digital Scorpio blue 1Tb 5400rpm