PL/SQL :: Oracle 10.2.4.0 - How To Divide Set Of Records Into Groups In SQL

Jun 11, 2012

I am using 10.2.4.0 of oracle. I am having one requirement, in which i have to divide the set of records into certain groups , so that they can be executed partly but not in one run.

So in the 'SELECT' clause itself i want to assigns particular value (may be 1 )to first 50000 records then another value(may be 2) to next 10000, like wise. And again the total count of records will also varry time to time , if the total count of record set is less than 10000 , then it should only assign '1' to all the records. i will set the group values (1,2,3...) as another column itself.

View 4 Replies


ADVERTISEMENT

SQL & PL/SQL :: Breaking Records Into Groups

Apr 22, 2010

Data at a table with single column unique indexed is like

1,3,5,6,8,10,98,45,23,56,34,12...... there are about 100 million records.

Out of these values we need to create fixed(5 in each) groups, from - to.

example

1-8
10-56
98-..

View 11 Replies View Related

SQL & PL/SQL :: Retrieving Related Records As Groups

Mar 12, 2008

I have a table of N records with: Name SeqNo ID Col4 ... ColX

where Name and ID are non-unique, and SeqNo is a monotonic non-consecutive sequence 0 .. N that is unique within ID..I'd like to generate the following 'groups': For each record where SeqNo = 0, sorted by Name, create the 'group where ID is the same, ordered by SeqNo irrespective of the

values of any of the other columns. For instance, if the table contained:

NameSeqNoIDCol4 ... ColX
RPL2975...
TLM0444...
AAB2801...
AZZ0801...
ABA3444...
KTT4975...
ABA1801...
YHG0975...
DEF1444...

I'd like to generate:

NameSeqNoIDCol4 ... ColX
AZZ0801...
ABA1801...
AAB2801...
TLM0444...
DEF1444...
ABA3444...
YHG0975...
RPL2975...
KTT4975...

I got my desired results by brute-forcing via four sub-queries:

Sub-query 1 - Generate the sorted Names with SeqNo = 0
Sub-query 2 - Expand above with the additional columns,
maintaining original order
Sub-query 3 - For each of the records from sub-query 2,
generate the 'dependents' having the same ID
and SeqNo != 0
Sub-query 4 - Expand above with the additional columns,
maintaining original order of sub-query 1
Main query - Create UNION of 2 and 4, sorting by original
order and SeqNo

if there were not a simpler approach - after all, this must be a fairly common issue when generating BOMs.

View 4 Replies View Related

Application Express :: How To Create Radio Groups Dynamically Based On Records In A Table

Nov 29, 2012

below requirement..

We have certain records like SQL, PL/SQL, Reports, Forms, OAF etc in a table. We wanted to capture rating for each of these criteria. So we want a form to be displayed dynamically..

SQL 1 2 3 4 (1,2,3,4 represent radio buttons)
PL/SQL 1 2 3 4
Reports 1 2 3 4
Forms 1 2 3 4
OAF 1 2 3 4

If we add another row, XMLP in that table additional radio button should be displayed automatically..

View 4 Replies View Related

SQL & PL/SQL :: Creating User Groups In Oracle 10g?

Mar 14, 2012

i want to create a group xyz and add some users to xyz group and want to grant/revoke permissions to xyz. So that all the users present in that group will have the same permissions as of the xyz group. so that instead of giving the permissions to users individually i can give it at a time.

View 20 Replies View Related

Server Administration :: About Oracle ReDo Log Groups

May 21, 2013

I've a situation where I've very less redo logs generated. Let us say 10MB. Which solution will be better ?

1. Create one redo log group about 12 MB in size.
2. Create two redo log groups about 5 MB each in size as recommended by Oracle.

Even though solution 1 is also appropriate for me because I've less redo generated than the redo log group size. My whole redo will fit in this and I can raise checkpoint forcefully after certain period of time let us say every 3 seconds.

In one of our DB I found scenario one is implemented. So I want to know pros and cons of both of these practices.

View 7 Replies View Related

TimesTen In-Memory :: Manual Refresh Cache Groups From Oracle DB?

May 3, 2013

we want to truncate a oracle Table in the Oracle DB. After the truncate the fact table will be loaded again. After the new load in the fact table we want to tell the times ten db to refresh the cache table. The cache Table is a user owned read-only cache group with no autorefresh. We want to tell times ten in a PL/SQL Block from Oracle DB that starts the refresh from the cache group in times ten. The refresh should not be a autorefresh because the refresh should only start if the fact table will new loaded after the truncate.

View 1 Replies View Related

SQL & PL/SQL :: Divide One Of Column Value With Other As Duplicate

Feb 6, 2012

below are the create and insert statement, making duplicate row, i mean In table emp_detail, we have row like

ENAMEJOBDEPTNODETAIL
RAJ CS 10 RAJ IS IN CARE OF ROHIT

We need to insert the same record but divide the last column value on the basis of "IN CARE OF" any word after this should come in next new row with the same value for all other column, like

ENAMEJOBDEPTNODETAIL
RAJCS10RAJ IS IN CARE OF
RAJCS10ROHIT
CREATE TABLE "EMP_DETAIL"
("ENAME" VARCHAR2(10),
"JOB" VARCHAR2(9),
"DEPTNO" NUMBER(2,0),
"DETAIL" VARCHAR2(100)
[code]...

View 3 Replies View Related

Reports & Discoverer :: Divide Row To Same Fields

Jun 28, 2011

i want to divided report to same fields such as

above
account_no , account_name , account_date
120 industry 1-1-2010

middle
account_no , acccount_name , account_date
121 medical 1-1-2009

bottom
account_no , account_name , account_date
122 financial 1-1-2008

View 11 Replies View Related

SQL & PL/SQL :: Divide Sting Into Small Strings

Aug 7, 2010

I have a string:

"This is just for testing 123.
This is just for testing 45654.
This is just for testing 5567876.
This is just for testing 53456547.
This is just for testing 123423.
This is just for testing 98090.
This is just for testing 099473.
This is just for testing.
This is just for testing.
This is just for testing 3.
This is just for testing 34983245983.
This is just for testing 6432."

I need to divide this sting after every 100 characters, as the length of column to insert is 100. And i do not want to modify the column as it has great impact. I need to divide the string, such that it should be less then 100 characters also the string is not cut in between.

like:
first string: "This is just for testing 123.
This is just for testing 45654.
This is just for testing 5567876."

then 2nd string: "This is just for testing 53456547.
This is just for testing 123423.
This is just for testing 98090."

then 3rd string: "This is just for testing 099473.
This is just for testing.
This is just for testing.
This is just for testing 3."

View 6 Replies View Related

SQL & PL/SQL :: Apply Divide And Conquer Approach On Field Value

May 4, 2010

I want to apply divide and conquer approach on the field value, For example I have the field value like this

Value
32,36,12,65,85,9663
43,36,89,65,112,9663
36,63,12,65,95,123
32,36,12,85, 85,9663

Remember that these value are taken from ONLY one field i.e Value. Apply the divide and conquer approach in such a manner that take the value of a single field and each row and divide the value into two half. Continue this process until single value until we reach the single value or single sub problems.

Apply the divide and conquer approach on all the value of field. When we get final value then match the value of two different rows. And check how much field value are similar (match or duplicated). If field values are match more then 80% then delete the duplicated value and keep the original entity.

View 39 Replies View Related

SQL & PL/SQL :: Oracle 10g - Update Records In Target Table Based On Records Coming In From Source

Jun 1, 2010

I am trying to update records in the target table based on the records coming in from source. For instance, if the incoming record is present in the target table I would update them in the target else I would simply insert. I have over one million records in my source while my target has 46 million records. The target table is partitioned based on calendar key. I implement this whole logic using Informatica. Looking at the informatica session log I find that the informatica code is perfectly fine but its in the update part it takes long time (more than 5 days to update one million records). find the TARGET TABLE query and the UPDATE query as below.

TARGET TABLE:
CREATE TABLE OPERATIONS.DENIAL_REGRET_FACT
(
CALENDAR_KEY INTEGER NOT NULL,
DAY_TIME_KEY INTEGER NOT NULL,
SITE_KEY NUMBER NOT NULL,
RESERVATION_AGENT_KEY INTEGER NOT NULL,
LOSS_CODE VARCHAR2(30) NOT NULL,
PROP_ID VARCHAR2(5) NOT NULL,
[code].....

View 9 Replies View Related

ASM Disk-groups / RAID?

Feb 25, 2011

We have a new implementation which will be using ASM with RAID. The data area needs to be 3TB, and the recovery area, to be used for archive logs and RMAN backups, needs to be 1TB.

The configuration i'm thinking about now is:

+DATA diskgroup: 5*600G disks, using RAID 1+0 (this will include control files)
+FRA diskgroup: 2*500G disks, using RAID 1
+LOG diskgroup: 2*1G disks, using RAID 1 (this is only for redo logs)

So here are my questions:
1. Am I right in supposing that we would get the best performance on the +FRA and +LOG diskgroups by not using RAID 1+0?
2. It has already been agreed to use RAID 1+0 for the +DATA diskgroup, but I can't see the added benefit of this. ASM will already stripe the data, so surely RAID 0 will just stripe it again (i.e double striping the data). Would it not be the better just to mirror the data at a hardware level?

View 4 Replies View Related

XE :: Applying (User Groups)?

Aug 1, 2013

I am able to assign a user to a user group using the User Admin in Apex.I don't know how I would be able to assign a role (that I know how to define that for an individual user).The only thing I can see is a name for User Group and a Description! My requirement is to define a group of people to be assigned to one group/role, so that every change to that role can be automatically be applied to each user in that group

View 1 Replies View Related

One Materialized Views In Two Refresh Groups

Sep 11, 2013

I have 5 MViews that I want to refresh in two occasions, every Sundays and at the 1st of the month. I created a Refresh Group for the weekly and that work fine. But when I tried to created the second Refresh Group for the monthly I get a "materialized view is already in a refresh group".

You can only have a materialized view in one refresh group? What options to I have to refresh it in different intervals?

View 1 Replies View Related

Materialized Views Vs Refresh Groups?

Sep 29, 2010

We recently migrated a database from 9i to 10g (overdue we know!!) and discovered that dbms_mview.refresh default behavior was turned upside down - meaning that 10g didn't first truncate the MV to refresh it. We're trying to unwind a lot of legacy issues, but it also turns out that we also have 100 REFRESH GROUPs and 100 MATERIALIZED VIEWs. That means a 1 to 1 relationship between RGs vs MVs. There is one MV defined to each RG.

These are my questions:

1) Does a 1 to 1 relationship between RGs and MVs make sense to anybody? The original implementors are gone and we can't fathom the reason for this.

2) Is there any reason why I shouldn't convert these 100 groups to plain and simple 100 MVs? I don't want the delete/insert refresh behavior of dbms_refresh.refresh and I do want the truncate behavior of dbms_mview.refresh ATOMIC=FALSE for refreshing a standard MVIEW

View 1 Replies View Related

SQL & PL/SQL :: Groups With Multiple Columns And Links

Nov 29, 2010

the thread title was a bit confusing, couldn't come up with anything short to describe the question. What I am looking for is a query which will put records into groups based on matching values in one of two columns. So if two records have a matching value in column 1 or column 2 they are in the same group. See the example bellow and expected output for a "better" explanation:

--setup
CREATE TABLE foo
(foo_id NUMBER NOT NULL PRIMARY KEY,
record_number NUMBER,
record_value VARCHAR2(1));

[Code]...

--expected output

group# foo_id record_number record_value
1 1 1 A
1 2 1 B
1 3 2 B
1 4 2 C
2 5 3 D
3 6 4 E
3 7 5 E

My initial thought is that is feels a little bit like the sequential seat problem but not quite close enough. I know it could be done iteratively with PL/SQL but I am thinking there must be a way to do it in SQL I am not seeing yet.

View 6 Replies View Related

PL/SQL :: Query To Find The Sum Of Different Groups Of Same Column

Feb 23, 2013

I have a table as follows:

customers
------------------------------------------------------------------------------------------
custid credit amt month
--------------------------------------------------------------------------------------------
001 C 2000 Jan-2012
001 D 5000 Feb-2012
001 C 3000 Mar-2012
001 C 3000 Apr-2012
001 D 7000 May-2012

I Have to write a single query to calculate the sum of credit and sum of debit value separately.

View 8 Replies View Related

SQL & PL/SQL :: Creating Trigger To Compute Population From Groups

Aug 14, 2011

I am new to PL/SQL and how to create a trigger to compute the population of the school from the groups of students and store back in population. It also needs to check that there is a min of 10 students to a school.

CREATE OR REPLACE TYPE group_type AS OBJECT
(
group_nameVARCHAR2(20),
tutor_idNUMBER(5),

[code]...

View 11 Replies View Related

Underlying Devices That ASM Disk Groups Depends On?

Jun 21, 2012

We have a big problem in the underlying devices that ASM disk groups depends on. We have SAN disks (EMC DMX) presented to us as /dev/sda, /dev/sdb, etc.These disks have actually multipath setup. For example, - /dev/emcpowera has two different paths as:

1./dev/sda
2./dev/sdp

We were using the direct path /dev/sda to format the disk (as fdisk /dev/sda), and then used oracleasm to create disks (oracleasm createdisk ASMDISKDATA0 /dev/sda1). Then, ASM disk groups were created with those lables (volumes), and then database was created using the ASM disk groups.

Now our platform folks are telling us that we should use the multipath /dev/emcpowera instead of direct path /dev/sda as the direct path is not guaranteed across reboot.

So the questions are:

1.Is there a way to re-link the disk group to asm disk to the multipath devices (/dev/emcpowera1 instead of /dev/sda1)?
2.Is this even an issue for ASM? If the /dev/sda fails after reboot, can Oracle ASM automatically discover the other path /dev/sdp to the physical EMC disk?

View 3 Replies View Related

TimesTen In-Memory :: How To Create DB Cache Groups

Jul 22, 2013

Is it possible to use TimesTen to create cache groups that have different table structures from original Oracle tables based on relational conditions?

View 3 Replies View Related

Enterprise Manager :: Configuring Grid Alerts For Two Different Groups Based On Database Environment

Aug 12, 2010

i have implemeted grid control for monitoring database. we have different database environment like PROD , STAGE, TEST, BETA.

Now my requirement is, i need to configure PROD & STAGE alert for one group (group1@oracle.com) means, what ever alerts generated by grid should sent notification to group1@oracle.com and TEST AND BETA database alerts should to group2@oracle.com.

Now i am following the oracle manual to configure notifications. unfortunately i could not find to complete my requirement.

[URL]

did any one implemented alerts to send different groups.

View 2 Replies View Related

Reports & Discoverer :: Discoverer Divide By Zero

Mar 11, 2007

I am using Oracle Discoverer Plus and I have some columns in the database table that periodically take the zero value. I have to use that column to divide other values. Is there any way I can handle this to show "0" when it is divided by zero?

Discoverer Plus shows that PL/SQL functions can be used in calculations. But I can't find the Register PL/ SQL function option in the Tools menu.

View 6 Replies View Related

ASM Disk Groups Creation After ASM Instance Creation

Jul 9, 2012

During ASM Disk Groups creation after the ASM instance creation, receive the following error: Disk Group ORAASMGROUP2 already exists. Cannot be created again

The Grid infrastructure was deinstall one time and still the same issue.

View 4 Replies View Related

SQL & PL/SQL :: Oracle 10g Express - Records As Object?

Jul 22, 2012

I am trying this below in oracle 10g express. how I can select data from the table?

CREATE TYPE Worker AS OBJECT (name VARCHAR2(25), dept VARCHAR2(15));
CREATE TABLE teams (team_no NUMBER, team_member Worker);
insert into teams
values ( 5 , team_member ( worker('a' , '2')))
DECLARE

[code]...

ORA-00933: SQL command not properly ended

View 6 Replies View Related

SQL & PL/SQL :: Oracle 9i / 10g - Remove Duplicate Records?

Nov 11, 2010

I have a query which pulls data from emp view

select am_obj_emp_obj(empno,ename,sal,deptno,service) from
(select empno,ename,sal,deptno ,service from emp_vw where 1=1 and rownum < 2000 and service in ('MAN','SACH','SACL','KACL'))
WHERE SAL = (SELECT MAX(SAL) FROM EMPS_VW WHERE DEPTNO = deptno or sal is null)
union all

[code]...

This query is pulling 12 records of which 6 records are coming from the first query and the same 6 records is coming from the second query after union all Here am_obj_emp_obj is the object type and emp_vw is the view

Now I wanted to remove the duplicate records.When I implement the union operater it is giving me error.

ORA-22950: cannot ORDER objects without MAP or ORDER method.

View 5 Replies View Related

Oracle Function To Retrieve Records Randomly?

Jun 19, 2013

I need function to pick the record from DB random manner.

For example
, say we have 500 records and input value to the function is 5 means, it should display the records randomly between 1 to 5

If user inputted value is 10 means, it should display one record between 1 to 10.

View 1 Replies View Related

Error While Bulk Updating Records In Oracle Using XML

Aug 13, 2010

I am trying to bulk update records in oracle using XML , front end is vb.net.Now the problem when i updating for 1000 - 5000 records on my development server. Its getting updated.

But when we are updating on the production server for 100000-200000 records , we receive error

"ORA-01460: unimplemented or unreasonable conversion requested "

View 1 Replies View Related

Compare Records In A Table In Both Oracle - MSSQL?

Jan 13, 2009

I am trying to compare records in a table in both Oracle and MSSQL database against a single standard dataset in my test case. However, I'm getting different results for each when I sort using a "order by".

select COL1 from TABLE1 order by COL1

In MSSQL, I get:
COL1
=====
A
A.
A++
A++.

In ORACLE, I get:
COL1
=====
A
A++
A++.
A.

I mean, oracle result some what makes sense, because "." has bigger ascii value than "+". But is there anyway to make the ORACLE sort order look exactly like MSSQL result?

View 1 Replies View Related

SQL & PL/SQL :: Skipping Of Records - Oracle External Table?

Sep 24, 2011

I have a flat file on an unix system.The file is required to be loaded through Oracle External Table.

Issue:
Not sure how to skip the first record when loading through Oracle External Table.How to suppress data while loading through External Table.

Requiremen syntax where in I can skip the first record. syntax for suppressing values in columns that are not required. How the same needs to be handled in case of Number datatype and Varchar2 datatype. Example - In case of Number can it be replaced with 0 and for datatype can be same be replaced with NULL.

View 9 Replies View Related







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