Oracle Metalink Query
We are final students of Goa Engg College in India who are currently doing a project in OLAP. We require to use the JAVA OLAP API for the Oracle9i for Win NT/2000/XP database. However We get certain connection errors when we try to get the root
schema. We came to know from OTN that this was an error due to Windows NT/2000/XP memory management errors and that there is apatch available for this at Metalink. Since the Oracle distribution belongs to the institution the institution tried to register at Metalink but could not find their CSI.
Can u help us in this matter? Can the patch be mailed thru email? If yes: pls mail the patch at following addresses:
[email protected]
[email protected]
Thanx in advance
-Prahalad
Hi Taher,
Please take a backup of the AR_INVOICE_UTILS package code, then run the following scripts (under $AR_TOP/patch/115/sql) to recreate this package:
ARXVINUB.pls
ARXVINUS.pls
Verify the status of the package then, if it is valid please see if you still get the same error or not.
Thanks,
Hussein
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);
} -
Configure Oracle Metalink Credentials from Home page of DB console
OS:SuSE Linux Enterprise Server 8.
I have installed Oracle Enterprise Manager 10g (Oracle DB version: 10.1.0.2.0)
Now I'd like to configure Oracle Metalink Credentials from home page of console.
Because we have proxy settings I need to configure proxy setting or
My information security folk ask me to provide ip address & port number of http:\\updates.oracle.com.
The IP address of this site is 148.87.36.12.
What is the port no for this site?
Does any one resolve this issue?
Regards,
DHello,
proxy settings can be different. Our proxy server allows an open access the to interner, in principle you can reach every external website, although it is not allowed to surf just for fun. It seems at your site the opposite is true, websites you want to reach must be allowed explicitly. Therefore your security staff needs the IP adress, obviously it must be known to the proxy server.
There could arise another issue, in fact we have this problem. As just mentioned, our proxy server isn't restricted to certain websites,but password protected. You need to login before you can go to the internet. This isn't yet supported by oracle, so for this very internet access we had to raise this restriction, but the proxy server itself is still used. Orace says, 10g Release 2 will support such a configuration.
Werner -
Oracle MetaLink authorization failed.
In our Environment (GC Version 10.2.0.3 on Linux ), we are using Proxy to connect to Internet and our GC server is behind the Firewall. When I try to enter the metalink user name and Password in "Metalink and Patching settings" tab, getting the below error.
"Oracle MetaLink authorization failed. - Check the spelling of your username and retype the password, making sure that caps lock is off"
But username and pwd are correct. Could any one pelase help me on this issue?
With best regards
ShanHi. i have the same problems with my dbconsole on every server.
it seems to be a certficate error! but we have no solution to this failure;
you can debug this from your system (for example Solaris10):
wget -v http-user=METALINKUSER http-passwd=PASSWORD 119255-01 verbose debug save-headers server-response https://getupdates.oracle.com/readme/119255-01 -O 119255-01.readme
... you get:
CONNECT getupdates.oracle.com:443 HTTP/1.0
User-Agent: Wget/1.12 (solaris2.10)
---request end---
proxy responded with: [HTTP/1.0 200 Connection established
Initiating SSL handshake.
Handshake successful; connected socket 4 to SSL handle 0x00095ba0
certificate:
subject: /C=US/ST=California/L=Redwood Shores/O=Oracle Corporation/OU=Global I
T/OU=Terms of use at www.verisign.com/rpa (c)10/CN=*.oracle.com
issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International
Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97
VeriSign
ERROR: cannot verify getupdates.oracle.com's certificate, issued by `/O=VeriSign
Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/O
U=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign':
Unable to locally verify the issuer's authority.
To connect to getupdates.oracle.com insecurely, use `--no-check-certificate'.
Closed 4/SSL 0x00095ba0
After Download getupdates.pem:
wget -v http-user=METALINKUSER http-passwd= PASSWORD ca-certificate=getupdates.pem 119255-01 verbose debug save-headers --server-response https://getupdates.oracle.com/readme/119255-01 -O 119255-01.readme
you get:
Initiating SSL handshake.
Handshake successful; connected socket 4 to SSL handle 0x00095e30
certificate:
subject: /C=US/O=Akamai Technologies, Inc./CN=a248.e.akamai.net
issuer: /C=US/O=GTE Corporation/OU=GTE CyberTrust Solutions, Inc./CN=GTE Cybe
rTrust Global Root
X509 certificate successfully verified and matches host a248.e.akamai.net
---request begin---
GET /f/248/21808/15m/sun.download.akamai.com/21808/patches/patchroot/readme/1192
55-01.README?AuthParam=1291634412_c952739530921a329433b81c1d644b89&TicketId=C1lW
%2BkiJVFA%3D&GroupName=SWUP&FilePath=/21808/patches/patchroot/readme/119255-01.R
EADME&File=119255-01.README HTTP/1.0
User-Agent: Wget/1.12 (solaris2.10)
Accept: */*
Host: a248.e.akamai.net
and you can get the file.
Any ideas? -
Is latest Oracle Metalink UI is ADF or Flex based ??
Anyone having any idea as the latest Oracle Metalink UI is ADF or Flex framework based ??
Why I am asking is as looks really stunning and at its best.ADF Faces based applications can look stunning as well.
Check out these demos:
http://blogs.oracle.com/shay/2009/07/a_better_looking_adf_faces_app.html
and the one showed here:
http://ondemandpreview.vportal.net/media/ondemandpreview/media/inxdata/?=http://altus.edgeboss.net/download/altus/portals/openworld/course_media/2010_09_22_s319184s2_mm/xindata/OracleDevelopKeynoteTedFarrell_s319184s2_ipod_mp4.mp4
And note that all the Fusion applications that were shown at Oracle OpenWorld are also based on ADF Faces. -
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
-
Wifi on Ipad and Iphone won't connect
I have an iphone 4s and an ipad mini, both updated to iOS 7 and they both will not connect to wifi. They will connect when I am at home or at Starbucks etc., but not while I am at school. My phone did connect at school last year, but has not been abl
-
Looking for a Specific product
Hello, I am looking for a specific Desktop PC. Similar to M73 ThinkCenter in size, but needs to have 3-4x HDMI inputs. This computer will run digital menus for restaurants/coffeeshops 24/7. The M73 has display ports but we are looking to move away fr
-
Ipod causes windows XP to crash upon connecting to craddle
I have an ipod that crashes xp every time I connect it to the PC. I have reset the ipod, and have re-installed win xp. I never had this before I updated to new apple itunes. What is going on?
-
JSP can't call applet if the applet class is put WEB-INF/classes in weblogic6.1sp1
Can't the applet be put at the WEB-INF/classes folder? If the applet can put at WEB-INF/classes, where is the plugin's codebase?
-
X/Motif Solaris 6 to Solaris 10
motif patch concerns on solaris 6 to 10. Edited by: gsatish on Feb 19, 2009 1:15 AM