SQL & PL/SQL :: Oracle Select Build Table?

Jun 21, 2011

select a default table in oracle as we do in teradata, below is the syntax of teradata.

select 'XXX' as Curr,
'BUS OBJ ' as acq_nm
from (select 1 as one) Union
select 'ALL' as Curr, from (select 1 as one).

so I need the same select in oracle.

View 3 Replies


ADVERTISEMENT

SQL & PL/SQL :: Dynamically Build SELECT Statement

May 8, 2013

We have an requirement to build (XML) Select statement dynamically based on the mapping table (which is in hierarchy format)

I have removed xml keyword, so query will not work. but need procedure which will recursively check mapping table (parent and child table) and build below given select statement.

Example 1:
SELECT dname,
(select ename,

[Code]....

View 8 Replies View Related

Automatic Storage Management :: Build ASM In Linux Box Oracle 11g?

Dec 28, 2012

I have a Linux box with the below configurations:-

Linux blrulvremoradb02 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

Last time my UNIX administrator have done a partition in this box. I have 100GB lun allocated to this box which is spilitted in two mount points.

/u01 is having 30GB and /u02 is having 70GB. I want to build a ASM in this box and install Oracle 11.2.0.1 and for that I need raw disk.

Is there any useful links or can you guide me to achieve this... My UNIX admin is on leave for new year and I want to do this by my own..

View 5 Replies View Related

SQL & PL/SQL :: Executing Select On Table Using DBLink From Oracle 9 To 11

Aug 21, 2013

I have something strange :

I am executing a select on a single table using a dblink from oracle9 to oracle11 and i don't know why automatically add in the select the rowid at the end. The problem is that inside the query i have a group by so it crash.

Query sample :

original query from vb:
select a, b, c
from mytable
group by a, b, c

query intercepted on oracle11:
select a, b, c, rowid
from mytable
group by a, b, c

View 39 Replies View Related

PL/SQL :: Sql Query To Build Average Value

Jul 18, 2013

I'm trying to build a query capture the below information. Table looks something like below . 

RoomSubjectStudentsA1Science10A1Maths20B1Science15B2English25C1Deutsch20A1French15C1English10 

How can i write a query so that i takes the average of students in each room and display the output? I need to write a query so that it also picks up any new rooms and students added.  Average is sum of total students in room by number of times each room is specified.  

eg: A1 is listed 3 times a the result would be 10+20+15 divided by 3.    

A1    B1    B2    C115    15    20    15 

View 7 Replies View Related

Installed Oracle11g - How To Build Demo

Jul 28, 2010

I installed oracle11g on my computer ,when im going to build demo its not working.its giving a error like this.

sys>conn u1/u1
error accesing PRODUCT_USER_PROFILE
warning product user profile information not loaded
you may need to run PUPBLD.SQL AS SYSTEM
connected
u1>@?/sqlplus/demo/demobld unable to open file "/oraeng/app/oracle/product/11.1.0/sqlplus/demo/demobld.sql"

View 1 Replies View Related

Execute Immediate To Dynamically Build A Trigger?

Apr 25, 2011

We have developed a code which builds a trigger on a atble dynamically at run time usinf Dynamic SQL command Execute immediate.

create or replace
PROCEDURE GENERATE_TRIGGER
(
P_TNAME IN VARCHAR2

[Code].....

I am not usre if the error is due to insufficient privileges as we are able to build tabl;e in the system dynamically using the above mentioned command.

View 1 Replies View Related

Build Database From Backup Files

Aug 3, 2011

I am an absolute neophyte at this. I'm fairly good at SQL, but have not administrated a database before.

I am trying to take a backup from our production database and restore it to a fresh install of Oracle 10.2 on a Windows 2003 server using RMAN - but I am not getting very far. Software versions are all the same. I have access to the manuals, but it seems like every link I follow adds more questions than it answers.

I have gone through the wizard and set up oracle on the new box - that all seemed to go smoothly. In order for this to work, do I need to set up the database with the same DBID as the one in the backup files? Or is there a way to import the data from the backup and have it build the database from those files?

I'm not sure I'm even asking the right questions. Do any of y'all know of a tutorial that would walk me through this process step by step?

View 4 Replies View Related

Dynamically Build (recursive) Xml SQL Statement

May 3, 2013

We have an requirement to create xml data for entire database (selected tables) which are in hierarchy.Procedure should read node_mapping table having parent and child tables relationship info and build XML Select statement.

Currently it is building SQL statement whenthere are one parent having multiple childrens i.e Dept having emp, emp_act, emp_rsch..but when child node are having childrens then it is not working - it has to repeatedly call this procedure (recursive) and build below given SQL statement.

1. To change procedure to build xml sql statement when there are multiple childrens to child nodes (hierarchy)
2. To format the output in xml data

We are using ORACLE 11G and WINDOWS 7

CREATE TABLE node_mapping
(
NODE_ID NUMBER(5) PRIMARY KEY,
PARENT_NODE VARCHAR2(100),
CHILD_NODE VARCHAR2(100),
PARENT_NODEID VARCHAR2(50),
CHILD_NODEID VARCHAR2(50)
[code]....

View 1 Replies View Related

Build And Load Differences Between Dumps?

Jun 19, 2012

we get daily a full dump from our customer. We have to build the differences of tables (deltas) and load them in separate tables.

There some questions, requiremenst and restrictions:

1) Is it possible the merge the dumps ?

2) How to build the differences as the easiest ?

3) The whole process (import, merge, extract) should be run in batch.

4) We have only a solid knowledge and liitle time for doing.

View 1 Replies View Related

SQL & PL/SQL :: To Build A Hierarchy And Output It Into A Sub-report

Feb 26, 2010

I want to build a hierarchy and output it into a sub-report. Since the data in few hierarchy fields exceeds 4000 characters and therefore m getting the ORA-01489 error and the entire report was failing.

So i have used user aggregate function to print the out put. I have also used row_number() to print sequence in query output.

the query that i am using is

SELECT pr_id,
REPLACE (REPLACE (twadmin.STRAGG2(distinct RPAD (to_number(curr), 2, ' ') || ')' || NVL (DECODE (medical, NULL, clinical, medical), 'UNKNOWN') || '###' ||
RPAD (' Causality as per rport ', 50, ' ') || ': ' || reporter || '###' ||
RPAD (' Causality as per report2 ', 50, ' ') || ': ' || hospital || '###' ||
RPAD (' Dechallenge', 50, ' ') || ': '|| dechallenge || '###' ||
RPAD (' Rechallenge', 50, ' ') || ': '|| rechallenge), ',', CHR(10)), '###', CHR (10)) causality
[code]......

the output of the query is

ID Causality
-- ------
3755101 )Blisters (Blister)
Causality as per report1: Probable
Causality as per report2: Possible
Dechallenge : Not Applicable
Rechallenge : Not Applicable
2 )Mental status changes (Mental status changes)
[code].......

but the expected out put is

ID Causality
-- ------
3755101 )Blisters (Blister)
Causality as per report1: Probable
Causality as per report2: Possible
Dechallenge : Not Applicable
Rechallenge : Not Applicable
[code]........

but it should be as

1)
2)
3)
..
..
..
10)
11)
12) for the values in the causality field

View 25 Replies View Related

SQL & PL/SQL :: Function To Check Length And Build A String?

Dec 18, 2012

I have created a VIEW with a column containing user-defined aggregated values(stores the output in varchar2 data type). Some of the records exceed the maximum limit, for example varchar2(4000). I was suggested a PL/SQL function to check the length and build a string if necessary..

CREATE OR REPLACE
FUNCTION SUBURL(col1 IN VARCHAR2, col2 IN varchar2)
RETURN varchar2

[Code].....

Here, I got the following error,

Error(4,25): PLS-00103: Encountered the symbol "," when expecting one of the following:
:= . ( @ % ; not null range default character

View 14 Replies View Related

Application Express :: Build A Menu Framework

Jun 27, 2012

I have built a Menu Framework using the following instructions.

[URL]........

I am facing 2 problems.

1. If the user is in a child application and clicks logout. He is taken to the login screen of the master application (Correct), but once he enters login details, he is returned to the child application (False). I think he should be returned to the Home page of the Master application.

2. If I set Session Timeouts in the Edit Security Attributes of the applications. Then if the user is timed out, he is sent to the login screen of the Master application (Correct). If he then logs in, he is sent the the Home page of the Master application (Correct).

Now if he clicks a link to a child application he is then sent back to the Master application login screen. He then has to login again. He is sent to the Master Home page and everything is then ok.

View 1 Replies View Related

Performance Tuning :: Possible To Build Index Partition In Parallel

Jul 8, 2010

Is it possible to build index partition in parallel?I tried following command

alter index <index_name> rebuild partition <partition name> online parallel 5;

It executed without complaining, but want to know if index partitions can be build in parallel?

View 3 Replies View Related

Forms :: FRM-91500 - Unable To Start / Complete Build

Oct 9, 2009

I am trying to modify an existing form in oracle apps. I copied all the necessary objects and modified the form. I can compile the object in windows. When I am trying to compile the object in Linux server using SSH I am getting the following error.

FRM-91500: Unable to start/complete the build.I am using the following command for compile

f60genm userid=apps/apps batch=yes module= FORMNAME.fmb module_type=form.

View 3 Replies View Related

SQL & PL/SQL :: Build Query To Retrieve Records Between Dates With Same Field?

Mar 17, 2010

i have a doubt in building a query.

I have a table with fields

job_no activity Date
101 anchorage 20/01/2010
102 berthing 25/01/2010
103 sailing 29/01/2010

If i want to know the status of the ship on the date '22/01/2010' It has to show as 'anchorage', becoz on '25/01/2010' only it came to berthing from anchorage. How to write a query to achieve this.

View 12 Replies View Related

SQL & PL/SQL :: Build A Stored Procedure Which Compares Specific Fields In 2 Tables

Jul 24, 2013

I have table A.Security:

CouponIssue_nameQuantity_typeCurrencySec_TypeSec_alias
1 a 56 USD AB 676
2 b 45 INR AB 143
3 c 32 JPY BA 200

and Table B.Security:
CouponIssue_nameQuantity_typeCurrencySec_TypeSec_alias
1 a 33 USD OB 676
9 b 21 NZD AC 143
8 c 19 GBP CA 200

build a Stored Proc which compares sepecific fields in the 2 tables and reports into a new table as:

A.Security.sec_aliasB.Security.sec_aliastable fieldA-valueB-value Compare
676 676 Security Currency USD USD Match
143 143 Security Currency INR NZD Not-Match

Fields to be compared are:
Quantity_type
Currency
Sec_type

The join between the tables A and B can be made on Sec_alias.Also, this is just a single pair of tables. Further I need to compare 5 more pairs of tables after this and report out of the new table.

View 23 Replies View Related

Application Express :: How To Build A Button On Click Of Which Opens A List Below It

Jun 29, 2013

I have a requirement wherein onclick of button I want to open/close list/popup (which is displayed below button, just like in select list) and can select any item from list to do some action. 

View 7 Replies View Related

SQL & PL/SQL :: Build Parametric Queries - Input Date Field At Run-time

Aug 24, 2012

When working in MS Access, I can build parametric queries, where I can input the date field for example at run-time. How can I do something similar in SQL Oracle

Example

SELECT Sector.Date, Sector.RNC, Sector.Site, Sector.Cell,Sector.PSC
FROM Sector
WHERE Sector.Date=[Enter Date];

View 15 Replies View Related

SQL & PL/SQL :: Select Data From Test-1 Table Where ID Values In Table Exists In 2?

Aug 31, 2010

I have the below data in table test_1.

select * from test_1
IDNameTotal
-----------
1A100
2B100
3C100
4D100

test_2 table contains the concatination of ID's with comma seperated. Actually in this table ID column is of datatype varchar2.
select * from test_2
ID
----
1,2,3

My requirement is to select the data from test_1 table where the id values in this table exists in test_2 table. I tried with the belowselect statement, but could not get any data.

SELECT * FROM test_1 WHERE to_char(id) IN (SELECT id FROM test_2)

create table test_1 (id number, name varchar2(100), total number)
create table test_2(id varchar2(100))
insert into test_1 values (1,'A',100)
insert into test_1 values (2,'B',100)
insert into test_1 values (3,'C',100)
insert into test_1 values (4,'D',100)

View 4 Replies View Related

Application Express :: How To Build Access Control Page Download Spreadsheet Data

Jul 2, 2013

why the link provided under the How to Build an Access Control Page Download Spreadsheet Data Download the following *.csv file to your local system: In your Web browser go to:

[URL]............

returns nothing for me!

View 1 Replies View Related

SQL & PL/SQL :: Table And MV Of Same Name - How To Select Table / MV Separately

Dec 11, 2011

I have the same problem like in below link

[URL]

View 3 Replies View Related

SQL & PL/SQL :: Select From Table

Sep 24, 2010

Below is my table structure.

create table test_join (
user_name varchar2(20),
attribut varchar2(30),
attribute_val varchar2(30)
);
[code].......

I need to query an users name, manager,location and the manager's manager. Say the info for user A would be,

User : A
Location : Bangalore

Manager : B
Manager's Manager : C

I can get this in two step process.

select attribut,attribute_val from test_join where user_name = 'A';
select attribute_val from test_join where user_name =
(select attribute_val from test_join where user_name = 'A' and ATTRIBUT = 'manager') and
ATTRIBUT = 'manager';

But is there a way to get this in one single query ?

View 11 Replies View Related

SQL & PL/SQL :: How To Select From A Table

Aug 23, 2005

I have requirement where I need to use a regular select statement for a PL/SQL table. How can I do this? Here is a code example:

Create or replace PACKAGE cv IS
type comp_rec is RECORD
(deptno number,

[Code]....

In the function AAA, I am trying to return a ref cursor. I want to base the ref cursor on a PL/SQL table rather than a Oracle table. But unfortunately

open temp_cv for select * from temp_tbl;

is erroring out.

Can I do this?? that is, use a PL/SQL table in a regular select. If not, then, is there a workaround ?

View 4 Replies View Related

How To Select Table From Known Column Name

Sep 2, 2009

I want to find out all the tables that contains a known column name?

I know a column name called 'receiving_number', but don't what what table it's in.

View 2 Replies View Related

SQL & PL/SQL :: Create Table As Select On 10.2.0.5?

Oct 26, 2011

running on 10.2.0.5 and above satisfies the following:

having locally managed tablespace with assm enabled

create table t1 (n1 number) storage (next 1M);
insert into t1 values (1); commit;
create table t2 storage (next 2M) as select * from t1;

This will indeed set the storage option next to 2M;

The same situation in 10.2.0.4 will allways set next option for the ctas statement to the initial value of table t1.

Is this an impact of patch set 4 (10.2.0.5)? Why does it differ from 10.2.0.4 to newer releases?

View 3 Replies View Related

SQL & PL/SQL :: SELECT From Dynamic Table Name?

Jul 12, 2013

I do not know the table name but have a query that for sure returns the table name and I want to select a column value from the table into my PLSQL variable.

Here is the code :

DECLARE
v_VerTabName VARCHAR2(30);
v_Minor NUMBER(2);

[Code]....

But when I compile this I get ORA-00936 : Missing expression at the EXECUTE IMMEDIATE line.

View 3 Replies View Related

SQL & PL/SQL :: Not To Select A Column From A Table

May 10, 2012

If there are 100 colums or above in a table and we dont want select a single(any one) column from those 100 columns. is there any command or function to do this in oracle.

I can do it by writting names of all 99 columns but as this method is lenghty, so need some efficient way to do this.

like in SQL server we have a "except" keyword through which we can rule out the columns .

ex: select * except (column_name1,column_name_2)
from Table_name.

View 6 Replies View Related

SQL & PL/SQL :: Desc Table That Can't Select

Nov 14, 2012

if you grant select on a table to a user then u revoke select on this table that user still can desc this table, is this ok? what if i don't want that user to desc it?

View 2 Replies View Related

SQL & PL/SQL :: Select Records From Table

Jun 23, 2010

I am dealing with a table containing millions of records. I have table loans_list table and he data looks similar to this..

LOAN_IDSEQUENCE_NUMCOMPLETE_DATE
1237000
1237005
1237010
5237010 6/23/2010 10:07:02 AM
5237000 6/23/2010 10:07:02 AM
12237000

I am trying to select only those loan_id from this table which contain all these 3 sequence_num = 7000,7005,7010 and containing null compelete date. I tried different way to write the query but can't think of efficient way of writing this query yet.

Since this table contain million of records, i dont prefer to call this table more than once in a query. I am just trying to avoid the longer time delay for the execution of this query..

View 7 Replies View Related







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