Union Operator
I'm new to oracle and would like to make a view from two tables
BOOK
ÍSBN----TITLE----IN_STOCK----PRICE----AUTHOR_ID----TYPE_ID----SUPPLIER_ID
AUTHOR
ID---NAME---DATE_OF_BIRTH
now i want to make a column which give out the Author Name and the Amount of books the Author has written.
then on the last row i'd like to add the word Total then the total Author(number) and total books(number)
eg
Author_Name Amount_book
Jon 3
dave 1
Sara 1
Total 3 4
How do i do this?
select decode(authors.name,null, 'Total authors : ' || count(authors.name) over (), authors.name) Name, count(books.isbn) total_books
from authors, books
where authors.id = books.author_id
group by rollup(authors.name);
NAME TOTAL_BOOKS
Jonathan Lewis 1
Tom kyte 2
Total authors : 2 3
Similar Messages
-
While doing union operation, i am getting the following eror.
While doing union operation, i am getting the following eror.
Solution for the following error
"Numbers of columns and their data types must be consistent across all criteria and Result Columns"Hi...phani..thanks for the response..
Report 1: TopN values... working fine
Report2: >TopN values working fine.
when i union the 2 the result is: all records, and i got it.
ReQ: i have to add the remaining Records of >N at the end of the report, represents Others: xxxx
My ReQ:
Col1 Col2 Col3 # of Srs %Of Srs
ABC Complaint Operation 200 40%
CDF ACD Part Availability 100 20%
Others 300 40%
suppose for first column in result tab,
Formula tab: case when saw_4>10 then 'Others' else saw_0 end.
when i put the above condition in Result columns i am getting the error.
Error: Numbers of columns and their data types must be consistent across all criteria and Result Columns -
Writing query using UNION Operator
Question -
(1)
Write an SQL Statement to list the following items: Customer ID, Customer Name, number of invoices, sum of total for invoices. Ensure that all customers are returned in the result set.
Answer for the above is written as below by one person. That seams to be correct. Is there another way of writing this same query.;
select c.CUSTOMER_ID,c.NAME,i.cnt,i.s
from gee_customer c,(select customer_id,count(*) as cnt, sum(TOTAL) as s
from gee_invoice
group by customer_id) i
where c.CUSTOMER_ID = i.customer_id (+)
(2)
My other question is How to write the above answer (or what you sugest) using UNION operator ?
Any ideas please
Message was edited by:
user483578In fact the outer join means you use the union of two result sets - usual join result
and the rows from the outer table for which there is not any row in the inner table.
SQL> select d.deptno, e.ename from emp e, dept d
2 where d.deptno = e.deptno(+)
3 order by 1,2
4 /
DEPTNO ENAME
10 CLARK
10 KING
10 MILLER
20 ADAMS
20 FORD
20 JONES
20 SCOTT
20 SMITH
30 ALLEN
30 BLAKE
30 JAMES
30 MARTIN
30 TURNER
30 WARD
40
15 rows selected.
SQL> select d.deptno,e.ename from emp e, dept d
2 where d.deptno = e.deptno
3 union
4 select deptno, null
5 from dept d where not exists (select null from emp e where e.deptno = d.deptno)
6 order by 1,2
7 /
DEPTNO ENAME
10 CLARK
10 KING
10 MILLER
20 ADAMS
20 FORD
20 JONES
20 SCOTT
20 SMITH
30 ALLEN
30 BLAKE
30 JAMES
30 MARTIN
30 TURNER
30 WARD
40
15 rows selected.In your example something like (NOT tested !)
with i as (select customer_id,count(*) as cnt, sum(TOTAL) as s
from gee_invoice group by customer_id)
select c.CUSTOMER_ID,c.NAME,i.cnt,i.s
from gee_customer c, i
where c.CUSTOMER_ID = i.customer_id
union
select c.CUSTOMER_ID,c.NAME,null,null
from gee_customer c
where not exists (select null from i where c.CUSTOMER_ID = i.customer_id)
Rgds. -
Using union operator in discoverer
Hi All,
I have a sql statement which is to be implemented in discoverer:
(select ........where user_entered_date='YYYY/MM/DD' )
UNION
(select ........where user_entered_date='YYYY/MM/DD'
AND (select ........where user_entered_date='YYYY/MM/DD' ))
Problem:
a) There are nested select statements which require parameters to be entered by the user.
b) How would I implement the union operator in the above scenario?
I would really appreciate it if someone could give a work around.
Regards,
NavHi,
Unfortunately, we can not have a SQL query with Union in Discoverer directly.
You should create a view based on the complete query and then create folder using the view.
You can provide a parameter at the report level.
For eg :
View query : select as_of_date from table_name
Report : Add a paremeter for as_of_date
Hope this Helps!
Yogini -
UNION operator in ejb 3.0
Hi All,
I have to use UNION operator in my ejb ql. My underlying database is MySQL.
My ejb ql is
SELECT s from eee s where s.name like 'XXX'
UNION
SELECT t from eee t where t.default_id = 'XXX'
union is on the same entitybean.
In my eee entity bean I have tried
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
Ejb ql doesnot return the expected results.
Could someone please help me out with UNION operator in ejb 3.0
Thanksyou should have little problems, but just how little is container specific. I successfully run JEE 1.4 stuff on JBoss 5.1 for example without having to make any configuration changes. Heck, I mix that technology with EJB 3 tech, even having shared container managed transactions.
BTW: you mean JEE5, not J2SE 1.5. Big difference in what they represent. -
Creating table or View using UNION Operator ???????
Hi all
please need some help ,i have created aquery using UNION operator
(i.e
select A,to_number(null),C from table1
Union
select A,B,To_number(null) from table2)
it gives the output correctly and i need to make this output as View ot table
eacg time i use
Create or replace view v_1 ...........
it gives me this error :: unknown command "UNION" - rest of line ignored.
can any one pls tell me what to do
ThanksHi,
I found there is no error in your sql
create view x_v
as
select a from x
union
select to_number(null) from y;
this works fine.
in your sql check your right or left peranthesis
regards
Ripudaman -
All,
I have a requirement in SQL that I have to number each row. Hence I thought of using ROWNUM. But the sql query I'm using uses UNION operator. Hence I used like this
select a,b,rownum as 'field1' from table1
union
select c,d,1 as 'field1' from table2
Will the above query solve my purpose?
thanks
senjeneesh wrote:
This will probably kill the purpose of UNION - which is to take only the DISTINCT rows..
If DISTINCT is not intended, it is better to choose UNION ALLYes, you are correct about use of UNION. Probably, OP would have wanted to use Union ALL perhaps, but might have forgotten about suppressing of duplicates and sorting and ended up using Union.
But, in accordance with the original query used by OP, my suggestion of row number would not affect the output, I guess, would it?
Perhaps, if OP would have provided us with some base sample data and the Output desired from it, it would have been of greater help. -
Xpath union operator (|)
I am having trouble using the xpath union operator (|).
The selectNodes method of the oracle.xml.parser.v2.XMLNode is throwing an exception when I use any xPath expression with a pipe such as the one below. Does the Oracle Parser support this type of xPath operator?
Thanks,
Michael
//test/me[@id=3|@id=5]
<test>
<me id="5">you</me>
<me id="3">be</me>
</test>I discovered that this XPath returns the expected result:
//test/me[@id=3]|//test/me[@id=5] -
Hi everyone
I need to merge the data from two omogenous tables (be aware: two tables not two data services; the tables are populated by the user). I specifically need to do this client-side.
When I try to connect the out port of a table to the union operator, the input ports of the operator are grayed out.
I assume the union operator can be used only to merge data from data services: has anyone faced this issue before?
Thanks
Points will be awarded
VTHi Vincenzo,
this is where you reach some limitations in the Visual Composer.
The union operator is made to work on data services, not on tables.
The only ways to solve this are either to use another tool (WebDynpro) or to make use of a data service that would perform the necessary operation for you (creating a specific RFC or Web Service).
Rgds,
Karim -
Cant Add OCRD.CardName,CRD7.ECCNo to this query.Please Help.
declare @FDate as datetime
declare @TDate as datetime
declare @Location as VARCHAR (30)
/* SELECT FROM [dbo].[OLCT] S0 WHERE */ SET @Location = /* S0.Location*/ '[%0]'
/* SELECT FROM [dbo].[OINM] S1 WHERE */ SET @FDate = /* S1.TaxDate*/ '[%1]'
/* SELECT FROM [dbo].[OINM] S2 WHERE */ SET @TDate = /* S2.TaxDate*/ '[%2]'
SELECT
'Sales'Document,OBTN.DistNumber
,NNM1.SeriesName,OINV.DocNum,OCRD.CardName,CRD7.ECCNo,OINV.DocDate,OITM.SWW [HSN Number],INV1.ItemCode,INV1.Dscription,(ITL1.Quantity*-1) [Quantity]
,OEDR.Name,OBTN.U_EDuty*(ITL1.Quantity*-1) EDuty,OBTN.U_EDuty EDutyUnit,OBTN.U_EDCess*(ITL1.Quantity*-1) EDCess,OBTN.U_EDHSCess*(ITL1.Quantity*-1) EDHSCess
,OBTN.U_EDImpDuty SADUnit,OBTN.U_EDImpDuty*(ITL1.Quantity*-1) SADTotal
,OBTN.U_MfgName,OBTN.U_MfgInvNo,OBTN.U_MfgInvDt,OBTN.U_MfgQty,OBTN.U_MfgValue
,OBTN.U_MfgDuty,OBTN.U_MfgCess,OBTN.U_MfgHSCess,OBTN.U_MfgImport
,OBTN.U_SupName,OBTN.U_SupInvNo,OBTN.U_SupInvDt,OBTN.U_SupQty,OBTN.U_SupValue
,OBTN.U_SupDuty,OBTN.U_SupCess,OBTN.U_SupHSCess,OBTN.U_SupImport
FROM
INV1
INNER JOIN
OINV ON INV1.DocEntry=OINV.DocEntry
INNER JOIN
OCRD ON OINV.CardCode = OCRD.CardCode
INNER JOIN
CRD7 ON OCRD.CardCode = CRD7.CardCode
INNER JOIN
OITM ON INV1.ItemCode=OITM.ItemCode
INNER JOIN
OITL ON INV1.BaseType=OITL.ApplyType AND INV1.BaseEntry=OITL.ApplyEntry AND INV1.BaseLine=OITL.ApplyLine
INNER JOIN
ITL1 ON OITL.LogEntry=ITL1.LogEntry
INNER JOIN
OBTN ON ITL1.MdAbsEntry=OBTN.AbsEntry and ITL1.SysNumber=OBTN.SysNumber AND ITL1.ItemCode=OBTN.Itemcode
INNER JOIN
[@OEDR] OEDR ON OBTN.U_EDRate=OEDR.Code
LEFT JOIN
NNM1 ON OINV.Series=NNM1.Series
WHERE INV1.LocCode IN (SELECT Code FROM OLCT WHERE Location=@Location)
AND OINV.DocDate BETWEEN @FDate AND @TDate
UNION ALL
SELECT
'Sales Return'Document,OBTN.DistNumber
,NNM1.SeriesName,ORIN.DocNum,ORIN.DocDate,OITM.SWW [HSN Number],RIN1.ItemCode,RIN1.Dscription,(ITL1.Quantity*-1) [Quantity]
,OEDR.Name,OBTN.U_EDuty*(ITL1.Quantity*-1) EDuty,OBTN.U_EDuty EDutyUnit,OBTN.U_EDCess*(ITL1.Quantity*-1) EDCess,OBTN.U_EDHSCess*(ITL1.Quantity*-1) EDHSCess
,OBTN.U_EDImpDuty SADUnit,OBTN.U_EDImpDuty*(ITL1.Quantity*-1) SADTotal
,OBTN.U_MfgName,OBTN.U_MfgInvNo,OBTN.U_MfgInvDt,OBTN.U_MfgQty,OBTN.U_MfgValue
,OBTN.U_MfgDuty,OBTN.U_MfgCess,OBTN.U_MfgHSCess,OBTN.U_MfgImport
,OBTN.U_SupName,OBTN.U_SupInvNo,OBTN.U_SupInvDt,OBTN.U_SupQty,OBTN.U_SupValue
,OBTN.U_SupDuty,OBTN.U_SupCess,OBTN.U_SupHSCess,OBTN.U_SupImport
FROM
RIN1
INNER JOIN
ORIN ON RIN1.DocEntry=ORIN.DocEntry
INNER JOIN
OITM ON RIN1.ItemCode=OITM.ItemCode
INNER JOIN
OITL ON RIN1.BaseType=OITL.ApplyType AND RIN1.BaseEntry=OITL.ApplyEntry AND RIN1.BaseLine=OITL.ApplyLine
INNER JOIN
ITL1 ON OITL.LogEntry=ITL1.LogEntry
INNER JOIN
OBTN ON ITL1.MdAbsEntry=OBTN.AbsEntry and ITL1.SysNumber=OBTN.SysNumber AND ITL1.ItemCode=OBTN.Itemcode
INNER JOIN
[@OEDR] OEDR ON OBTN.U_EDRate=OEDR.Code
LEFT JOIN
NNM1 ON ORIN.Series=NNM1.Series
WHERE RIN1.LocCode IN (SELECT Code FROM OLCT WHERE Location=@Location)
AND ORIN.DocDate BETWEEN @FDate AND @TDateNagarajan,
I've altered the query into this.Think that it is working.Thanks man
declare @FDate as datetime
declare @TDate as datetime
declare @Location as VARCHAR (30)
/* SELECT FROM [dbo].[OLCT] S0 WHERE */ SET @Location = /* S0.Location*/ '[%0]'
/* SELECT FROM [dbo].[OINM] S1 WHERE */ SET @FDate = /* S1.TaxDate*/ '[%1]'
/* SELECT FROM [dbo].[OINM] S2 WHERE */ SET @TDate = /* S2.TaxDate*/ '[%2]'
SELECT
'Sales'Document,OBTN.DistNumber
,NNM1.SeriesName,OINV.DocNum,OCRD.CardName,CRD7.ECCNo,OINV.DocDate,OITM.SWW [HSN Number],INV1.ItemCode,INV1.Dscription,(ITL1.Quantity*-1) [Quantity]
,OEDR.Name,OBTN.U_EDuty*(ITL1.Quantity*-1) EDuty,OBTN.U_EDuty EDutyUnit,OBTN.U_EDCess*(ITL1.Quantity*-1) EDCess,OBTN.U_EDHSCess*(ITL1.Quantity*-1) EDHSCess
,OBTN.U_EDImpDuty SADUnit,OBTN.U_EDImpDuty*(ITL1.Quantity*-1) SADTotal
,OBTN.U_MfgName,OBTN.U_MfgInvNo,OBTN.U_MfgInvDt,OBTN.U_MfgQty,OBTN.U_MfgValue
,OBTN.U_MfgDuty,OBTN.U_MfgCess,OBTN.U_MfgHSCess,OBTN.U_MfgImport
,OBTN.U_SupName,OBTN.U_SupInvNo,OBTN.U_SupInvDt,OBTN.U_SupQty,OBTN.U_SupValue
,OBTN.U_SupDuty,OBTN.U_SupCess,OBTN.U_SupHSCess,OBTN.U_SupImport
FROM
INV1
INNER JOIN
OINV ON INV1.DocEntry=OINV.DocEntry
INNER JOIN
OITM ON INV1.ItemCode=OITM.ItemCode
INNER JOIN
OCRD ON OINV.CardCode = OCRD.CardCode
INNER JOIN
CRD7 ON OCRD.CardCode = CRD7.CardCode
INNER JOIN
OITL ON INV1.BaseType=OITL.ApplyType AND INV1.BaseEntry=OITL.ApplyEntry AND INV1.BaseLine=OITL.ApplyLine
INNER JOIN
ITL1 ON OITL.LogEntry=ITL1.LogEntry
INNER JOIN
OBTN ON ITL1.MdAbsEntry=OBTN.AbsEntry and ITL1.SysNumber=OBTN.SysNumber AND ITL1.ItemCode=OBTN.Itemcode
INNER JOIN
[@OEDR] OEDR ON OBTN.U_EDRate=OEDR.Code
LEFT JOIN
NNM1 ON OINV.Series=NNM1.Series
WHERE INV1.LocCode IN (SELECT Code FROM OLCT WHERE Location=@Location)
AND OINV.DocDate BETWEEN @FDate AND @TDate
UNION ALL
SELECT
'Sales Return'Document,OBTN.DistNumber
,NNM1.SeriesName,ORIN.DocNum,OCRD.CardName,CRD7.ECCNo,ORIN.DocDate,OITM.SWW [HSN Number],RIN1.ItemCode,RIN1.Dscription,(ITL1.Quantity*-1) [Quantity]
,OEDR.Name,OBTN.U_EDuty*(ITL1.Quantity*-1) EDuty,OBTN.U_EDuty EDutyUnit,OBTN.U_EDCess*(ITL1.Quantity*-1) EDCess,OBTN.U_EDHSCess*(ITL1.Quantity*-1) EDHSCess
,OBTN.U_EDImpDuty SADUnit,OBTN.U_EDImpDuty*(ITL1.Quantity*-1) SADTotal
,OBTN.U_MfgName,OBTN.U_MfgInvNo,OBTN.U_MfgInvDt,OBTN.U_MfgQty,OBTN.U_MfgValue
,OBTN.U_MfgDuty,OBTN.U_MfgCess,OBTN.U_MfgHSCess,OBTN.U_MfgImport
,OBTN.U_SupName,OBTN.U_SupInvNo,OBTN.U_SupInvDt,OBTN.U_SupQty,OBTN.U_SupValue
,OBTN.U_SupDuty,OBTN.U_SupCess,OBTN.U_SupHSCess,OBTN.U_SupImport
FROM
RIN1
INNER JOIN
ORIN ON RIN1.DocEntry=ORIN.DocEntry
INNER JOIN
OCRD ON ORIN.CardCode = OCRD.CardCode
INNER JOIN
CRD7 ON OCRD.CardCode = CRD7.CardCode
INNER JOIN
OITM ON RIN1.ItemCode=OITM.ItemCode
INNER JOIN
OITL ON RIN1.BaseType=OITL.ApplyType AND RIN1.BaseEntry=OITL.ApplyEntry AND RIN1.BaseLine=OITL.ApplyLine
INNER JOIN
ITL1 ON OITL.LogEntry=ITL1.LogEntry
INNER JOIN
OBTN ON ITL1.MdAbsEntry=OBTN.AbsEntry and ITL1.SysNumber=OBTN.SysNumber AND ITL1.ItemCode=OBTN.Itemcode
INNER JOIN
[@OEDR] OEDR ON OBTN.U_EDRate=OEDR.Code
LEFT JOIN
NNM1 ON ORIN.Series=NNM1.Series
WHERE RIN1.LocCode IN (SELECT Code FROM OLCT WHERE Location=@Location)
AND ORIN.DocDate BETWEEN @FDate AND @TDate -
UNION operator with BULK COLLECT for a collection type
Hi all,
I created a table type as below:
create or replace type coltest is table of number;
Below are 3 PL/SQL blocks that populate data into variables of the above mentioned table type:
BLOCK 1:
DECLARE
col1 coltest := coltest(1, 2, 3, 4, 5, 11);
col2 coltest := coltest(6, 7, 8, 9, 10);
col3 coltest := coltest();
BEGIN
SELECT * BULK COLLECT
INTO col1
FROM (SELECT *
FROM TABLE(CAST(col1 AS coltest))
UNION ALL
SELECT * FROM TABLE(CAST(col2 AS coltest)));
dbms_output.put_line('col1');
dbms_output.put_line('col1.count: ' || col1.COUNT);
FOR i IN 1 .. col1.COUNT
LOOP
dbms_output.put_line(col1(i));
END LOOP;
END;
OUPUT:
col1
col1.count: 5
6
7
8
9
10
BLOCK 2:
DECLARE
col1 coltest := coltest(1, 2, 3, 4, 5, 11);
col2 coltest := coltest(6, 7, 8, 9, 10);
col3 coltest := coltest();
BEGIN
SELECT * BULK COLLECT
INTO col2
FROM (SELECT *
FROM TABLE(CAST(col1 AS coltest))
UNION ALL
SELECT * FROM TABLE(CAST(col2 AS coltest)));
dbms_output.put_line('col2');
dbms_output.put_line('col2.count: ' || col2.COUNT);
FOR i IN 1 .. col2.COUNT
LOOP
dbms_output.put_line(col2(i));
END LOOP;
END;
OUTPUT:
col2
col2.count: 6
1
2
3
4
5
11
BLOCK 3:
DECLARE
col1 coltest := coltest(1, 2, 3, 4, 5, 11);
col2 coltest := coltest(6, 7, 8, 9, 10);
col3 coltest := coltest();
BEGIN
SELECT * BULK COLLECT
INTO col3
FROM (SELECT *
FROM TABLE(CAST(col1 AS coltest))
UNION ALL
SELECT * FROM TABLE(CAST(col2 AS coltest)));
dbms_output.put_line('col3');
dbms_output.put_line('col3.count: ' || col3.COUNT);
FOR i IN 1 .. col3.COUNT
LOOP
dbms_output.put_line(col3(i));
END LOOP;
END;
OUTPUT:
col3
col3.count: 11
1
2
3
4
5
11
6
7
8
9
10
Can anyone please explain the output of BLOCK 1 and 2? Why doesn't bulk collect into col1 and col2 return 11 as count?Consider the following code from your block.
select *
bulk collect into col1
from (
select *
from table(cast(col1 as coltest))
union
all
select *
from table(cast(col2 as coltest))
); Now my assumption would be like this.
PL/SQL engine would recognize the SQL part and will be sending it to SQL Engine for processing. Before doing that it will try to initialize the SQL collection variable COL1. Now when SQL Engine process the SELECT, COL1 would be empty already. And thats the reason you don't get the as 5 and not 11. -
Prioritizing a set by using union operator
My requirement is to print data whose log_in_id starts with a and end with y first, then to print data starting with a and b.
select * from userid where log_in_id like 'a%y' union select * from userid where log_in_id like 'a%' or log_in_id like 'b%'Why go through the table twice? I would do something like:
SQL> SELECT log_in_id
2 FROM (SELECT 'bob' log_in_id FROM dual
3 UNION ALL
4 SELECT 'bill' from dual
5 UNION ALL
6 SELECT 'ally' from dual
7 UNION ALL
8 SELECT 'abby' from dual
9 UNION ALL
10 SELECT 'allen' from dual
11 UNION ALL
12 SELECT 'albert' from dual)
13 ORDER BY CASE WHEN log_in_id LIKE 'a%y' THEN 1 ELSE 2 END,
14 log_in_id;
LOG_IN
abby
ally
albert
allen
bill
bobHTH
John -
With using the Union oper. query
Hi Team
I have table like A and B
A table Structure
C1-------C2-------C3
R1-------R2--------R3
R4-------R5---------R6
B table Structure
C1-----C2
R11----R8
my output is like below
C1-------C2-------C3
R1-------R2--------R3
R4-------R5---------R6
R11----R8----------null
i can use the Union all condition i don't want to use the
union all condition who? plz help
select c1,c2,c3
union
select c1,c2;870003 wrote:
Hi Team
I have table like A and B
A table Structure
C1-------C2-------C3
R1-------R2--------R3
R4-------R5---------R6
B table Structure
C1-----C2
R11----R8
my output is like below
C1-------C2-------C3
R1-------R2--------R3
R4-------R5---------R6
R11----R8----------null
i can use the Union all condition i don't want to use the
union all condition who? plz helpWhy don't you want to use union all, because that is exactly what you are trying to achieve? -
Im using oracle8, I want to write a query something like this,
SELECT x,y,z from (subquery)
UNION
SELECT x,y,z from (subquery)
UNION
SELECT x,y,z from (subquery)
But the subquery is that long that I cannot repeat it in every select statement. So i want to define an alias for the subquery, and use it in every select statement. I want to do all this in just SQL, not PL/SQL, since I'll be using this query in cogos. Any sugesstions?Not that it's any help to you, but Oracle 9i has provided the WITH clause, which allows us to alias sub-queries just like you want to do. It also executes the sub-query just the once, so there are some good performance gains, even for correlated sub-queries.
Cheers, APC -
Can I union several cursors for the same secondary db?
I want to search several keys in one secondary database.
select * from adb where a=6 or a=9 or ....
certainly, this can be done by running several queries, but it is definitely slow.
wondered if it is possible to union these several cursors together, then fetch the data from the primary database at once? seems this is not supported in current BDB implementation.
trying to modify the bdb code to support the cursor union operation. but get lost in the code. (seems java version is simpler than the c version. )
can some friend from Oracle, Ron, Bogdan, Andrei,Alexander
shed me some light on how a cursor in bdb is implemented. did not find too much detail in the document.
and hope this is in the to-do list of next version.
thanksHi,
The idea of joining cursors on the same secondary db presents no logic since you don't want to identify common keys within the records corresponding to each cursor.
A join cursor works the following way: the first cursor on a secondary db within the cursor array is analyzed and each primary key that the cursor refers to is searched within the next primary keys refered to by the next joined cursor in the array, and so on, leading to identifying the primary keys that each of cursors within the array refer to (the common keys).
What you want to achieve on a secondary db can be accomplished by positioning several cursors on the records that you want, begin reading sequentially with each of them, go to the other when you have finished reading with one cursor. A faster approach, which shouldn't involve any locking issues since the acquired locks are shared/read locks and you'll not perform any writes at that moment, may be that of spawning several threads and open a cursor within each thread, thus performing multithreading cursor read operations. You'll have to analyze each approach with regard to how many duplicates the cursors will refer, time consumed to spawn the threads etc.
Let us know if you need further information, regards,
Andrei
Maybe you are looking for
-
Unable to upgrade itunes or Quick Time
I recently transferred all my data and programs to a new hard drive. Since then I have been unable to run itunes. The message "This action is only valid for products that are currently installed". When I try to delete itunes so I can reinstall it I g
-
Dynamic variable Time for Select
Hi, I try to develop some scripts but always I have the same problem , when I try to put in a Select instruction the variable Time, it doesn´t work correctly (for example): *SELECT(%example%,"ID","TIME","[ID]='%TIME_SET%' ") It doesn´t read correctly
-
[SOLVED] Gnome: initial working directory set to / instead of HOME
Solved: See commentary #6 Hi there, Since some weeks ago, don't know what I touched, everything starts from the root directory instead of starting from the home directory. That is, file managers, consoles, emacs, etc. start always in the root directo
-
hello, i have these 2 lines of code: find /Applications -iname "*.app" -prune ( find /Applications -iname "*.app" -prune -print0; ) | xargs -0 du -hsc they are both just an example of finding the apps in the applications folder, but the second one in
-
Implementing Database codes FAIL /error in parsing data into jsp page
Hi there, I have this problem trying to build a portal application. I am using the JSPDynPage, jsp page and a bean to build a page. I have this problem parsing data from JSPDynPage to the beans and to the jsp page. I tested out the connection between