Perform join in VC without using BI query
Hi experts
Is it possible to to perform join on two tables in VC without using BI query.
I have data in two tables as follows
Month Closed
6 2
7 1
9 2
and
Month Open
8 1
9 1
10 1
and want result as
Month Open closed
6 -- 2
7 -- 1
8 1 --
9 1 2
10 1 --
Hi experts,
i´m looking for a solution for the problem described above.
I will join a standard data source from the CE-Server (e.g. BI_BPM_MY_PROCESSES_DS) with our own reporting source. So I don´t have the opportunity to use a backend system (e.g. a BI system) to join the data sources!
Is there an solution or workaround available?
Thanks and regards,
Bastian
Similar Messages
-
How can i join additional column without using a query
Hi,
I created a report using a base query; Now i want to add an additional coloumn to it without using another table i.e. from no new query; That additional column is complex computed value from different tables created for each record; How can i attach it to each record;
thanks in advance
prasanthAdd a formula column in your existing query.
-
How to find a data with the minimum value I get without using sub query
Currently, I manage to get a record by using subquery to find the minimum number, eg:
SELECT TAccTrn.ASysCde
FROM TAccTrn
WHERE TAccTrn.AAccTrnNum=(SELECT Min(TAccTrn.AAccTrnNum)
FROM TAccTrn, TDbtSchCltDtl
WHERE TDbtSchCltDtl.ASrcRefId=TAccTrn.ASrcRefId
AND TDbtSchCltDtl.ASrcRefSubId=TAccTrn.ASrcRefSubId
AND TDbtSchCltDtl.ASrcRefSeq=TAccTrn.ASrcRefSeq)
Is there any more idea without using the subquery?Hi ,
What about using an in-line view and the row_number () analytic function...????
Here is an example....
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 18/12/1980 800,00 20
7499 ALLEN SALESMAN 7698 20/02/1981 1600,00 300,00 30
7521 WARD SALESMAN 7698 22/02/1981 1250,00 500,00 30
7566 JONES MANAGER 7839 02/04/1981 2975,00 20
7654 MARTIN SALESMAN 7698 28/09/1981 1250,00 1400,00 30
7698 BLAKE MANAGER 7839 01/05/1981 2850,00 30
7782 CLARK MANAGER 7839 09/06/1981 2450,00 10
7788 SCOTT ANALYST 7566 18/04/1987 3000,00 20
7839 KING PRESIDENT 17/11/1981 5000,00 10
7844 TURNER SALESMAN 7698 08/09/1981 1500,00 0,00 30
7876 ADAMS CLERK 7788 21/05/1987 1100,00 20
7900 JAMES CLERK 7698 03/12/1981 950,00 30
7902 FORD ANALYST 7566 03/12/1981 3000,00 20
7934 MILLER CLERK 7782 23/01/1982 1300,00 10
14 rows selectedUsing a solution like the one you don't want ...(a subquery) i would write....
SQL> select ename from emp
2 where hiredate=(select min(hiredate) from emp)
3 /
ENAME
SMITHWhereas , using an in-line view....
SQL> select ename from
2 (
3 select ename,row_number() over(order by hiredate asc) row_num from emp
4 )
5 where row_num=1
6 /
ENAME
SMITHIs it acceptable...????
Regards,
Simon -
Wants - Create CCMS Alerts without using RWB
Hi,
I would like to create CCMS Alerts such as CPU performance, memory ect. ect. without using RWB
is that posible ? if yes how can i do that...
also I want to create CCMS alert will sent mail for different users, like memory alert sent to couple of users, and CPU performance alerts mail to different users like basis team...
Thanks in AdvancedThanks for Accept my Eaddress, can I get your Eaddress please.... yahoo or msn
as you know that I am trying to create CCMS in XI 3.0 and its nothing any link with tcode: ALRTCATDEF
I am follow some sim.file / doc to setup CCMS to (Lotus notes)
I setup everything but alerts is not show in lotus notes
SAPconnect works fine, internal mails are working fine
I wana share with you guys, what i done yet
USER SETTING
1. in SU01 my user has my Eaddress on it
2. Comm. Meth mail
SMTP SETTING
1. SAP&CONNECTNET is actives and internet mail works
2. In SMTP setting mail host localhost and port: 25
3. Create background job every 5 munites
RZ21 METHOD SETTING
RZ21 --> copy Method CCMS_OnAlert_mail to TEST_CCMS_OnAlert_mail
in parameters tab: Sender: my user name
Recipient: myamil address
Recipient - typeid: U
In Release tab check autore action method
MTE CLASS
1. under SAP CCMS Monitor Templates --> Dialog overview --> dialog Response Time --> Server name --> properties
then double click MTE class, and in auto-reaction method name: TEST_CCMS_OnAlert_mail
2. Goback to MTE tree, click open alerts push button
3. its show 10 alerts when I click display alerts push button show 10 alerts and status "Action_Failed"
Question: why its not mail automatically, did i miss anything or will i need to change profile ?????
please i would like to setup only this thing
thanks -
TopLink doesn't sort data received using Named query
Hello!
I'm trying to build a Tree table using a TopLink Named query in my application.
There are Id, Parent|_Id, Code and Name columns in the corresponding database table, where Id and Parent|_Id are linked together by Foreign key (typical tree). I used TopLink to describe this table in the Model part of my application. There I wrote a Named query, without using a query constructor (not Expression radio button, but SQL radio button). Here the text of query:
select * from regions a connect by prior a.Id = a.Parent_Id start
with a.Id is null order by a.Code
Then I created a Data control and tried to build a JSF page with data based on this query, as tree-table.
But I discovered the fact, that data under the same node on the same leaf level of the Tree are not sorted by code on the JSF page. For example, data may be situated as follows (Code - Name):
2. wwwwwwwwwwww
2.3.kkkkkkkkkkkk
2.1.fffffffffffffffffffff
2.2.oooooooooo
1. qqqqqqqqqqqqqqqq
1. 2. lllllllllllllllllllllllllllll
1. 1. hhhhhhhhhhhhhh
etc.
I verified this query on other environment (PL/SQL Developer, SQL+), but didn't found such unsorted results anywhere.
Please, give me an advice to avoid this problem.
Thanks.Hi
Something to do with TreeMap(TreeSet). I tried with TreeSet but it didn't work. Here is the code :
In servlet :
Connection lConnection = getConnection(pRequest);
String lSQL = "";
Statement lStatement;
ResultSet lResultSet;
Hashtable lLtypeHashtable = new Hashtable();
lStatement = lConnection.createStatement();
lSQL = "SELECT RCID,RCMEANING FROM REFERENCECODES WHERE RCDOMAIN = 'LOCATIONTYPE' AND RCROWSTATE > 0 order by RCMEANING";
lResultSet = lStatement.executeQuery(lSQL);
while(lResultSet.next())
String lRcid = lResultSet.getString(1);
String lRcmeaning = lResultSet.getString(2);
lLtypeHashtable.put(lRcid.trim(),lRcmeaning.trim());
if(lResultSet != null) lResultSet.close();
if(lStatement != null) lStatement.close();
pRequest.setAttribute("LtypeHashtable",lLtypeHashtable);
//Below Query is executed when one data from select element is selected
String lLType = DisplayUtilities.getString(pRequest.getParameter("LType"),true);
//LType is name of select element in JSP.
if (lLType != null)
lSQL = lSQL + " AND " + lUpperCaseFunction + "(LOCATIONTYPE)" +
" = " + DBUtilities.formatString(lLType.toUpperCase());
pRequest.setAttribute("rLType",lLType+"");
In JSp :
<%
Hashtable lLtypeHashtable = (Hashtable)request.getAttribute("LtypeHashtable");
%>
<TR>
<TD width="15%"> <div align="left">
<select name="LType" size="1" >
<option Value="">< Select ></option>
<%
if(lLtypeHashtable != null)
Enumeration enum = lLtypeHashtable.keys();
while(enum.hasMoreElements())
String key = (String)enum.nextElement();
String value = (String)lLtypeHashtable.get(key);
String flagBack = "";
if(key.equals((String)request.getAttribute("rLType")))
flagBack = "selected";
%>
<option Value="<%=key%>" <%=flagBack%>><%=value%></option>
<%
%>
</select></div>
</TD>
</TR>
How should I implement TreeSet?
Looking forward for an early reply.
Thanks. -
How can i fetch records from 3 tables in a single query without using join
Hi.
Can any body please tell me <b>How can i fetch records from 3 tables with a single query without using joins</b>
Thanx
prabhuduttaHi Prabgudutta,
We can fetch the data by using the views concept.
Go throuth this info we can know the how to create view and same like database table only we can fetch the data.
Views conatin the data at runtime only.
Four different view types are supported. These differ in the
way in which the view is implemented and in the methods
permitted for accessing the view data.
Database views are implemented with an equivalent view on
the database.
Projection views are used to hide fields of a table (only
projection).
Help views can be used as selection method in search helps.
Maintenance views permit you to maintain the data
distributed
on several tables for one application object at one time.
step by step creation of Maintenance view:
With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
It can be set in transaction SE11 - Tools - Table maintenance generator.
Table maintanance Generator is used to manually input values using transaction sm30
follow below steps
1) go to se11 check table maintanance check box under attributes tab
2) utilities-table maintanance Generator-> create function group and assign it under
function group input box. Also assign authorization group default &NC& .
3) select standard recording routine radio in table table mainitainence generator to move table
contents to quality and production by assigning it to request.
4) select maintaience type as single step.
5) maintainence screen as system generated numbers this dialog box appears when you click on create button
6) save and activate table
One step, two step in Table Maintenance Generator
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
SM30 is used for table maintenance(addition or deletion of records),
For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..
It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..
In the SE11 delivery and maintenance tab, keep the maintenance allowed..
Then come to the SM30 and then enter the table name and press maintain..,
Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
Then create,,,
Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
We use SM30 transaction for entering values into any DB table.
First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
Then it will create a View.
After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
Hope this resolves your query.
Reward all the helpful answers.
Rgds,
P.Naganjana Reddy -
Can we perform Join operation using SQLCall with Datatabae Query
Hi,
I am working on Toplink SQLCall query. I am performing join operation but, it is giving error.
so please, any can tell me . we can perform join operation using SQLCall with Database Query
Thanking You.You can use joining with SQLCall queries in TopLink, provided your SQL returns all of the required fields.
What is the query you are executing and what error are you getting? -
Hello every one, can I rewrite the following query without using the 'ROW_NUMBER() OVER ' part.
The query is supposed to pull out the records whose CODE is not NULL and has most
recent date for UPDATE_DATE . The reason I wanted to do this is, When I embed this query
in between many other queries along with JOINs, My oracle server is unable to execute. So, I thought
its better to supplant 'ROW_NUMBER() OVER ' logic with something else and try it. .
SELECT a.* FROM
(SELECT b.*, ROW_NUMBER() OVER (PARTITION BY b.PIDM
ORDER BY b.UPDATE_DATE DESC) AS Rno
FROM
SELECT *
FROM SHYNCRO WHERE CODE IS NOT NULL
)b
)a
WHERE a.Rno = 1Hi,
You didn't write over 150 lines of code and then start testing it, did you?
Don't.
Take baby steps. Write as little as pssiblem test that. Debug and test again until you have something that does exactly what you want it to do.
When you have somehting that works perfectly, take one baby step. Add a tiny amount of code, maybe 1 or 2 lines more, and test again.
When you do get an error, or wrong results, you'll have a much better idea of where the problem is. also, you won't be building code on a flimsy foundation.
If you need help, post the last working version and the new version with the error. Explain what you're trying to do in the new version.
The error message indicates line 133. It looks like line 133 of your code is blank. Does your front end allow completely blank lines in the middle of a query? SQL*Plus doesn't by default; you have to say
SET SQLBLANKLINES ONto have a completely blank line in SQL*Plus. (However, lines containing nothing but at commnet are always allowed.)
You may have noticed that this site normally doesn't display multiple spaces in a row.
Whenever you post formatted text (such as indented code) on this site, type these 6 characters:
\(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
The 4 people who posted small code fragments for you to read all did this. It would be so much easier for people to read your humongeous query if it were formatted. -
How can i construct this query without using CASE statement?
I've a following code. I'm using this script in Hibernet. So, i cannot use CASE there. Because, hibernet doesn't support case in select statement. How can i construct the same thing which will give me the same result without using CASE?
SELECT ofc.FLT_LCL_ORIG_DT
, ofc.CARR_IATA_CD
, ofc.FLT_NBR
, ofc.ORIG_ARPT_CD
, ofc.DEST_ARPT_CD
, sum( ofc.CNCT_PSGR_CNT) AS BOOKED_CNCT_PSGR_CNT
, sum( CASE WHEN o.fsdr_mrkt_cd = 'D' AND d.fsdr_mrkt_cd = 'D' THEN '0'
ELSE to_char(ofc.CNCT_PSGR_CNT,'99') END ) AS BOOKED_INTL_CNCT_PSGR_CNT
, sum(CASE WHEN o.fsdr_mrkt_cd||d.fsdr_mrkt_cd = 'DD'
THEN '0'
ELSE to_char(ofc.CNCT_PSGR_CNT,'99')
END) AS NEW_BCNT
FROM OPS_FLT_CNCT ofc
, STN o
, STN d
WHERE ofc.CNCT_ORIG_ARPT_CD = o.STN_CD
AND ofc.CNCT_DEST_ARPT_CD = d.STN_CD
-- AND TRUNC(ofc.FLT_LCL_ORIG_DT) = trunc(to_date('22-MAY-2007','DD-MON-YYYY'))
AND ofc.CARR_IATA_CD = 'UA'
AND ofc.FLT_NBR = '1218'
AND ofc.ORIG_ARPT_CD = upper('DEN') AND ofc.DEST_ARPT_CD = upper('IAD') GROUP BY ofc.FLT_LCL_ORIG_DT
, ofc.CARR_IATA_CD
, ofc.FLT_NBR
, ofc.ORIG_ARPT_CD
, ofc.DEST_ARPT_CD ;And, the output look like this --
FLT_LCL_O CARR FLT_N ORI DES BOOKED_CNCT_PSGR_CNT BOOKED_INTL_CNCT_PSGR_CNT NEW_BCNT
22-MAY-07 UA 1218 DEN IAD 9 0 0
23-MAY-07 UA 1218 DEN IAD 1 0 0
24-MAY-07 UA 1218 DEN IAD 2 1 1
25-MAY-07 UA 1218 DEN IAD 1 0 0Thnaks in advance for reply.
Regards.
Satyaki De.
#####2 ideas:
1. Inline function to perform the CASE funcionaltity for you
2. Piplelined function to generate the entire dataset
Both will be slower than just using CASE in a query, but we're working around big constraints -
How to write a SQL Query without using group by clause
Hi,
Can anyone help me to find out if there is a approach to build a SQL Query without using group by clause.
Please site an example if is it so,
RegardsI hope this example could illuminate danepc on is problem.
CREATE or replace TYPE MY_ARRAY AS TABLE OF INTEGER
CREATE OR REPLACE FUNCTION GET_ARR return my_array
as
arr my_array;
begin
arr := my_array();
for i in 1..10 loop
arr.extend;
arr(i) := i mod 7;
end loop;
return arr;
end;
select column_value
from table(get_arr)
order by column_value;
select column_value,count(*) occurences
from table(get_arr)
group by column_value
order by column_value;And the output should be something like this:
SQL> CREATE or replace TYPE MY_ARRAY AS TABLE OF INTEGER
2 /
Tipo creato.
SQL>
SQL> CREATE OR REPLACE FUNCTION GET_ARR return my_array
2 as
3 arr my_array;
4 begin
5 arr := my_array();
6 for i in 1..10 loop
7 arr.extend;
8 arr(i) := i mod 7;
9 end loop;
10 return arr;
11 end;
12 /
Funzione creata.
SQL>
SQL>
SQL> select column_value
2 from table(get_arr)
3 order by column_value;
COLUMN_VALUE
0
1
1
2
2
3
3
4
5
6
Selezionate 10 righe.
SQL>
SQL> select column_value,count(*) occurences
2 from table(get_arr)
3 group by column_value
4 order by column_value;
COLUMN_VALUE OCCURENCES
0 1
1 2
2 2
3 2
4 1
5 1
6 1
Selezionate 7 righe.
SQL> Bye Alessandro -
Needs help to retrive the last row in a select query without using rownum
Hi ,
i need to retrive the last row from the select sub query without using rownum.
is there any other way to retrive the last row other than the below query.
is that the ROWNUM=1 will always retrive the 1 row of the select query ?
select from*
*(select ename from employee where dept_id=5 order by desc) where rownum=1;*
Please advise.
thanks for your help advance,
regards,
Senthur957595 wrote:
Actually my problem is ithat while selecting the parents hiearchy of the child data using
CONNECT BY PRIOIR query
I need the immediate parent of my child data.
For example my connect BY query returns
AAA --- ROOT
BBB --PARENT -2
CCC --PARENT-1
DDD IS my input child to the connect by query
Immediate parent of my child data "DDD" ---> CCC(parent -1)
i want the data "CCC" from the select query,for that i am taking the last row of the query with rownum.
I got to hear that using ROWNUM to retrive the data will leads to some problem.It is a like a magic number.I am not sure what the problem will be.
So confusing with using this rownum in my query.
Please advice!!!It's not quite clear what you're wanting, but perhaps this may help?
you can select the PRIOR values to get the parent details if you want...
SQL> ed
Wrote file afiedt.buf
1 select empno, lpad(' ',(level-1)*2,' ')||ename as ename, prior empno as mgr
2 from emp
3 connect by mgr = prior empno
4* start with mgr is null
SQL> /
EMPNO ENAME MGR
7839 KING
7566 JONES 7839
7788 SCOTT 7566
7876 ADAMS 7788
7902 FORD 7566
7369 SMITH 7902
7698 BLAKE 7839
7499 ALLEN 7698
7521 WARD 7698
7654 MARTIN 7698
7844 TURNER 7698
7900 JAMES 7698
7782 CLARK 7839
7934 MILLER 7782
14 rows selected.(ok, not the best of examples as the mgr is already known for a row, but it demonstrates you can select prior data) -
Tuning query without using hint
Hi,
i want to change the plan of a query without using hint.
Also i want to use the plan that hint generate in my original query.
My db is a 11g.
How can i do this?
tnxYou can use SQL Plan Manager. You might find this interesting:
http://blogs.oracle.com/optimizer/entry/what_should_i_do_with_old_hints_in_my_workload
The link above basically suggests these steps:
1. Run the query with the hints, then
2. Take the plan from #1 and associate its SQL plan baseline with the query with no hints
3. Remove the hints for that query in the code and start capturing and evolving plans for the un-hinted query -
I want single update query without use the function.
I want to update sells_table selling_code field with max date product_code from product table.
In product table there is multiple product_code date wise.
I have been done it with below quey with the use of function but can we do it in only one update query
without use the function.
UPDATE sells_table
SET selling_code = MAXDATEPRODUCT(ctd_vpk_product_code)
WHERE NVL(update_product_flag,0) = 0 ;
CREATE OR REPLACE FUNCTION HVL.maxdateproduct (p_product IN VARCHAR2) RETURN NUMBER
IS
max_date_product VARCHAR2 (100);
BEGIN
BEGIN
SELECT NVL (TRIM (product_code), 0)
INTO max_date_product
FROM (SELECT product_code, xref_end_dt
FROM product
WHERE TO_NUMBER (p_product) = pr.item_id
ORDER BY xref_end_dt DESC)
WHERE ROWNUM = 1; -- It will return only one row - max date product code
EXCEPTION
WHEN OTHERS
THEN
RETURN 0;
END;
RETURN max_date_product;
END maxdateproduct;
Thanks in Advance.Hi,
Something like this.
update setlls_table st
set selling_code =(select nvl(trim(product_code)) from
(select product_code
, rank() over (partition by item_id order by xref_end_dt DESC) rn
from product
) pr
where rn =1
and pr.item_id = st.ctd_vpk_product_code
) where NVL(update_product_flag,0) = 0 ;As such not tested due to lack of input sample.
Regards
Anurag Tibrewal. -
SQL Query without using Pivot...
Hi Guys,
Need help with a query... I think pivot table is the way to go but don't wanna to use it as it is not supported in Oracle 10g.
Sample data set...
Part
Section
A001
AC
A001
AY
A001
AN
A001
AX
A015
AC
A015
AR
A007
AC
A008
AN
A008
AX
A008
AE
A008
AT
A008
AY
Required output... (Please note that I cannot hard code the Section column as the data is dynamic)
Part
AC
AY
AN
AX
AR
AE
AT
A001
Y
Y
Y
Y
A015
Y
Y
A007
Y
A008
Y
Y
Y
Y
Y
Can you help me out with this without using pivot tables?
Thanks,
NapsterHi Napster, Try this
select part,
max(decode(section,'AC','Y',NULL)) AC,
max(decode(section,'AY','Y',NULL)) AY,
max(decode(section,'AN','Y',NULL)) AN,
max(decode(section,'AX','Y',NULL)) AX,
max(decode(section,'AC','Y',NULL)) AC,
max(decode(section,'AR','Y',NULL)) AR,
max(decode(section,'AT','Y',NULL)) AT
from sple group by part
SQL> /
Output will be
PART A A A A A A A
A001 Y Y Y Y Y
A007 Y Y
A008 Y Y Y Y
A015 Y Y Y -
Can u write the following query without using group by clause
select sp.sid, p.pid, p.name from product p, supp_prod sp
where sp.pid= p.pid and
sp.sid = ( select sid from supp_prod group by sid
having count(*) =(select count(*) from product));
thru this, we retrieving all the products delivered by the supplier.
Can you write the following query without using the group by clauseselect sp.sid, p.pid, p.name
from product p, supp_prod sp
where sp.pid= p.pid the above query will still retrieve all the products supplied by the supplier. sub-query is not necessary.
maybe if you can post some sample data and output will help us understand what you want to achieve.
Maybe you are looking for
-
CSA - random temp file in windows folder, no extension
So I have this ASP.NET application that insists on placing its temp files directly in the Windows directory. AND it doesn't use any kind of extension. So how do you allow this without making the windows folder vulnerable? Here is an example of the ev
-
Repeated object sending problem
why when you serialize the same reference multiple times after an internal state change does it not update in the sent copy? meaning , if i have a Tree object with a height parameter , and i send it with height=50 and then i update the same objects (
-
Unable to setup DBAcockpit connection in managed System Conf.
Hi Guys, I am trying to set up DbaConnection in managed System Conf for local solman system. Its Showing red status and also the fields are not changeable now. I am on kernal 720 level 300. error shows the No DBSL lib found and gives the note number
-
Problems Packaging/Copying Links..
I have a huge file, 50 pages chock full of high res art that is being pulled from all different folders on my machine. There are 300+ pieces of art, the InDesign file itself is 75MB. When I try to package it, OR go to the LINKS panel and choose Copy
-
Songs stay on iPhone after Match
After syncing with iMatch in iTunes, the songs are still on the phone. 9GB out of 16GB are audio files. When connected in iTunes under Music, it says iTunes Match is on, and my iphone can access music in iCloud. I'm not synching music, but the mus