While Joining 3 tables am getting 2 rows,actual i need a single row
Hi all,
While joining 3 tables am getting 2 Rows, i need 1 row.
please find my query and actual output and expected output.
Help me out to handle this.
select
--MFU_D_C_INVESTOR_ID_DET,
mfu_remove_junk(Q.CAN) CAN_ST,
mfu_remove_junk(Q.INSTALLMENT_AMOUNT) AMOUNT_ST,
mfu_remove_junk(x.Can ) Can ,
mfu_remove_junk(x.Amc_Code ) Amc_Code ,
mfu_remove_junk(x.Folio_No ) Folio_No ,
mfu_remove_junk(x.Order_Status ) Order_Status ,
mfu_remove_junk(x.User_Code ) User_Code ,
mfu_remove_junk(x.User_Txrn_No ) User_Txrn_No ,
mfu_remove_junk(x.Group_Ord_No ) Group_Ord_No ,
mfu_remove_junk(x.Ind_Txn_Ref_No ) Ind_Txn_Ref_No ,
mfu_remove_junk(x.Pending_Txn_Ref_No ) Pending_Txn_Ref_No ,
mfu_remove_junk(x.Appl_No ) Appl_No ,
mfu_remove_junk(x.Ts_Machine_Id ) Ts_Machine_Id ,
mfu_remove_junk(x.Trxn_Date ) Trxn_Date ,
mfu_remove_junk(x.Trxn_Time ) Trxn_Time ,
mfu_remove_junk(x.Timestamp_No ) Timestamp_No ,
mfu_remove_junk(x.Sch_Code ) Sch_Code ,
mfu_remove_junk(x.Reinv_Tag ) Reinv_Tag ,
mfu_remove_junk(x.Txn_Mode ) Txn_Mode ,
mfu_remove_junk(x.Trxn_Type ) Trxn_Type ,
mfu_remove_junk(x.Sub_Trxn_Type ) Sub_Trxn_Type ,
mfu_remove_junk(x.Units ) Units ,
mfu_remove_junk(x.Amount ) Amount ,
mfu_remove_junk(x.All_Units_Flag ) All_Units_Flag ,
mfu_remove_junk(x.Entity_Id ) Entity_Id ,
mfu_remove_junk(x.ENTITY_BRANCH_ID ) ENTITY_BRANCH_ID ,
mfu_remove_junk(x.Location ) Location ,
(TO_CHAR(sysdate,'DD-MON-RRRR')) CREATED_DATE
From MFU_FTP_XML_FILES T
Left Join Xmltable('/COMM_TXN_STRUCT/FILE_ROWS/FILE_ROW'
Passing T.Filecontent
Columns
--MFU_D_C_INVESTOR_ID_DET
Can Varchar2(500) Path 'INVESTOR_ID_DET/CAN',
Amc_Code Varchar2(500) Path 'INVESTOR_ID_DET/AMC_CODE',
Folio_No Varchar2(500) Path 'INVESTOR_ID_DET/FOLIO_NO',
Order_Status Varchar2(500) Path 'TRANSACTION_DET/ORDER_STATUS',
User_Code Varchar2(500) Path 'TRANSACTION_DET/USER_CODE',
User_Txrn_No Varchar2(500) Path 'TRANSACTION_DET/USER_TXRN_NO',
Group_Ord_No Varchar2(500) Path 'TRANSACTION_DET/GROUP_ORD_NO',
Ind_Txn_Ref_No Varchar2(500) Path 'TRANSACTION_DET/IND_TXN_REF_NO',
Pending_Txn_Ref_No Varchar2(500) Path 'TRANSACTION_DET/PENDING_TXN_REF_NO',
Appl_No Varchar2(500) Path 'TRANSACTION_DET/APPL_NO',
Ts_Machine_Id Varchar2(500) Path 'TRANSACTION_DET/TS_MACHINE_ID',
Trxn_Date Varchar2(500) Path 'TRANSACTION_DET/TRXN_DATE',
Trxn_Time Varchar2(500) Path 'TRANSACTION_DET/TRXN_TIME',
Timestamp_No Varchar2(500) Path 'TRANSACTION_DET/TIMESTAMP_NO',
Sch_Code Varchar2(500) Path 'TRANSACTION_DET/SCH_CODE',
Reinv_Tag Varchar2(500) Path 'TRANSACTION_DET/REINV_TAG',
Txn_Mode Varchar2(500) Path 'TRANSACTION_DET/TXN_MODE',
Trxn_Type Varchar2(500) Path 'TRANSACTION_DET/TRXN_TYPE',
Sub_Trxn_Type Varchar2(500) Path 'TRANSACTION_DET/SUB_TRXN_TYPE',
Units Varchar2(500) Path 'TRANSACTION_DET/UNITS',
Amount Varchar2(500) Path 'TRANSACTION_DET/AMOUNT',
All_Units_Flag Varchar2(500) Path 'TRANSACTION_DET/ALL_UNITS_FLAG',
Entity_Id Varchar2(500) Path 'TRANSACTION_DET/ENTITY_ID',
ENTITY_BRANCH_ID Varchar2(500) Path 'TRANSACTION_DET/ENTITY_BRANCH_ID',
Location Varchar2(500) Path 'TRANSACTION_DET/LOCATION'
) X
on (1=1)
left join XMLTABLE('/CT_SYS_STRUCT/FILE_ROWS/FILE_ROW'
PASSING T.FILECONTENT
columns
CAN varchar2(500) PATH 'INVESTOR_ID_DET/CAN',
INSTALLMENT_AMOUNT varchar2(500) PATH 'TRANSACTION_DET/INSTALLMENT_AMOUNT'
)Q
on (1=1)
Where
TRUNC((TO_DATE(T.RETRIVED_DATE,'DD-MON-RRRR HH:MI:SS PM')))=TRUNC(SYSDATE-2)
Order By Rownum,X.Can Asc;
Actual O/P:
15114LBA01 1000.00 (null) (null) (null) (null) (null) (null) (null)
(null) (null) 15114LBA01 SMF AC MFU 40715117000 15114010001 1511401000102
Expected O/P:
can_st amount can amc order user trxn_no group_ord ind_txn_no
15114LBA01 1000.00
15114LBA01 SMF
AC
MFU 40715117000 15114010001 1511401000102
Expected O/P:
can_st amount can amc order user trxn_no group_ord ind_txn_no
15114LBA01 1000.00 15114LBA01 SMF
AC
MFU 40715117000 15114010001 1511401000102
check http://docs.oracle.com/cd/E11882_01/server.112/e41084/ap_keywd001.htm#SQLRF55621
to verify:
with
actual_output as
(select '15114LBA01' can_st,1000.00 amount,null can,null amc,null order_,null user_,null trxn_no,null group_ord,null ind_txn_no from dual union all
select null,null,'15114LBA01','SMF','AC','MFU',40715117000,15114010001,1511401000102 from dual
select max(can_st) can_st,max(amount) amount,max(can) can,max(amc) amc,max(order_) order_,max(user_) user_,max(trxn_no) trxn_no,max(group_ord) group_ord,max(ind_txn_no) ind_txn_no
from actual_output
CAN_ST
AMOUNT
CAN
AMC
ORDER_
USER_
TRXN_NO
GROUP_ORD
IND_TXN_NO
15114LBA01
1000
15114LBA01
SMF
AC
MFU
40715117000
15114010001
1511401000102
select max(can_st) can_st,max(amount) amount,max(can) can,max(amc) amc,max(order_) order,max(user_) user,max(trxn_no) trxn_no,max(group_ord) group_ord,max(ind_txn_no) ind_txn_no
from actual_output
ORA-00923: FROM keyword not found where expected
Regards
Etbin
Similar Messages
-
ADF: How to get the attributes' values of one single row from a table?
Currently I have a table with 3 attributes, suppose A,B and C respectively. And I've added an selectionListener to this table. That means when I select one single row of this table, I wish to get the respective value of A, B and C for that particular row. How do I achieve this?
suppose the method is like:
public void selectionRow(SelectionEvent se) { //se is the mouse selection event
.......??? //what should I do to get the values of A\B\C for one single row?
Edited by: user12635428 on Mar 23, 2010 1:40 AMHi
Assuming you are using Jdev 11g.
Try with this
public void selectionRow(SelectionEvent se) {
String val = getManagedBeanValue("bindings.AttributeName.inputValue");
public static Object getManagedBeanValue(String beanName) {
StringBuffer buff = new StringBuffer("#{");
buff.append(beanName);
buff.append("}");
return resolveExpression(buff.toString());
public static Object resolveExpression(String expression) {
FacesContext facesContext = getFacesContext();
Application app = facesContext.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = facesContext.getELContext();
ValueExpression valueExp =
elFactory.createValueExpression(elContext, expression,
Object.class);
return valueExp.getValue(elContext);
Vikram -
Multiple row value coming in a single row(nclob)
hi ,
i have a requirement where i have to work on a column on datatype nclob, now here the value of 2 rows coming into a single column. like this:
select distinct extractvalue(xmltype(details),'/Anything/invoiceNumber') as invoices ,
actinguserid as user_id ,createdt
from bchistevent where bucket = 201301
and upper(type) = 'COM.AVOLENT.PRESENTATION.EVENT.INVOICEDOWNLOADEVENT'
--and bchistevent.bucket = to_char (add_months (sysdate, -1),'YYYYMM')
395452969-000-20130103 1.46388193452398E37 1/8/2013 3:05:42 AM
300000590-000-20090723 1.46388193452398E37 1/11/2013 8:11:45 AM
300000590-000-20090723 1.46388193452398E37 1/11/2013 8:12:50 AM
395453127-000-20130103 1.46388193452398E37 1/14/2013 4:44:26 AM
*300084670-000-20120906, 300084671-000-20120906* 1.46388193452398E37 1/7/2013 12:45:19 AM
395452626-000-20130103 1.46388193452398E37 1/8/2013 3:03:57 AM
300084679-000-20120906 1.46388193452398E37 1/11/2013 8:10:47 AM
300000728-000-20090731 1.46388193452398E37 1/11/2013 8:19:19 AM
300084679-000-20120906 1.46388193452398E37 1/14/2013 12:31:48 AM
300000590-000-20090723 1.46388193452398E37 1/14/2013 4:13:19 AM
395452718-000-20130103 1.46388193452398E37 1/8/2013 7:10:19 AM
300084679-000-20120906 1.46388193452398E37 1/23/2013 6:54:11 AM
300084679-000-20120906 1.46388193452398E37 1/22/2013 3:11:54 AM
300000590-000-20090723 1.46388193452398E37 1/11/2013 8:14:02 AM
395453127-000-20130103 1.46388193452398E37 1/14/2013 4:33:12 AM
300084679-000-20120906 1.46388193452398E37 1/22/2013 3:03:36 AM
300084679-000-20120906 1.46388193452398E37 1/14/2013 12:34:13 AM
395452997-000-20130103 1.46388193452398E37 1/7/2013 3:31:38 AM
395452391-000-20121027 1.46388193452398E37 1/3/2013 4:40:05 AM
and the value of bold highlighted row is coming in a single row, plzz help how to break this in 2 rows??
Edited by: user1175303 on Mar 13, 2013 5:43 AMuser1175303 wrote:
the column value which is in question is <Anything><invoiceNumber>300084670-000-20120906, 300084671-000-20120906</invoiceNumber></Anything> here i am getting 2 values in a single column and because of this i am unable to get desired output...So you have XML issue but trying to resolve it in Oracle??? Why <invoiceNumber> holds two invoice numbers? Anyway:
with t as (
select distinct extractvalue(xmltype(details),'/Anything/invoiceNumber') as invoices,
actinguserid as user_id,
createdt
from bchistevent
where bucket = 201301
and upper(type) = 'COM.AVOLENT.PRESENTATION.EVENT.INVOICEDOWNLOADEVENT'
select regexp_substr(invoices,'[^,]+',1,column_value) invoices,
user_id,
createdt
from t,
table(
cast(
multiset(
select level
from dual
connect by level <= length(regexp_replace(invoices,'[^,]')) + 1
as sys.OdciNumberList
/SY. -
Merge multiple rows of same ID into Single row
Hi All,
I need the requirements of merging multiple rows of same ID as single row.
My Table Data:
ID Language1 Language2 Language3 Language4
1001 NULL JAPANESE NULL NULL
1001 SPANISH NULL NULL NULL
1001 NULL NULL NULL ENGLISH
1001 NULL NULL RUSSIAN NULL
Required Output Should be,
ID Language1 Language2 Language3 Language4
1001 SPANISH JAPANESE RUSSIAN ENGLISH
Please help me to achieve this output.
Tried grouping but its not working also producing the same result.
Thanks.
Live freee....Joy forever................ :)Try the below:
create Table Test_Sample(ID int,Language1 varchar(50), Language2 varchar(50), Language3 varchar(50), Language4 varchar(50))
Insert into Test_SAmple Values(1001,NULL,'JAPANESE', NULL, NULL),
(1001,'SPANISH', NULL, NULL, NULL),
(1001,NULL, NULL, NULL, 'ENGLISH'),
(1001,NULL, NULL, 'RUSSIAN', NULL)
Select ID,MAX(Language1),MAX(Language2),MAX(Language3),MAX(Language4)
From Test_Sample
Group by ID
Drop table Test_Sample -
Want to be able to open tabs in multiple rows, rather than in a single row. I used tab mix plus before, but it says it is not compatible with New tab Homepage. The older version of Firefox allowed this very easily.
Your plugins list shows outdated plugin(s) with known security and stability risks.
*Java Plug-in 1.5.0_06 for Netscape Navigator (DLL Helper)
Update the [[Java]] plugin to the latest version.
*http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE) -
What are the Pros and Cons while joining tables at DF and Universe level
Hi Experts,
I am new to Data federator designer. I need help on the below.
Could you please let me know the Pros and Cons while joining the source tables in data federator
And While joining the DF target tables in universe designer.
Regards,
GanaHi,
1. I have created target tables based on source tables with one to one mapping and then join all target tables in universe.
Ex: Source tables: Infocube text tables, fact tables and 3rd party data base table
Target tables:Target tables are same as source tables
--- Yes this is the way to create target Tables and join them in the universe.These target Tables gives you the flexibility like in future your requirement is to add one more object based on some calculation which is not possible in the universe so that time you can create one more column in the target table and do the calculation. at the same time if you are using source table you can not do anything.
2. Created single target table with all objects of source tables and merged all sources tables data.
Ex: Source tables: Infocube text tables, fact tables and 3rd party data base table
Target table: Single table.
--- This is bit complex structure to merge all tables data in the one target table.in this situation you have to put more efforts and it is more complex.basically this type of target table is useful when you are merging data by multiple source into single or creating one target table based on the union of tables by adding two mapping rules or more and you can not join tables in universe.
Better approach is first 1. create target tables based on the source tables and join them in the universe.
Thanks,
Amit -
Get the column values in a single row seperated by commas
Hi
i have two tables project_baseline and project_resource which have the foreign key project_id from the base table project_details. Now iam trying to retrieve data from these tables using the below query :
select distinct b.TASK_NAME,r.RESOURCE_NAME,() from project_baseline b inner join project_resource r on R.PROJECT_ID=B.PROJECT_ID group by b.TASK_NAME,r.RESOURCE_NAME
Below is the output snippet :
TASK_NAME RESOURCE_NAME
TEST DESIGN PARAGI M
TEST DESIGN RAJAN M S
TEST EXECUTION VIBHU ARMA
TEST EXECUTION PRATHAB GARG
TEST EXECUTION NAGABHUSHAN G K
TEST DATA PREPARATION RAJAN M S
TEST DATA PREPARATION SHIVA MARAN
TEST CASE REWORK VISWAN RAM
TEST CASE REVIEW NAGABHUSHAN G K
REGRESSION SANGEET
PROJECT SUPPORT VIBHU ARMA
PROJECT SUPPORT PRATHAB GARG
PROJECT SUPPORT PARAGI M
PROJECT SUPPORT NAGABHUSHAN G K
PROJECT SUPPORT SANGEET
PROJECT CLOSURE PRATHAB GARG
i need to get the resource_names in a single row seperated by comma for a single task like following:
TASK_NAME RESOURCE_NAME
PROJECT SUPPORT VIBHU ARMA,PRATHAB GARG,PARAGI M,NAGABHUSHAN G K,SANGEET
Could anyone please help me to get the query for the above formated output?
Thanks in advance
Meera
Edited by: 928378 on May 22, 2012 5:20 AMHi,
It can be done using xmlagg function.
For Example :
Table Data..
DEPTNO ENAME
20 WARD Tree
23 Shank
30 BLAKE
10 MILLER
30 MARTIN
10 CLARK
20 SCOTT
30 TURNER
20 ADAMS
30 JAMES
20 FORD
30 BLAKE
Query:
SELECT deptno,
RTRIM (XMLAGG (XMLELEMENT (e, ename || ',')).EXTRACT ('//text()'),
) NAME
FROM emp
GROUP BY deptno;
Output :
DEPTNO NAME
10 MILLER,CLARK
20 WARD Tree,FORD,ADAMS,SCOTT
23 Shank
30 BLAKE,TURNER,BLAKE,JAMES,MARTIN
Thanks,
Shankar
Thanks,
Shankar. -
Error while joining Table and Collection.
Hi Friends,
I need to know whether the below is possible.
DECLARE
TYPE t_dept IS TABLE OF dept%ROWTYPE;
c t_dept;
BEGIN
SELECT *
BULK COLLECT INTO c
FROM dept;
FOR r IN (SELECT *
FROM emp e, TABLE (CAST (c AS t_dept)) d
WHERE e.deptno = d.deptno)
LOOP
DBMS_OUTPUT.put_line (r.ename);
END LOOP;
END;No.
What exactly are you trying to accomplish?
SQL> DECLARE
2 TYPE t_dept IS TABLE OF dept%ROWTYPE;
3
4 c t_dept;
5 BEGIN
6 SELECT *
7 BULK COLLECT INTO c
8 FROM dept;
9
10 FOR r IN (SELECT *
11 FROM emp e, TABLE (CAST (c AS t_dept)) d
12 WHERE e.deptno = d.deptno)
13 LOOP
14 DBMS_OUTPUT.put_line (r.ename);
15 END LOOP;
16 END;
17 /
FROM emp e, TABLE (CAST (c AS t_dept)) d
ERROR at line 11:
ORA-06550: line 11, column 31:
PL/SQL: ORA-00902: invalid datatype
ORA-06550: line 10, column 10:
PL/SQL: SQL Statement ignored
ORA-06550: line 14, column 23:
PLS-00364: loop index variable 'R' use is invalid
ORA-06550: line 14, column 1:
PL/SQL: Statement ignored
SQL> -
Logic to show two rows of a column as Single row
Hi
I need output some thing like below
ind type amount
xxxx abc 123
bac 456
yyyy abc 123
bac 456
zzzzz abc 123
bac 456
two rows considered as one row .
Can any one please help me how to solve this.sample like
iin the first two the column ind should be show as single xxxx and also type with in same row
Edited by: varma on Apr 10, 2012 1:27 PM -
Mearge Multiple rows of same record in single row with /
Dear Friends
Here I am giving a example, In this example i want to mearge the records containing waybillno 24292 to single record but here i am having seperate tallerno which i want to combine in 1 record with '/'
Please give the solution urgently
WAYBILLNO WAYBILLDT TALLERNO TALLERDAT INVOICEVALUE
24942 31-MAR-11 873000
24942 31-MAR-11 3142 07-MAR-11
24942 31-MAR-11 3145 18-MAR-11
sandy
Edited by: Sandy on 17 May, 2011 4:57 AM/* Formatted on 5/18/2011 10:10:36 AM (QP5 v5.149.1003.31008) */
WITH t AS (SELECT 24942 WAYBILLNO,
'31-MAR-11' WAYBILLDT,
873000 TALLERNO,
NULL TALLERDAT
FROM DUAL
UNION
SELECT 24942,
'31-MAR-11',
3142,
'07-MAR-11'
FROM DUAL
UNION
SELECT 24942,
' 31-MAR-11',
3145,
'18-MAR-11'
FROM DUAL
UNION
SELECT 24943,
'28-MAR-11',
3150,
'08-MAR-11'
FROM DUAL
UNION
SELECT 24943,
' 20-MAR-11',
3155,
'12-MAR-11'
FROM DUAL)
SELECT WAYBILLNO,
MAX (SUBSTR (SYS_CONNECT_BY_PATH (WAYBILLDT, ','), 2)) WAYBILLDTS,
MAX (SUBSTR (SYS_CONNECT_BY_PATH (TALLERNO, ','), 2)) TALLERNOS,
MAX (SUBSTR (SYS_CONNECT_BY_PATH (TALLERDAT, ','), 2)) TALLERDATS
FROM (SELECT WAYBILLNO,
WAYBILLDT,
TALLERNO,
TALLERDAT,
ROW_NUMBER ()
OVER (PARTITION BY WAYBILLNO
ORDER BY WAYBILLDT, TALLERNO, TALLERDAT)
rn
FROM t)
-- WHERE CONNECT_BY_ISLEAF = 1 don't think connect by isleaf is available in 9i
-- so you will need to pick the max and group by waybillno
START WITH rn = 1
CONNECT BY PRIOR rn = rn - 1 AND PRIOR WAYBILLNO = WAYBILLNO
GROUP BY WAYBILLNO
ORDER BY WAYBILLNO
WAYBILLNO WAYBILLDTS TALLERNOS TALLERDATS
24942 31-MAR-11,31-MAR-11,31-MAR-11 3145,3142,873000 18-MAR-11,07-MAR-11,
24943 20-MAR-11,28-MAR-11 3155,3150 12-MAR-11,08-MAR-11 -
Multiple rows Converge to Single row and join
Hi Folks,
I am facing a tricky challenge to join a table with multiple rows and converge into a single row (based on ID, period) and join with another table to get a single row. Let me explain.
Table 1: DTL_TABLE (id, period, course, names, title, type)
1 2010 mat john null null
1 2010 mat jim null null
1 2010 cam null officer null
1 2010 cam null Prof null
1 2010 phy null null Inclass
1 2010 phy null null Online
Join with
Table 2: ID_TABLE(id, period, Loc, Dept, Code)
1 2010 nj 101 CC.
Output format (id, period, course, names, title, type, Loc, Dept, Code)
result : 1 2010 mat,cam,phy john,jim officer,prof inclass,online nj 101 CC
I have created all the DDLs and DMLs if that help. Kindly let me know if a Join SQL query is possible.
Thank you,
Aj
CREATE TABLE DTL_TABLE
ids VARCHAR2 (10),
period VARCHAR2 (10),
course VARCHAR2 (10),
names VARCHAR2 (10),
title VARCHAR2 (10),
TYPE VARCHAR2 (10)
INSERT INTO DTL_TABLE
VALUES ('1',
'2010',
'mat',
'jim',
NULL,
NULL);
INSERT INTO DTL_TABLE
VALUES ('1',
'2010',
'mat',
'john',
NULL,
NULL);
INSERT INTO DTL_TABLE
VALUES ('1',
'2010',
'mat',
'kale',
NULL,
NULL);
INSERT INTO DTL_TABLE
VALUES ('1',
'2010',
'cam',
NULL,
'officer',
NULL);
INSERT INTO DTL_TABLE
VALUES ('1',
'2010',
'cam',
NULL,
'prof',
NULL);
INSERT INTO DTL_TABLE
VALUES ('1',
'2010',
'phy',
NULL,
NULL,
'inclass');
INSERT INTO DTL_TABLE
VALUES ('1',
'2010',
'phy',
NULL,
NULL,
'online');
COMMIT;
CREATE TABLE id_table
ids VARCHAR2 (10),
period VARCHAR2 (10),
loc VARCHAR2 (10),
dept VARCHAR2 (10),
code VARCHAR2 (10)
INSERT INTO id_table
VALUES ('1',
'2010',
'nj',
'101',
'cc');
COMMIT;Aj09 wrote:
Hi Folks,
I am facing a tricky challenge to join a table with multiple rows and converge into a single row (based on ID, period) and join with another table to get a single row. Let me explain.
Table 1: DTL_TABLE (id, period, course, names, title, type)
1 2010 mat john null null
1 2010 mat jim null null
1 2010 cam null officer null
1 2010 cam null Prof null
1 2010 phy null null Inclass
1 2010 phy null null Online
Join with
Table 2: ID_TABLE(id, period, Loc, Dept, Code)
1 2010 nj 101 CC.
Output format (id, period, course, names, title, type, Loc, Dept, Code)
result : 1 2010 mat,cam,phy john,jim officer,prof inclass,online nj 101 CC
I have created all the DDLs and DMLs if that help. Kindly let me know if a Join SQL query is possible.
SELECT TBL.id,
DTLperiod,
course,
names,
title,
TYPE,
Loc,
Dept,
Code
FROM ID_TABLE TBL,
DTL_TABLE DTL
WHERE TBL.ID = DTL.ID
AND TBL.PERIOD = DTL.PERIOD; it not good to use RESERVED WORDS like "ID" or "TYPE" as column names -
Tables & Table relationship to find ACTUAL & PLANNED COST for ACTIVITY ELEM
Hi Guys,
I have to create a report for Project, WBS, Network, Activity and Activity Element to show :
Reporting period: March 1,2007 to March 25, 2007
Planned cost ( (from March 1, 2007 to March 26, 2007)
Current reporting period (from March 1, 2007 to March 26, 2007)
YTD Actual Cost (from Jan 1, 2007 to March 26, 2007)
Kindly let me know the table to get the ACTUAL COSTS and PLANNED COST with relationships.Hi,
Refer to the BLOG
SAP Project System - A ready Reference ( Part 2 )
Hope it will help full
Regards, -
Delimited String To A Single Row Within A Table
I'll try to make a simple example of what I am trying to accomplish...
Let's say that I have a table (Blah) which has the following Fields:
User, DateTime, Q1, Q2.... all the way to Q50. The Questions are radios with a value of 1,0, or null.
Since I didn't want to manually make 50 different items for the Radio questions, I am creating them from Javascript within a Region Source; as well as giving them id's and names. This worked fine.
When I hit a submit button, I have Javascript create a delimited string for the questions, which I pass to a Shared Item. (1,0,1,1,null,0,etc...) I then have the Javascript run a Shared Procedure for the Insert into my Table.
Here is where I am stuck. I am confused on how to merge the delimited string into my Insert statement, from PL/SQL.
Here is a dummied down sample of what I am trying to write. (Shared Item is :ITEM_ARRAY, with a delimiter of ~:~ )
DECLARE
array APEX_APPLICATION_GLOBAL.VC_ARR2
BEGIN
array := APEX_UTIL.STRING_TO_TABLE(:ITEM_ARRAY, ':~:' );
INSERT INTO tbl_blah (
:APP_USER
,SYSDATE
FOR z IN 1..array.count LOOP
array(z);
END LOOP;
END;
Every which way I tried, I always get Not Enough Values Error.
I tried to make everything in a delimited string as well:
Insert Into tbl_blah (SELECT * FROM array)
Can someone please enlighten me on the correct way to do this. All of the examples I have seen are to write to multiple rows, via the loop. I want to just have 1 record, horizontally.
Thanks !!!Hi,
Why can't you insert a row into table with first two columns and do update for that row???
Just for simple work around, I have created a table with below columns,
USER_NAME VARCHAR2
EXAM_DATE DATE
M1 NUMBER
M2 NUMBER
M3 NUMBER
M4 NUMBER
M5 NUMBER
M6 NUMBER
M7 NUMBER
M8 NUMBER
M9 NUMBER
M10 NUMBER
I wrote a below code to insert a row into that table,
declare
v_arr APEX_APPLICATION_GLOBAL.VC_ARR2;
v_stmt varchar2(1000);
begin
v_arr:= APEX_UTIL.STRING_TO_TABLE(:p_all_items,'~');
insert into test_group(user_name,exam_date) values (:APP_USER,sysdate);
dbms_output.put_line('row inserted');
FOR i IN 1..v_arr.COUNT LOOP
dbms_output.put_line('i='||i||' value='||v_arr(i));
if v_arr(i) is null then
v_stmt:='update test_group set m'||i||'=NULL';
else
v_stmt:='update test_group set m'||i||'='||v_arr(i);
end if;
dbms_output.put_line(v_stmt);
execute immediate v_stmt;
END loop;
end;
I just ran this block in 'SQL Commands', It worked for me. but i inserted only one row, so it updates a single row, In case of multiple row need to use the unique column for update. change the above code as per your requirement.
I hope this work around will help you. If not can you please create an example in apex.oracle.com and share login credentials.
Thanks
Lakshmi -
Unable to reorder/change column names on interactive single row view
I have created an interactive report and grouped my columns to display nicely in a single row view report. However, once I initially add the columns to a group, I am unable to reorder them. I can move them up and down the list, but the changes don't save. Also, I have gone through column by column and unchecked the box that says Use Same Text for Single Row View and expanded the column name. However, the single row view still displays what is in the master report. I've tried closing out my browser completely and reopening, but I am still not seeing my changes. Any suggestions?
I also just stumbled about the "Use Same Text for Single Row View" option actually doing nothing - in Single Row View I still get the label text from "Column Heading", no matter what I enter in "Single Row View Label".
I had to adjust a column width using a span tag in the heading (as this seems to be the only way to do that - any other suggestions I found adding style information to the region header had no effect), and now that tag is displayed in the Single Row View label.
I can live with that for now, but it's not really nice.
Is this a known bug? Didn't find anything else in the forum regarding this problem so far.
Holger -
Interactive Report Single Row View Error
I am getting the following error on my Single Row View
{"dialog":{"uv":true,"row":[{"V":"Widget Failure
ORA-20001: SHOW error. ORA-20001: VIEW_ROW error. ORA-20001: GET_COLUMN_VALUE error. ORA-01722: invalid number,
worksheet"}]}}Any clues?
ShuntShunt,
Does this happen on every record? Have you tried to recreate the IRR on another page as a test? Do a SELECT * FROM table...
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen
http://sourceforge.net/projects/plrecur
You can reward this reply by marking it as either Helpful or Correct ;-)
Maybe you are looking for
-
Hi Can't find any loops in Garageband anymore, I can see them in the finder, root Library/Audio/AppleLoops/Apple/Apple Loops for GarageBand but they are not in the software. How can I make them show up as they should? Thanks for any help!
-
How do I bring components to front?
Does anybody know, if I have overlapping components like JLabels, how can I choose which one to bring to the front? In other words, if I have two overlapping JLabels, how can I choose which one gets seen.
-
Can someone help, with in app purchase ?
so i play clash of clans, and i bought a couple gem bags, in-app purchase with a gift card $30 was all good then i bought a couple more and got the gems with my credit card, i must of pressed it twice or something but cancled it and didnt complete th
-
Get-WmiObject -class win32_product doesn't list all installed Applications
Hello in my test win server 2012 R2 datacenter, i have installed some applications such as mozilla firefox, Advanced renamer, office, Acrobat reader. Get-WmiObject -class win32_product Get-CimInstance -class win32_product when i run either of the fol
-
Images load in internet explorer, not in firefox, why is this?
The website i am working in is www.pestcontrolprofessional.com. On the upper lefthand corner is the company's logo. This loads fine in internet explorer, but i cant get it to load on firefox. On the "AboutUs" page i also can't get the image to load i