SQL & PL/SQL :: Query Works In 10g But Not In 11g?
Apr 29, 2012
I have the query below that works absolutely fine in Oracle 10g but is not running in Oracle 11g. Couple of things I notices about this query.
1. If I remove the alias 'FACILITY_W_CODE' in the ORDER BY clause, query works fine in 11g. If I replace 'FACILITY_W_CODE' with the actual fields - 'F.SERVICE_AREA || F.DISTRICT_OFFICE || F.DO_GROUP || F.DO_SSC' even then it works fine.
2. If I remove the GROUP BY clause in the inside query but keep the alias 'FACILITY_W_CODE' in the outside ORDER BY clause, the query works fine.
I am not sure where the issue is, GROUP BY or the ALIAS. Also, the alias issue seems to be only where the alias is used for multiple fields.
SELECT F.SERVICE_AREA || F.DISTRICT_OFFICE || F.DO_GROUP || F.DO_SSC FACILITY_W_CODE, PF.FAC_TYPE FACILITY_TYPE, PF.FAC_IDENT LOCATION_IDENTIFIER, P.DISTRICT_CODE USER_W_CODE, P.EMAIL_ADDRESS, PF.CERTIFICATION_AUTHORITY, PF.CALLBACK_TECHNICIAN, PF.CALLBACK_ENVIRONMENTAL
FROM PEOPLE P
JOIN (
SELECT I_PF.ID, I_PF.FAC_TYPE, I_PF.FAC_IDENT,
I have a query similar to the one below which is embedded in a PRO*C program. The query works fine when run in the PRO*C program against a 8i database but fails with an "ORA-02015: cannot select FOR UPDATE from remote table" error when run against a 10g database. The PRO*C program is executing the sql using "EXEC SQL".
QUERY: Select last_name, first_name from Member where .... FOR UPDATE OF LAST_NAME;
The other thing to note is this SQL query works fine via sqlplus in a 10g environment.
ADDITIONAL DETAILS: The above query is selecting data from a base table via a user view VIEW: select * from otherschema.member@connection_identifier;
This view was created in this manner to allow the user account access to the underlaying table without creating explicit permissions.
[CODE] DECLARE D1 DATE:='&D1'; D2 DATE; BEGIN WHILE D1<=D2 LOOP DBMS_OUTPUT.PUT_LINE(TO_CHAR(D1,'DAY DD-MON-YYYY')); D1:=D1+1; END LOOP; END;
Here I want to display all the seven days. One more question is here I'm d1<=d2 but d2 is null. So how does <= works here a null. A null is always null. What will be there in d2 how does the loop works with this comparision.
I am fighting with some code to work in IE7. It is currently working in Firefox.
A little bit more on the context of the situation is that I am entering the code as a personalization on an Oracle Self Service Page. I am entering in as a raw text personalization.
My teacher taught the lesson of DML statemnts, he told us how does merge works , but he did not give us any query for that,provide query for Merge and if possible then explain it too , I am using Oracle 10g Sql Plus.
I want to know how Remap_datafile paramater in IMPDP works in Oracle 10g. give me the whole scenario for two databases. One in Linux Platform and other in Windows platform. I want to import the tablesapce data from Linux to Windows Server database.
this is my coding on save button. this is working fine but only once. when i enter the data second time and try to save, it didn't do anything. what should i do?
I'm trying to create a view that includes both custom and delivered tables. The SQL code produces the desired results in SQL Developer. However, when I create and test the view using that code, I get very different and incorrect results. The SQL part of the view is below:
SELECT j.emplid, pt.deptid, pt.y_policy_id, pt.effdt, pt.title, pt.comments, pt.y_policy_covg, pt.doc_url FROM psoprdefn a , ps_job j , ps_y_policy_tbl pt WHERE substr(a.oprid,1,1) = '0' AND a.emplid = j.emplid AND j.job_indicator = 'P' AND j.effdt = (SELECT MAX(effdt) FROM ps_job WHERE emplid = j.emplid AND empl_rcd = j.empl_rcd AND effdt <= sysdate) [code]....
I have a two node RAC on 11.2.0.3. We are using SCAN Listener here. On my node 1, i can connect to the database using tns alias: The alias looks something like:
sqlplus system/actdbasystem@cusms ----- works sucesfully on the prod server. Even the same prod alias copied to second tnsnames.ora in the cluster and run, it works sucesful too. But the issue is, when we copy the same alias onto any other servers and try to connect give's the following error message:
I have a problem spooling flat files in utf 8. I have 3 different sql that needs to be spooled regulary in utf8 format.the first two containing special chars is spooled without any problem, but the third that is containg only numbers and pipe-s is spooled in ansi format.
i have set nls_lang=.utf8 in my shell script, but that only worked at the first two sql the last doesnt work.
I have also tried to convert file using iconv command, but the output is still in ansi (only works if i put a special char in the ansi file then it converts to utf8 without problem) if i open the file in notepad and save as utf8 then it works, but i cannnot reach the same from unix script.
I am using oracle forms 10g and basically we have a system that takes over 300 photos on a daily basis, this all works fine and with no issues except for say maybe 2-3 photos a month. Occasionally we will get a 'corrupt photo' (it not actually corrupt, it displays in everything as it should except forms) . When we encounter these photos forms just crashes out and the user is unable to query the record with the associated photo until it is deleted and a new one is taken (or alternatively if we take the photo from the database open it in paint.net and just hit save it will then work). There is no difference that we can see in the photo which doesnt work and those that do work. I have tried using WRITE_IMAGE_FILE to save the photo to disk and Read_Image_File to read from the disk to see if that makes a difference. If i save the file as jpeg and no compression it still crashes, if i save it with low compression it works fine but we lose quality which we dont want to lose. Bitmap wont work at all. Saving as JFIF and GIF works fine without any compression but we still lose quality.
The photo will display fine if we use a javabean to display it but in this instance a javabean is not an option.
One weird thing we noticed is that when we are on the form that crashes with these photos and query back a working photo first, and THEN query the 'corrupt photo' the corrupt photo displays fine, but if we go into the form and query a corrupt photo first forms crashes as explained.
I know that there is now an option in the shared components to set the home page/theme for Desktop display as well as for Mobile display. So the app would automatically know what interface should be rendered based on the device running on. Do I need two versions of each app page (just like the login page) in order to have the app work on BOTH desktop and Mobile ? the reason I am asking is that an AEPX page can have one and only one template/theme. So if I have an app (desktop app) of 10 pages , should I replicate those 10 pages and make them mobile pages. If yes then how do I tell the to navigate differently (branch from page to page) based on the used device ?
title varchar2(100) y publisher varchar2(20) y categoryname varchar2(20) y rating varchar2(2) y
my query is, select ROWNUM AS "Rank",title,publisher from (select rating,title,publisher from bookshelf_test order by rating desc ) where ROWNUM <=3
returns result ,
1 1 MY LEDGER KOCH PRESS 2 2 TO KILL A MOCKINGBIRD HARPERCOLLINS 3 3 THE MISMEASURE OF MAN W.W. NORTON
But inner query (select rating,title,publisher from bookshelf_test order by rating desc ) returns,
1 5 WONDERFUL LIFE W.W.NORTON 2 5 THE MISMEASURE OF MAN W.W. NORTON 3 5 TO KILL A MOCKINGBIRD HARPERCOLLINS 4 5 MY LEDGER KOCH PRESS 5 4 TRUMAN SIMON SCHUSTER 6 4 GOSPEL PICADOR 7 4 HARRY POTTER AND THE GOBLET OF FIRE SCHOLASTIC 8 4 INNUMERACY VINTAGE BOOKS 9 4 JOHN ADAMS SIMON SCHUSTER 10 4 JOURNALS OF LEWIS AND CLARK MARINER 11 4 LETTERS AND PAPERS FROM PRISON SCRIBNER 12 4 PREACHING TO HEAD AND HEART ABINGDON PRESS 13 4 THE SHIPPING NEWS SIMON SCHUSTER 14 4 THE GOOD BOOK BARD 15 4 THE DISCOVERERS RANDOM HOUSE 16 3 THE COST OF DISCIPLESHIP TOUCHSTONE 17 3 SHOELESS JOE MARINER 18 3 KIERKEGAARD ANTHOLOGY PRINCETON UNIV PR 19 3 EMMA WHO SAVED MY LIFE ST MARTIN'S PRESS 20 3 EITHER/OR PENGUIN 21 3 CHARLOTTE'S WEB HARPERTROPHY 22 3 BOX SOCIALS MARINER 23 3 ANNE OF GREEN GABLES GRAMMERCY 24 3 WEST WITH THE NIGHT NORTH POINT PRESS 25 3 UNDER THE EYE OF THE CLOCK ARCADE PUB 26 3 TRUMPET OF THE SWAN HARPERCOLLINS 27 2 COMPLETE POEMS OF JOHN KEATS VIKING 28 1 POLAR EXPRESS HOUGHTON MIFFLIN 29 1 GOOD DOG, CARL LITTLE SIMON 30 1 MIDNIGHT MAGIC SCHOLASTIC 31 1 RUNAWAY BUNNY HARPERFESTIVAL
why final queries top 3 rows r different than inner query ?
From Windows, I can successfully create and connect with a system data source using an user Oracle account.But when doing then same configuration process I can not create or connect using the 'SYS' account.
i get the error 'ORA-2009: connection as SYS should be as SYSDBA or SYSOPER'.
What is the solution to creating an ODBC DSN for the user 'SYS'?
When I delete a table in Toad it takes only a one or two second until I receive success message.
But with SQL*Plus on UNIX I canceled the operation after 5 minutes:
$ sqlplus tmo323/IXQMISX8ttr@PROD
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 28 11:54:22 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> delete table_5 2 ; ^Cdelete table_5 * ERROR at line 1: ORA-01013: user requested cancel of current operation
I am trying to generate ddl for a baseline created in Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0. I used to be able to do this in a prior version of oem 10.2.0.4.0. Since the upgrade I am no longer able to view a baseline that has been generated successfully. I can also no longer generate ddl from a baseline capture. There are no errors ... it just seems to time out.
Does parallel hint works in cursor queries? The cursor query is something like :
cursor c is select /*+ parallel(s,8) */ from table ref_tab s ---- >> <where condition>;
The table ref_tab hold data for a single day at any point of time and gets truncate before loading the next days data.On average the table holds around 7 million rows and doesn't contains any index (think that's fine as all together we are loading the whole set).And, we are using bulk logic with save exceptions to open the cursor and load the data into the target table.
Tabular form works fine for first entries, but upon going back to add more records Page 55 has a button that links to the 'Approval' page which is a tabular form (Page 56).A text field at top of this tabular form receives the pass of a varchar2 field from page X which is an identifier (not PK). Tabular form query has condition WHERE ISO_NUMBER = :P56_ISO_NUMBER
When I add records on the first pass to the tabular form and click submit all is fine and dandy.When I get out of the tabular form and go back to it and add additional records I get this error:
Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "C4B43B9A17A41D287D55DEFE9B035944", item checksum = "607C07E22C9B03E6A45AF44EDC06BB31"., update "SPICE_HUNTER1"."DOC_APPRV_DOC" set "APPRV_DOC_ID" = :b1, "DOC_INFO_ID" = :b2, "ISO_NUMBER" = :b3, "DOC_APPROVER" = :b4, "DOC_APPROVED" = :b5, "DOC_APPROVAL_DT" = :b6, "DOC_COMMENT" = :b7, "APP_USER" = :b8Here's what I've done to try to figure it out:
1. Ran debug and saw it was happening in my MRU; and 2. In the past what I have cleaned out tabular form table data because I've found that when I'm in this testing mode going back and forth with changes gets fouled up, but with a clean slate it still happens. 3. I had Hidden the ID fields, and then remembered this was one of the issues with versions of this error. (I actually logged this one to remember!). So I made them Display as Text (Saves State) and unchecked their boxes.
I am in the process of converting my skill in oracle and this time PRO*C from Windows to Linux. I have oracle 11g R2 installed on a UBUNTU (12.04) server and have installed the instant client as described in
[URL]
This has a query which will run in SQLPLUS but fails with PRO*C
:~/Projects/proc/proctest1$ proc INAME=proctest.pc SQLCHECK=NONE ONAME=proctest.c LNAME=proctest.lis LTYPE=long Pro*C/C++: Release 11.2.0.3.0 - Production on Mon Apr 22 21:00:18 2013 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. System default option values taken from: /home/neill.rutherford/instantclient_11_2/precomp/admin/pcscfg.cfg PCC-W-02109, SQLCHECK=NONE is no longer supported.. using SYNTAX
"ORA-01017: invalid username/password; logon denied" when attempting to log on to db, in three different applications. Error is observed in Toad, Crystal Reports, and MS ODBC Administrator connect test. However, same db credentials work in SQLPLUS.
Customer is attempting to log into reporting database hosted by my company, and using Cisco VPN client.I am unable to reproduce this at this time, on my machine, using same credentials and VPN profile.
Here is what we know/tried:
1. PING HOSTNAME is successful on CUSTOMER’S machine
2. TNSPING HOSTNAME is successful on CUSTOMER’S machine
3. SQLPLUS is successful with USER2/(pw)@HOSTNAME.int on CUSTOMER’S machine
4. We corrected timeout error on CUSTOMER’S side, by adding TCP.CONNECT_TIMEOUT=1000 in SQLNET.ORA (Also observed extremely slow performance on CUSTOMER SIDE)
5. We corrected dns suffix problem on CUSTOMER’S side, observed in NSLOOKUP by adding: IP ADDRESS AND HOSTNAME to Windows HOSTS file and commenting out default suffix COMPANY.com from SQLNET.ORA file
6. VPN configuration and VPN credentials are good.
We tested CUSTOMER’S VPN profle, CUSTOMER’S VPN credentials, and user USER2/(pw)@HOSTNAME on my machine (WIN7). I am able to maintain persistant connection to HOSTNAME for hours
7. TNSNames entries are good. Able to connect to db in Toad, and Crystal, on CUSTOMER’S machine using different Oracle user, USER3 (only has grant connect). Unable to logon to db, with Oracle user USER1, or USER2. (USER2 was created to try to resolve login problem w USER1, but issue still exists.)
8. CUSTOMER has Windows VISTA, does not have admin privileges, has Oracle 10 installed for client. Using same Cisco VPN client I have installed.
Event: click. type: jquery selector selector: a.show_popup no condition.
action: skillbuildersmodalpage 2.0.0 URL: attribute of triggering element.
This works fine, but after the popup is shown and closed, the link is not working until the page is entirely refreshed again.
after the popup is closed, i only refresh the report with $a_report , ( in another dynamic action on the "auto close skillbuolders" event) i don't want to submit all the page....the partial refresh is working fine too, but not the link, it only works again by refreshing or submiting all page