SQL & PL/SQL :: DML Statements - How Does Merge Works

Jul 23, 2013

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.

View 3 Replies


ADVERTISEMENT

SQL & PL/SQL :: Merge Two Statements (Select ID) Into Single Output

Aug 11, 2013

I want to merge the following two sql statements into single output.

select id,count(*) from derailed where changed_on between to_date('26-july-13 18:30:00','DD-Mon-YY hh24:MI:SS') and to_date('01-August-13 18:29:00','DD-Mon-YY HH24:MI:SS') group by id;

select id,code from dbo;

View 11 Replies View Related

SQL & PL/SQL :: Insert Statements / Give A Commit One By One After Each Insert Statements?

Oct 11, 2012

Can we execute more than one insert statements at a time (eg 10) in database and givecommit at the end of insert statements or else give a commit one by one after each insert statements ?

View 8 Replies View Related

SQL & PL/SQL :: How Does Loop Works

Jun 27, 2011

[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.

View 9 Replies View Related

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,

[code]....

View 5 Replies View Related

PL/SQL :: How Where Condition Works

Jun 1, 2013

How oracle retrieves data from a table.like let say a table product as

create table product(id number,name varchar2(10))

table product dont have any index on it

now if this table conatain 500 rows and we have two query
1. select * from product where id=26
2. select * from product

does both query take same time or first query will execute in less time since it has where condition

View 2 Replies View Related

Code Works In Firefox But Not IE7?

Jan 29, 2008

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.

[Code]
<html>
<head>
<style>
</style>
</head>
<body lang=EN-US style='tab-interval:.5in'>

[code].....

View 3 Replies View Related

SQL & PL/SQL :: ORA-00979 In 11G But Works Fine In 10G?

Aug 1, 2011

I tested the SQL in 11G and get the ORA-00979 (not group by error) , the same SQL is working in 10G.

553322.1 - ORA-00979 IN 11.1.0.6 BUT NOT IN 9I OR 10G
814423.1 - ORA-00979 AFTER UPGRADE TO 11G

Do we have simple soluation for it if I don't have Oracle support account?

View 1 Replies View Related

How Remap_datafile Parameter In IMPDP Works In 10g

Oct 15, 2010

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.

View 5 Replies View Related

SQL & PL/SQL :: How Oracle Background Process Works

Jul 12, 2011

how oracle background process works and in what sequence when we file an insert or update command?

View 4 Replies View Related

Forms :: Save Button Works Only Once?

Jun 26, 2012

declare
blk_name varchar2(60);
form_name varchar2(60);

[Code].....

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?

View 5 Replies View Related

SQL & PL/SQL :: SELECT Works But View Doesn't

Jun 11, 2012

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]....

View 8 Replies View Related

PL/SQL :: SQL Insert Works Delete Doesn't?

Jun 22, 2012

I have a website I am working on a database for, and to insert new data into the table is not a problem, even to output the table isn't an issue.

But a delete query won't work and it doesn't return any errors or echo commands that I put in the steps of the logic.

View 11 Replies View Related

Connection Using Sqlplus Works Locally And Not From Other Servers

Jul 27, 2012

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:

Prod =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = x1200.prod.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = cusms)
(UR = A)
)
)

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:

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 27 12:37:55 2012
Copyright © 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-12519: TNS:no appropriate service handler found
[code]...

why is it my connection using sqlplus works locally and not from other servers?

View 2 Replies View Related

SQL & PL/SQL :: Rpad Function That Works For Multiple Chars?

Mar 6, 2011

How can I do this ?

is there an rpad that works for multiple chars?

select RPAD('test',10, 'X') from dual;

I want to be able to do something like

select RPAD('test',6, '%20') from dual;

which should return test%20%20

View 7 Replies View Related

SQL & PL/SQL :: Does Force View Option Works In Oracle 11g

Aug 13, 2010

when i am trying to excute below query.. it says ORA-00942: table or view does not exist.

create or replace force view v2 as select * from employee;

View 11 Replies View Related

Client Tools :: Spool In UTF8 Not Always Works

Oct 25, 2011

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.

View 4 Replies View Related

SQL & PL/SQL :: How Does Operator Works For Varchar2 Datatype Columns

Nov 22, 2011

I have a table called Student and a column as name now if i write a Query

select * from student where name < 'BRIAN D'

How does the comparison will be done.

View 3 Replies View Related

Server Administration :: Whether Oracle 9i Works In Windows 2012

May 14, 2013

know whether Oracle 9i works in Windows 2012? As we are planning to upgrade.

View 1 Replies View Related

Precompilers, OCI & OCCI :: Running Query In PRO*C That Works In SQLPLUS

Sep 4, 2008

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.

View 11 Replies View Related

Forms :: Saving As JFIF And GIF Works Fine Without Any Compression

Feb 5, 2013

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.

View 1 Replies View Related

Application Express :: Creating App That Works On Both Desktop And Mobile?

Nov 14, 2012

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 ?

View 3 Replies View Related

PL/SQL :: How Rownum Works For The Column Having Data Type As Varchar2

Jan 29, 2013

bookshelf_test table structure

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 ?

View 3 Replies View Related

Windows / .NET :: Oracle ODBC As User Works But Fails As SYS

Feb 1, 2013

Windows 7
Oracle XE 11gR2

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'?

View 6 Replies View Related

Client Tools :: Delete Table Works In Toad But Not In SQL Plus On UNIX

Nov 28, 2011

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

exact the same SQL statement.

View 2 Replies View Related

Enterprise Manager :: Dictionary Baseline - Generate Ddl No Longer Works

Jan 6, 2010

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.

View 1 Replies View Related

Performance Tuning :: Does Parallel Hint Works In Cursor Queries

Aug 28, 2013

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.

View 13 Replies View Related

Application Express :: Tabular Form Works Fine For First Entries

Sep 28, 2012

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.

View 1 Replies View Related

Call Interface :: Sql Statement Works In SQLPLUS But Will Not Pass Checking In PRO*C

Apr 22, 2013

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

[code]....

View 0 Replies View Related

ORA-01017 / Invalid Username / Password Logon Denied But SQLPLUS Works

Oct 15, 2012

"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.

9. Database on our servers is 11g

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved