Oracle Licence Query
Hi,
I have an application to be migrated from Country to a Global DC. The application runs on Oracle 10.2g and both Oracle and Application are on the same server. We need to migrate this application to a new server in GDC and vendor informed that he would re-install the app and setup Oracle. There are 7 Oracle DB's on the current server and vendor say they provided licence for only 1 Oracle DB. Nobody know from where the licence for other 6 DB's were procured.
Question: Is there a way to find out licence number for other 6 Oracle DB from the server itself? On the server along with lincece number can we find who the provider was..? Whether the app Vendor or Oracle directly?
We are unable to proceed with Migration until this info is not received.
Any info on this is highly appreciated
Regards
Nitin
First, let's get the usual dire warning about licensing and internet advice out of the way: Licensing issues are best confirmed by Oracle sales representatives.
One licenses a database server and not individual instances. There are two types of licenses: NUPP (named user) and PP (processor).
If the server was licensed for x number of users spread between the 6 databases and your new database would add another y new and distinct users you would need to purchase an additional y units of NUPP licenses. However if your database server has a processor license, there is no additional licensing required, however many database instances you cram into the server. This is for physical servers - for virtualized hosts this issue gets a little murky.
Now on the question of license number, there is nothing in the database that will tell you that. If the license is registered to the vendor then only they will have the information you want.
Similar Messages
-
Oracle Text query: Escaping characters and specifying progression sequences
How can I combine the escaping of a search string and the specification of progression sequences within an oracle text query
so that in all cases the correct results are delivered (see example below)?
The scenario in which to use this is the following:
+ Database: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0
+ Requirement: Hitlist of results ordered by score whereby the different part within
the result list are specified using progression sequences within oracle text query
Example:
create table service_provider (
id number,
name_c varchar(100),
uri_c varchar(255)
insert into service_provider values (1,'ABB Company Mgmt','http://www.abb-company-mgmt.de');
insert into service_provider values (2,'Dr. Abbas Ming','http://www.dr-abbas-ming.de');
insert into service_provider values (3,'SABBATA United','http://www.sabbata-united.de');
insert into service_provider values (4,'ABB','http://www.abb.de');
insert into service_provider values (5,'AND Company Mgmt','http://www.and-company-mgmt.de');
insert into service_provider values (6,'Dr. Andas Ming','http://www.dr-andas-ming.de');
insert into service_provider values (7,'SANDATA United','http://www.sandata-united.de');
insert into service_provider values (8,'AND','http://www.and.de');
Query 1: works correctly in this case
select * from (
select /*+ FIRST_ROWS */ score(1), this_.*
from service_provider this_
where
CONTAINS ( this_.NAME_C , '<QUERY><textquery grammar="CONTEXT">' ||
'<progression>' ||
'<seq>abb</seq>' ||
'<seq>abb%</seq>' ||
'<seq>%abb%</seq>' ||
'<seq>fuzzy(abb,1,100,WEIGHT)</seq>' ||
'</progression></textquery></QUERY>', 1 ) > 0
order by score(1) desc, this_.NAME_C
) where rownum < 21
delivers
76 4 ABB http://www.abb.de
76 1 ABB Company Mgmt http://www.abb-company-mgmt.de
51 2 Dr. Abbas Ming http://www.dr-abbas-ming.de
26 3 SABBATA United http://www.sabbata-united.de
Query 2: procudes error
select * from (
select /*+ FIRST_ROWS */ score(1), this_.*
from service_provider this_
where
CONTAINS ( this_.NAME_C , '<QUERY><textquery grammar="CONTEXT">' ||
'<progression>' ||
'<seq>and</seq>' ||
'<seq>and%</seq>' ||
'<seq>%and%</seq>' ||
'<seq>fuzzy(and,1,100,WEIGHT)</seq>' ||
'</progression></textquery></QUERY>', 1 ) > 0
order by score(1) desc, this_.NAME_C
) where rownum < 21
produces ORA-29902, ORA-20000, DRG-50901 because AND is a reserved word in oracle text
So we need escaping ...
Query 3: does not work correctly
select * from (
select /*+ FIRST_ROWS */ score(1), this_.*
from service_provider this_
where
CONTAINS ( this_.NAME_C , '<QUERY><textquery grammar="CONTEXT">' ||
'<progression>' ||
'<seq>{abb}</seq>' ||
'<seq>{abb%}</seq>' ||
'<seq>{%abb%}</seq>' ||
'<seq>fuzzy({abb},1,100,WEIGHT)</seq>' ||
'</progression></textquery></QUERY>', 1 ) > 0
order by score(1) desc, this_.NAME_C
) where rownum < 21
delivers
76 4 ABB http://www.abb.de
76 1 ABB Company Mgmt http://www.abb-company-mgmt.de
Query 4: does not produce an error, but also does not work correctly
select * from (
select /*+ FIRST_ROWS */ score(1), this_.*
from service_provider this_
where
CONTAINS ( this_.NAME_C , '<QUERY><textquery grammar="CONTEXT">' ||
'<progression>' ||
'<seq>{and}</seq>' ||
'<seq>{and%}</seq>' ||
'<seq>{%and%}</seq>' ||
'<seq>fuzzy({and},1,100,WEIGHT)</seq>' ||
'</progression></textquery></QUERY>', 1 ) > 0
order by score(1) desc, this_.NAME_C
) where rownum < 21
delivers
76 8 AND http://www.and.de
76 5 AND Company Mgmt http://www.and-company-mgmt.deAnywhere that you just use the word by itself, enclose it in {}, but anywhere that you add % on either side or both don't enclose it in {}. Please see the demonstration below.
SCOTT@10gXE> SELECT * FROM v$version
2 /
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SCOTT@10gXE> create table service_provider
2 (id number,
3 name_c varchar(100),
4 uri_c varchar(255))
5 /
Table created.
SCOTT@10gXE> insert all
2 into service_provider values (1,'ABB Company Mgmt','http://www.abb-company-mgmt.de')
3 into service_provider values (2,'Dr. Abbas Ming','http://www.dr-abbas-ming.de')
4 into service_provider values (3,'SABBATA United','http://www.sabbata-united.de')
5 into service_provider values (4,'ABB','http://www.abb.de')
6 into service_provider values (5,'AND Company Mgmt','http://www.and-company-mgmt.de')
7 into service_provider values (6,'Dr. Andas Ming','http://www.dr-andas-ming.de')
8 into service_provider values (7,'SANDATA United','http://www.sandata-united.de')
9 into service_provider values (8,'AND','http://www.and.de')
10 into service_provider values (9,'EBB','fuzzy test')
11 into service_provider values (10,'OND','fuzzy test')
12 select * from dual
13 /
10 rows created.
SCOTT@10gXE> CREATE INDEX your_index
2 ON service_provider (name_c)
3 INDEXTYPE IS CTXSYS.CONTEXT
4 PARAMETERS ('STOPLIST CTXSYS.EMPTY_STOPLIST')
5 /
Index created.
SCOTT@10gXE> VARIABLE search_string VARCHAR2 (100)
SCOTT@10gXE> EXEC :search_string := 'abb'
PL/SQL procedure successfully completed.
SCOTT@10gXE> COLUMN name_c FORMAT A20 WORD_WRAPPED
SCOTT@10gXE> COLUMN uri_c FORMAT A40
SCOTT@10gXE> select *
2 from (select /*+ FIRST_ROWS */ score(1), this_.*
3 from service_provider this_
4 where CONTAINS
5 (this_.NAME_C ,
6 '<QUERY>
7 <textquery grammar="CONTEXT">
8 <progression>
9 <seq>{' || :search_string || '}</seq>
10 <seq>' || :search_string || '%</seq>
11 <seq>%' || :search_string || '%</seq>
12 <seq>fuzzy({' || :search_string || '},1,100,WEIGHT)</seq>
13 </progression>
14 </textquery>
15 </QUERY>', 1 ) > 0
16 order by score(1) desc, this_.NAME_C)
17 where rownum < 21
18 /
SCORE(1) ID NAME_C URI_C
76 4 ABB http://www.abb.de
76 1 ABB Company Mgmt http://www.abb-company-mgmt.de
51 2 Dr. Abbas Ming http://www.dr-abbas-ming.de
26 3 SABBATA United http://www.sabbata-united.de
4 9 EBB fuzzy test
SCOTT@10gXE> EXEC :search_string := 'and'
PL/SQL procedure successfully completed.
SCOTT@10gXE> /
SCORE(1) ID NAME_C URI_C
76 8 AND http://www.and.de
76 5 AND Company Mgmt http://www.and-company-mgmt.de
51 6 Dr. Andas Ming http://www.dr-andas-ming.de
26 7 SANDATA United http://www.sandata-united.de
5 10 OND fuzzy test
SCOTT@10gXE> -
Converting Oracle XML Query Result in Java String by using XSU
Hi,
I have a problem by converting Oracle XML Query Result in Java
String by using XSU. I use XSU for Java.
For example:
String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
preise ps where match='"+args[0]+"'");
String datum1=datum;
I become the following error:
Prototyp.java:47: Incompatible type for declaration. Can't
convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
Can somebody tell me a method() for converting to solve my
problem??????
ThanksHmmm.. Pretty basic just look at the example:
OracleXMLQuery qry = new OracleXMLQuery(conn,"Select max(ps.datum) from preise ps where match='"+args[0]+"'");
String xmlString = qry.getXMLString();
Hi,
I have a problem by converting Oracle XML Query Result in Java
String by using XSU. I use XSU for Java.
For example:
String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
preise ps where match='"+args[0]+"'");
String datum1=datum;
I become the following error:
Prototyp.java:47: Incompatible type for declaration. Can't
convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
Can somebody tell me a method() for converting to solve my
problem??????
Thanks -
Hi,
I have a View object with various attributes (eg, name1, name2, name3, address1, address2, address3 etc). A query/table component based on this view object works just fine. However, I wish to replace name1, name2, name3 and other attributes in the query with just 'name'. These attributes are still to be shown in the result table. This new 'name' attribute will be used in an Oracle Text query clause, instead of individual searches on each attribute.
My plan was to simply make the various name1, name2 etc attributes non-'queryable' in the View def to hide them from the query. Then I'd add a transient 'name' attribute. My hope was, that I could override the getWhereClause() in the ViewObjectImpl and simply tack on the oracle text clause to the WHERE (example below):
WHERE CONTAINS (
SOMECOLUMN,
'<query>
<textquery lang="ENGLISH" grammar="CONTEXT">TRANSIENT_ATTR_VALUE
..... Oracle Text query grammar stuff here .... </query>') > 0How do I access the transient value in the ViewObjectImpl to add the above SQL? Or am I going about this in completely the wrong way?
thanks,
Barry.Based on what I found in
http://www.oracle.com/technology/oramag/oracle/09-nov/o69frame.html?_template=/ocom/print
and
http://blogs.oracle.com/smuenchadf/examples/
136. Introducing a Checkbox to Toggle a Custom SQL Predicate on an LOV's Search Form. [11.1.1.0.0] 19-NOV-2008
I have the following implementation, which seems to work. Does anyone see any problems with this?
With regard to SQL injection, does ViewCriteriaItem sanitise the 'val' from the query, or should I do that manually here myself?
@Override
public java.lang.String getCriteriaItemClause(ViewCriteriaItem vci) {
if ("OraTextTransientAttrib".equals(vci.getAttributeDef().getName())) {
if (vci.getViewCriteria().isCriteriaForQuery()) {
String val = (String)vci.getValue();
logger.debug("Doing oracle text name search on '" + val + "'");
// simplified version of my oracle text query
return "CONTAINS ('<query>..... " + val + "....</query>') > 0 ";
} else {
// SQL predicate for no changes to the results
// spaces needed if you have several of these blocks
return " 1=1 ";
// other blocks for other similar oracle text attribs
return super.getCriteriaItemClause(vci);
} -
How many Oracle Licences required ?
Hi,
Can somebody help me in understanding the number of oracle licences required for the following server specifications :-
Server is SUN V890 4x UltraSparc IV DualCore running Solaris 9.
Please be elaborative , as I need to understand and learn, how is it being calculated.
Regards
SumitIf you go to http://store.oracle.com, choose your country, and then choose Licensing Definitions you will see text along the lines of
sumitsingh3 wrote:
Processor: shall be defined as all processors where the Oracle programs are installed and/or running. Programs licensed on a processor basis may be accessed by your internal users (including agents and contractors) and by your third party users. For the purpose of counting the number of processors which require licensing for a Sun UltraSPARC T1 processor with 4, 6 or 8 cores at 1.0 gigahertz or 8 cores at 1.2 gigahertz for only those servers specified on the Sun Server Table which can be accessed at http://oracle.com/contracts , “n” cores shall be determined by multiplying the total number of cores by a factor of .25. For the purposes of counting the number of processors which require licensing for AMD and Intel multicore chips, “n” cores shall be determined by multiplying the total number of cores by a factor of .50. For the purposes of counting the number of processors which require licensing for all hardware platforms not otherwise specified in this section, a multicore chip with "n" cores shall be determined by multiplying "n" cores by a factor of .75. All cores on all multicore chips for each licensed program for each factor listed below are to be aggregated before multiplying by the appropriate factor and all fractions of a number are to be rounded up to the next whole number. When licensing Oracle programs with Standard Edition One or Standard Edition in the product name, a processor is counted equivalent to a socket.
If you follow the link again and get to the Sun Server table, I don't see a V890 listed. I also don't believe the V890 is using the UltraSPARC T1 processor, so you would end up using the 0.75 multiplier rather than the 0.25 multiplier.
Given that,
4 sockets * 2 cores per socket * 0.75 = 8 * 0.75 = 6 processors
Justin -
Hello
Maybe not the best section ..
But we have in mind changing existing Oracle licences on all existing systems (ECC;CRM;PI,BI) with HANNA(and use HANNA DB)..
I wander what would be pro and what cons?
Thank you a lot
JanHi Jan,
If I understand correctly you are going to perform database migration activity in your present landscape. Firstly you have to contact SAP as well as one of the third party hardware vendor (who is going to provide certified HANA hardware). SAP will provide you all the license details.
For whole your migration activity below link will be helpful:-
SAP BW on HANA Cookbook
Migration to HANA made easy with DMO
Regards,
Rafikul -
Hi,
We have oracle 8i on TRU64 CLUSTER(active/passive) with 4 cpu on each machine.
As its active/passive cluster only one machine will be active at a time.
What should be the oracle licence policy on this kind of environment.
Do we have to pay for licence of both the machine or only one.
Thanks in advanceYes, in fact, Oracle trusts the Customer will install and use the software according to the Oracle License Agreement. It is easier for both parties. If ever Oracle finds software misuse on the customer's side, the oracle representative may invite the customer to regularize the software or Oracle can sue the customer and most probably Oracle will win the trial. As you can see, you can download and install whatever you want, Oracle software is in no way protected like other software, but it doesn't mean this software is free and you can only install what you are entitled to, As previously stated this is only for your records.
~ Madrid -
Oracle 9i query in Oracle 8 (Running Total)
Please tell me the alternate SQL for Oracle 8 against this query which is written in Oracle 9i:
SELECT empid,empname,empgpay,sum(empgpay) over (order by empid) AS runningtotal
FROM employee;There is not a sql structure in Oracle8i to do that directly in SQL Statement. You have to create a program unit to carry out it.
Joel P�rez -
User Function Name wrong resultset in Oracle Apps Query
Hi,
I am using the below query to extarct the user function names alonng with responsilibity .But doing so i am getting a User Function Name for eg 'Cross Validation Rules' under Order Management User.But thats wrong.Cross validation rules should exists in Receivables,GL and Payables.
select distinct frv.menu_id, frv.responsibility_id, frv.responsibility_name, fff.function_name, ffft.user_function_name
from
fnd_responsibility_vl frv,
fnd_responsibility frp,
fnd_form_functions fff,
fnd_form_functions_tl ffft,
fnd_resp_functions resp,
fnd_menu_entries mnu,
fnd_menus fmn
where
fff.function_id = ffft.function_id
and mnu.menu_id=frp.menu_id
and mnu.menu_id=fmn.menu_id
and frv.responsibility_id=resp.responsibility_id
and mnu.function_id=ffft.function_id
and resp.rule_type='M'
and frv.menu_id in (select me.menu_id
from fnd_menu_entries me
start with me.function_id = fff.function_id
connect by prior me.menu_id = me.sub_menu_id )
and (frv.responsibility_name like '%Order%')
order by 1
Kindly any help will be helpful for meWhat is your application release?
I am using the below query to extarct the user function names alonng with responsilibity .But doing so i am getting a User Function Name for eg 'Cross Validation Rules' under Order Management User.But thats wrong.Cross validation rules should exists in Receivables,GL and Payables.Please try the queries in these docs.
Script To Extract Submenu And Function Information About A Menu [ID 458701.1]
HOW TO GENERATE MENU TREE FOR A MENU ATTACHED TO A RESPONSIBILITY IN ORACLE APPLICATIONS 11i ? [ID 312014.1]
Thanks,
Hussein -
View links in oracle ADF/query featching from Database
Please any one help for this query
I have two tables Emp, Dept
I have query like this select * from Emp e, Dept d where e.deptno=d.deptno
Query is fetching like this
Empno Ename job Salary Comm deptno deptno dname Loc
15 i1 support 50000 11 5 5 IT sss
15 i1 support 50000 11 3 3 Account sss
16 i2 support 8000 10 5 5 IT sss
16 i2 support 8000 10 3 3 Account sss
16 i2 support 8000 10 3 3 Software sss
16 i2 support 8000 10 4 4 Operation sss
Query is fetching 6 rows.
but my requirement is what ever records fetching from database with same employee number is one record that is same employee number dept names grouped I will show it as one record how to fetch records from data base.
Here is the example (My Requirement):
This is first row:
Empno Ename job Salary Comm
15 i1 support 50000 11
Deptno dname Loc
5 IT sss
3 Account sss
This is second row:
Empno ename job Salary Comm
16 i2 support 8000 10
Deptno dname Loc
5 IT sss
3 Account sss
2 Software sss
4 Operation sss
i am useing oracle ADF if any possibility in view links either i get from the query as i mentioned.
plz any one can help
thanksPlease any one help for this query
I have two tables Emp, Dept
I have query like this select * from Emp e, Dept d where e.deptno=d.deptno
Query is fetching like this
Empno Ename job Salary Comm deptno deptno dname Loc
15 i1 support 50000 11 5 5 IT sss
15 i1 support 50000 11 3 3 Account sss
16 i2 support 8000 10 5 5 IT sss
16 i2 support 8000 10 3 3 Account sss
16 i2 support 8000 10 3 3 Software sss
16 i2 support 8000 10 4 4 Operation sss
Query is fetching 6 rows.
but my requirement is what ever records fetching from database with same employee number is one record that is same employee number dept names grouped I will show it as one record how to fetch records from data base.
Here is the example (My Requirement):
This is first row:
Empno Ename job Salary Comm
15 i1 support 50000 11
Deptno dname Loc
5 IT sss
3 Account sss
This is second row:
Empno ename job Salary Comm
16 i2 support 8000 10
Deptno dname Loc
5 IT sss
3 Account sss
2 Software sss
4 Operation sss
i am useing oracle ADF if any possibility in view links either i get from the query as i mentioned.
plz any one can help
thanks -
Conversion of Mysql query in oracle acceptable query format
Hi
I have successfully converted my MySql database in oracle. Now the problem is how to execute already written hundreds of Mysql query on the oracle. There are many syntax variation in Mysql query format which is not acceptable for oracle.
For Example
Select case_id as 'this is alias' from cases
The above query can run on Mysql database but have problem while executing Oracle, because single quotes should be replaced with double quotes before executing it on oracle. There are also many other syntax conflicts.
I have tried to resolve the problem through SwisSQLAPI but problem still exist as SwisSQLAPI is not dealing with all syntax conflict. In my case (select if (expresion, true,false)) must be replace with decode (expression, value,true,false) function of oracle and this conversion is not supported by SwisSQLAPI.
Please help me in resolving this problem
ThanksThe problem with trying to port from one language (mysql SQL) to another (oracle SQL) is that there's generally no hard rules for a computer to follow, that it will get it 100% correct.
Look at babelfish when you translate a foreign language to English. The end result is readable (usually), but it's rarely completely correct.
The problem is when you feed something into Oracle SQL, it needs to be 100% correct.
All you can really do here is rewrite these queries. It shouldn't actually take as long as you think, because 50% of queries will generally need very minor changes you can do in a minute, and 25% won't need any changes at all. -
Check Index used in an oracle select query
Hi Friends,
I have partitioned an oracle table and created Local Index for the Partitioned table .
Now i want to make sure that the Local index is being used when i perform select query on the Table partition.
How do i confirm that ?
can i check the explain plan generted for the select query to confirm local index is being used ?
Please let me know.
Regards,
DBNow i want to make sure that the Local index is being used when i perform select query on the Table partition.Why? Have you proven that using this local index is the "best" plan?
How do i confirm that ?
can i check the explain plan generted for the select query to confirm local index is being used ?When I asked Google "how to read an oracle explain plan," I found lots of information - what did you find? -
How to generate XML file from oracle database query result
Hi dudes,
as stated on the subject, can anyone suggests me how can i achieve the task stated above??
Here is a brief description of my problem:
I need to create a XML file once i query from the oracle database, and the query result returned from the database will be stored in XML file.
I'd searched around the JAXB, DOM, SAXP and the like basic concepts, but i still don't know how to start??
Any suggestions ???Read this:
http://www.cafeconleche.org/books/xmljava/chapters/ch08s05.html
You might have to read more of the book to understand that chapter. -
Hi all....
I am using oracle 10g........
The following query is a union of two queries....The second query is a subset of the first meaning that it has fewer tables and fewer select columns as well....(I have to use union on the two queries....for a gud reason) .What i want is that the union return only the superset records from result of the union of the two queries when i pass a parameter at runtime like supplier_name as mentioned in the the query below .......
/* Formatted on 2012/05/14 16:49 (Formatter Plus v4.8.8) */
SELECT * FROM(SELECT DISTINCT reql.unit_meas_lookup_code "UNIT",
reqh.type_lookup_code "PR_TYPE",
reql.document_type_code "SUBTYPE",
reqh.segment1 "PR_NO", reqh.creation_date "PR DATE",
mtb.segment1 "ITEM_CODE",
pol.item_description "DESCRIPTION",
mcb.segment1 "INVENTORY_CATEGORY",
reql.manufacturer_part_number "MFG NO/DRG NO",
poh.authorization_status "AUTHORIZATION STATUS",
papf.full_name "BUYER", NULL "CUSTOMER",
DECODE (poh.type_lookup_code,
'RFQ', poh.segment1
) "RFQ NO",
DECODE (poh.type_lookup_code,
'RFQ', poh.creation_date
) "RFQ DATE",
NULL "RFQ SUPPLIER",
DECODE (poh.type_lookup_code,
'QUOTATION', poh.segment1
) "QTN NO",
DECODE (poh.type_lookup_code,
'QUOTATION', poh.reply_date
) "QTN DATE",
DECODE (poh.type_lookup_code,
'STANDARD', poh.segment1,
'BLANKET', poh.segment1,
'PLANNED', poh.segment1
) "PO_NO",
DECODE (poh.type_lookup_code,
'STANDARD', poh.creation_date,
'BLANKET', poh.creation_date,
'PLANNED', poh.creation_date
) "PO DATE",
pv.vendor_name "SUPPLIER",
NULL "SUPPLIER ACKNOWLEDGMENT DATE",
TRUNC
(reqh.creation_date
- TRUNC (poh.creation_date)
"NO OF DAYS TAKEN FROM PR TO PO",
DECODE (rcvh.asn_type,
'ASBN', rcvh.shipment_num
) "ASBN NO",
rcvh.receipt_num "RECEIPT NO",
rcvh.creation_date "RECEIPT DATE",
apia.invoice_num "INVOICE_NO",
NULL "QUALITY INSPECTION DATE",
rcvt.inspection_status_code "INSPECTION RESULT",
NULL "STOCKING DATE",
TRUNC (poh.creation_date)
- TRUNC (reqh.creation_date) "NO OF DAYS TAKEN FROM",
NULL "PV NO", NULL "PV DATE",
apc.amount "PAYMENT RELEASE AMOUNT",
apc.released_date "PAYMENT RELEASE DATE",
apc.payment_method_code "PAYMENT RELEASE MODE",
NULL "NO OF DAYS TAKEN FROM RECEIPT"
FROM po_requisition_headers_all reqh,
po_requisition_lines_all reql,
po_req_distributions_all reqd,
po_distributions_all pod,
po_headers_all poh,
po_lines_all pol,
po_line_locations_all poll,
rcv_shipment_headers rcvh,
rcv_shipment_lines rcvl,
rcv_transactions rcvt,
ap_invoice_distributions_all apid,
ap_invoices_all apia,
ap_payment_schedules_all aps,
ap_invoice_payments_all app,
ap_checks_all apc,
per_all_people_f papf,
po_vendors pv,
mtl_system_items_b mtb,
mtl_categories_b mcb,
mtl_item_categories mic
WHERE reqh.requisition_header_id =
reql.requisition_header_id
AND reql.requisition_line_id = reqd.requisition_line_id
AND pod.req_distribution_id = reqd.distribution_id
AND pol.po_line_id = pod.po_line_id
AND poh.po_header_id = pol.po_header_id
AND pol.po_line_id = poll.po_line_id
AND pod.po_distribution_id = apid.po_distribution_id
AND pod.po_distribution_id = rcvt.po_distribution_id
AND rcvl.shipment_header_id = rcvh.shipment_header_id
AND rcvh.shipment_header_id = rcvt.shipment_header_id
AND rcvt.po_distribution_id = apid.po_distribution_id
AND app.check_id = apc.check_id
AND apid.invoice_id = apia.invoice_id
AND apia.invoice_id = app.invoice_id
AND app.invoice_id = aps.invoice_id
AND poh.agent_id = papf.person_id
AND poh.vendor_id = pv.vendor_id
AND pol.item_id = mtb.inventory_item_id
AND mic.inventory_item_id = pol.item_id
AND poh.authorization_status = 'APPROVED'
AND mcb.category_id = mic.category_id
UNION
SELECT DISTINCT NULL "UNIT", NULL "PR_TYPE", NULL "SUBTYPE",
NULL "PR_NO", NULL "PR DATE",
mtb.segment1 "ITEM_CODE",
pol.item_description "DESCRIPTION",
mcb.segment1 "INVENTORY_CATEGORY", NULL,
poh.authorization_status "AUTHORIZATION STATUS",
papf.full_name "BUYER", NULL "CUSTOMER",
DECODE (poh.type_lookup_code,
'RFQ', poh.segment1
) "RFQ NO",
DECODE (poh.type_lookup_code,
'RFQ', poh.creation_date
) "RFQ DATE",
NULL "RFQ SUPPLIER",
DECODE (poh.type_lookup_code,
'QUOTATION', poh.segment1
) "QTN NO",
DECODE (poh.type_lookup_code,
'QUOTATION', poh.reply_date
) "QTN DATE",
DECODE (poh.type_lookup_code,
'STANDARD', poh.segment1,
'BLANKET', poh.segment1,
'PLANNED', poh.segment1
) "PO_NO",
DECODE (poh.type_lookup_code,
'STANDARD', poh.creation_date,
'BLANKET', poh.creation_date,
'PLANNED', poh.creation_date
) "PO DATE",
pv.vendor_name "SUPPLIER",
NULL "SUPPLIER ACKNOWLEDGMENT DATE", NULL,
DECODE (rcvh.asn_type,
'ASBN', rcvh.shipment_num
) "ASBN NO",
rcvh.receipt_num "RECEIPT NO",
rcvh.creation_date "RECEIPT DATE",
apia.invoice_num "INVOICE_NO",
NULL "QUALITY INSPECTION DATE",
rcvt.inspection_status_code "INSPECTION RESULT",
NULL "STOCKING DATE", NULL, NULL "PV NO",
NULL "PV DATE", apc.amount "PAYMENT RELEASE AMOUNT",
apc.released_date "PAYMENT RELEASE DATE",
apc.payment_method_code "PAYMENT RELEASE MODE",
NULL "NO OF DAYS TAKEN FROM RECEIPT"
FROM po_distributions_all pod,
po_headers_all poh,
po_lines_all pol,
rcv_shipment_headers rcvh,
rcv_shipment_lines rcvl,
rcv_transactions rcvt,
ap_invoice_distributions_all apid,
ap_invoices_all apia,
ap_payment_schedules_all aps,
ap_invoice_payments_all app,
ap_checks_all apc,
per_all_people_f papf,
po_vendors pv,
mtl_system_items_b mtb,
mtl_categories_b mcb,
mtl_item_categories mic
WHERE pol.po_line_id = pod.po_line_id
AND poh.po_header_id = pol.po_header_id
AND pod.po_distribution_id = apid.po_distribution_id
AND pod.po_distribution_id = rcvt.po_distribution_id
AND rcvl.shipment_header_id = rcvh.shipment_header_id
AND rcvh.shipment_header_id = rcvt.shipment_header_id
AND rcvt.po_distribution_id = apid.po_distribution_id
AND app.check_id = apc.check_id
AND apid.invoice_id = apia.invoice_id
AND apia.invoice_id = app.invoice_id
AND app.invoice_id = aps.invoice_id
AND poh.agent_id = papf.person_id
AND poh.vendor_id = pv.vendor_id
AND pol.item_id = mtb.inventory_item_id
AND mic.inventory_item_id = pol.item_id
AND poh.authorization_status = 'APPROVED'
AND mcb.category_id = mic.category_id) a
WHERE 1 = 1
AND ( a.pr_type = NVL (:pr_type, a.pr_type)
OR (:pr_type IS NULL AND a.pr_type IS NULL)
AND ( a.pr_no = NVL (:pr_no, a.pr_no)
OR (:pr_no IS NULL AND a.pr_no IS NULL)
AND ( a.unit = NVL (:unit_lookup_code, a.unit)
OR (:unit_lookup_code IS NULL AND a.unit IS NULL)
AND a.supplier = NVL (:supplier_name, a.supplier)
AND a.inventory_category = NVL (:inventory_category, a.inventory_category)
AND a.buyer = NVL (:buyer_name, a.buyer)
AND a.invoice_no = NVL (:invoice_no, a.invoice_no)
AND a.item_code = NVL (:item_code, a.item_code)
Edited by: Dave on May 14, 2012 5:08 AM
Edited by: Dave on May 14, 2012 5:14 AMDave wrote:
What i want is that the union return only the superset records from result of the union of the two queriesThat is what Union does.
If it doesn't, then it means it's not real duplicates.
For example :Scott@my11g SQL>with
2 table_A(val) as (
3 select 'This is a duplicate' from dual
4 union all select 'This is another' from dual
5 union all select 'This is not' from dual
6 )
7 ,table_B(val) as (
8 select 'This is a duplicate' from dual
9 union all select 'This is another' from dual
10 )
11 ------ end of sample data ------
12 select val from table_A
13 union
14 select val from table_B ;
Scott@my11g SQL>/
VAL
This is a duplicate
This is another
This is notSee ? only 3 rows from the 5 (3+2) originals.
But if I add some pseudo columns Which_table with different values for each table, then :Scott@my11g SQL>with
2 table_A(val) as (
3 select 'This is a duplicate' from dual
4 union all select 'This is another' from dual
5 union all select 'This is not' from dual
6 )
7 ,table_B(val) as (
8 select 'This is a duplicate' from dual
9 union all select 'This is another' from dual
10 )
11 ------ end of sample data ------
12 select val, 'from table_A' which_table from table_A
13 union
14 select val, 'from table_B' from table_B ;
VAL WHICH_TABLE
This is a duplicate from table_A
This is a duplicate from table_B
This is another from table_A
This is another from table_B
This is not from table_AThere is now 5 rows, they are no longer duplicates. -
Clarification on using function in where clause of oracle sql query
I have an issue in regarding function using where clause of sql query..
We are facing performance issue while executing query, so in what ways to improve the performance of the query which i have posted below.
select col ,case when my_function(parameter)
from tab1 a ,tab2 b,tabl3 c
where a.column1=b.column2
and b.column3 =c.column6
and my_function(parameter)>0
Regards
Dinesh
Edited by: wild fire on May 18, 2012 4:15 PMDinesh,
remind that when you use a function in the where clause it normally will get started for each record in the table.
So your answer is two-fold:
1. make the function only start when needed by adding a function based index on the table (this will make inserts and updates slower)
2. make the function faster by adding the DETERMINISTIC clause if possible. this will make Oracle "cache" the result of the function.
Regards,
Richard
blog: http://blog.warp11.nl
twitter: @rhjmartens
If this question is answered, please mark the thread as closed and assign points where earned..
Maybe you are looking for
-
I am sick of dealing with this issue. I wish not that I had never even started using any Apple products, beginning with iTunes. WHEN IS APPLE GOING TO ADDRESS THIS ISSUE AND MAKE ITUNES SOMEHOW COMPATIBLE WITH DEP IN WINDOWS VISTA? That being said,
-
Creating a new Event in event structure
Hi Can i create any event on my own in the event structures? For instance, one can always find the key down and key up events in the structures!! But what if i want to create a new event such as add/remove hardware in it? Is it possible? Somil Gautam
-
Time Machine will not back up. I get this error message: "/Volumes/Data/MacBook Pro.sparsebundle" could not be accessed (error -1).
-
Excel 2013 save as JPG/PNG graphic format?
Dear All, For Excel 2013, is it possibe to save the sheet in JPG or PNG graphic file?
-
i am trying to unlock my son's computer that we bought from a school supply store. one of my kids changed the administrator user name but they can't remember what the changed it to. the computer is stuck on the login in screen and the password is bla