SQL & PL/SQL :: List Must Be In Descending Margin Sequence

Mar 18, 2011

I'm doing this project and i've been asked to

1. List the product name selling price, cost price and margin of all products.
2. The list must be in descending margin sequence

But I am unsure of how to go about this..my Product tables are set up like

CREATE TABLE Product
(ProdCode Number(3),
ProdName VARCHAR2(35),
SellingPrice VARCHAR2(4),
CostPrice VARCHAR2(4),
SuppCode Number (4),
FirstName VARCHAR2(20),
Surname VARCHAR(20),
PRIMARY KEY (ProdCode),
Foreign Key (SuppCode) References Supplier,
Foreign Key (FirstName,Surname) References Designer );

View 3 Replies


ADVERTISEMENT

RMAN :: List Backup In Order To Get SEQUENCE?

Feb 26, 2013

Suppose we need to run the following: DB is single instance. DB Version 10.2.0.5

run {
SET UNTIL SEQUENCE ##;
duplicate target database to QA;
}

Can we use “list backup of archivelog all” or “list backup" in order to get SEQUENCE?

View 2 Replies View Related

Sort Ascending Or Descending Of Last Total Column Of Matrix Report R6i

Nov 3, 2010

How can I Sort Ascending or Descending of Last Total Column of Matrix Report R6i i.e. F_SumsalPerempno, summing total salary of each empno at end of each row.

I need the employee paid highest amount of total salary during the year to appear on first row, while months to display as per original order.

View 2 Replies View Related

Forms :: How To Make A Date Field Filter In Descending Order

Aug 5, 2011

I have a question regarding a Date field on one of my form.

How do I make a Date field filter in a descending order when the form is opened? Also, can I add a 'when-mouse-doubleclick' trigger to sort the date field in ascending and descending order (this is a client requirement)?

View 2 Replies View Related

Reports & Discoverer :: How To Set Paper Margin In 6i

Nov 5, 2010

How to set papaer margin in reports 6i for example i use continue paper sheets on my printer i set paper margin 4 x 4 paper width 4 & papaer length 4 i want that after running report paper only eject as paper size 4 x 4 not whole paper.

View 1 Replies View Related

Reports & Discoverer :: Page Margin?

Apr 23, 2013

1.)REP-1212: Object 'B_PAGENUM1' is not fully enclosed by its enclosing object 'Margin'.

View 4 Replies View Related

Reports & Discoverer :: Editing Margin In Oracle 10g?

Dec 31, 2012

i have a purchase order to print. its little bigger than a4 size paper.

only last two line are getting printed on second paper instead of the same paper.

i click edit margin and try to increase the size of think black frame.it is only increasing till 11.i want to increase it upto atleast 13..

View 3 Replies View Related

Forms :: How To Avoid (no List Elements Defined For List Item) Error

Sep 27, 2011

I am creating the Dynamic list but when i am compiling the form it gives the compilation error "No list elements defined for the list item".

I can eliminate it by entering the dummy list element but this dummy value will be displayed at form run time.

View 1 Replies View Related

List Products List Of Client Grouped By Type Of Product?

Dec 14, 2011

Im trying to list the products list of a client grouped by type of the product. Ex:

product type

prod.A acid
prod.B flavour
prod.C acid
prod.D cleaner
prod.E flavour

I want to list something as:

Acid

Prod.A
Prod.C

Cleaner

prod.D

Flavour

prod.B
prod.E

View 1 Replies View Related

Forms :: FRM-30351 / No List Elements Defined For List Item

Oct 30, 2011

DECLARE
CURSOR GRP IS
SELECT RowNum rn, Letter_Group_ID||'-'||A_Desc AName,Letter_Group_ID
FROM Hrs_Group;
BEGIN
Clear_list('Letter_Group_ID');
FOR I IN GRP LOOP
Add_List_Element('Letter_Group_ID',I.rn,I.AName,I.Letter_Group_ID);
end loop;
END;

FRM-30351: No list elements defined for list item.

List LETTER_GROUP_ID

View 4 Replies View Related

SQL & PL/SQL :: List All Tables Connected To Each Other With Constraints And List All Together

Apr 22, 2013

I just want to list and group all my tables that are linked together by constraints. I just want my tables to be able to be listed together as one particular database. my tables are , CUSTOMER, ORDER_INFO, ORDER_LINE, PRODUCT. They're all linked together by way of constraint and I want to list and print them all together as one DB. HOW DO I put them all in one schema and then also list them all together and print/illustrate them as one. also, I tried to import them into their own scheme but i ran into a series of probs regaurding the .dmp file being read.

View 2 Replies View Related

SQL & PL/SQL :: Get List Of Values Which Is Not The Given List?

Sep 1, 2013

I want to get the list of values which is not the given list .

I have the below data in my emp table

SQL> select emp_id from emp;

EMP_ID
----------
101
102
103
104
105
106
108
110
120
220
225

11 rows selected.

But I need to display the values from the list of values which are not in the emp table . So the result will be '3000,3002,3003'.

SQL> select emp_id from emp where emp_id ?;
EMP_ID
----------
3000
3002
3003

View 9 Replies View Related

Get A Query Of Each Sequence?

Jul 24, 2010

How do I get a query of each sequence and who has the permissions to it?

View 1 Replies View Related

Using Sequence In A Trigger

Jun 1, 2009

I have created a trigger for after insert which updates a table when there is a row inserted in that table. The update is on a column which stores the application description along with the sequence number. Now my requirement is that sequence number should be unique only with in an application but not with in the table.Say the row entry can be as follows:

App_Desc Request_ID
-----------------------
DEV 100 1
DEV 101 2
STG 100 3
STG 101 4

Here Request_ID is unique But the sequqnce thats created for DEV (100,101) should take an entry of 102 for the next entry for DEV and same applies for STG. So I have to use the same sequqnce for all the application.

View 1 Replies View Related

Trigger Corresponding To A Sequence

Apr 16, 2007

I have 3 tables whose structure is as follows:

1) Invoice
Invoice_no number(8),
Debtor varchar2(35),
Invoice Date Date,
Print Date Date,
Currency varchar2(3),
Total Amount Ex Number(11,2),
Total Amount Vat Number(11,2),
Total Amount Number(11,2),
Status Varchar2(15),

2) Invoice Line

Invoice_no number(8),
Invoice_Line_No number(8),
Description_1 varchar2(35),
Description_2 varchar2(35),
Line_Quantity Number(11,2),
Currency varchar2(3),
Line_Amount Number(11,2),
Vat Code number(1),
Status Varchar2(15),

3) vat code
vat code number(1),
Description varchar2(35),
Vat Percentage number(11,2)

Here invoice no and invoice line no are automatically generated fields?

How to generate invoice line no corresponding to invoice no and how to satisfy the following conditions:

1) total vat amount in invoice table should be automatically filled . total vat amount=(line_quantity* line_amount*vat percentage)/100

2) invoice cannot be printed, changed when status is 'closed'.

3) invoice lines cannot be added,changed or removed when status of invoice is closed

4) when any of invoice line no is changed,added, removed or invoice is changed the status of invoice should be changed to 'new'.

5) invoice date of a new invoice cannot be of the past

View 1 Replies View Related

How To Set Sequence Cache

Oct 10, 2012

Are there any recommendations or good practices to set sequence CACHE parameter (for example one caching per hour, day etc)?

View 4 Replies View Related

SQL & PL/SQL :: Sequence Skips First Value?

Jul 23, 2010

For some reason Oracle Sequence is skipping the first value. Here is an example of script.

drop sequence tseq;
drop table xyz;
create table xyz
(sno integer);
create sequence tseq
start with 1;
insert into xyz values (tseq.nextval);
select * from xyz;

Now the runtime of the script in SQL Developer:

drop sequence tseq succeeded.
drop table xyz succeeded.
create table succeeded.
create sequence succeeded.
1 rows inserted
SNO
----------------------
2

Why is it skipping the starting value 1. Is there something new in 11g that is causing it to skip the first value. I have many scripts and they all are having errors due to this issue.

View 39 Replies View Related

SQL & PL/SQL :: How To Create A Sequence

Sep 11, 2010

Create a sequence E_SQ which start with the (current max empno + 1) and increment by 1.

View 5 Replies View Related

SQL & PL/SQL :: Alter Sequence With No Max Value?

May 4, 2010

is there any way to alter only max value in sequence without specifying the max value.

i know we can alter it like :

-- Alter sequence
alter sequence TEST_SEQ
maxvalue 99999999;

can we alter it without providing the max value and let oracle choose default value for the same, same as we can do it when creating a new sequence.

View 5 Replies View Related

SQL & PL/SQL :: Sequence Can Be Used Across Databases?

Mar 19, 2012

As we can give grant on sequence and can use in different schema of same database, can same sequence be used across databases?

View 2 Replies View Related

SQL Plus Viewing A Sequence

Nov 1, 2007

After you've created a sequence in sql plus is there anyway of viewing the contents of the sequence and what it does?

View 1 Replies View Related

SQL & PL/SQL :: Sequence Next Value Change?

Jul 25, 2011

We Require to Change the Sequence Next Value.

If it possible to Update the Sequence Next Value in Oracle.

View 3 Replies View Related

SQL & PL/SQL :: Sequence In A Trigger

Dec 27, 2010

The below trigger is running fine without any error ,but i wasn't able to perform the exact logic by the below trigger.IF, inserting multiple row then the SIVNUM field gets the same sequence number for each row , without incrementing the value for the next row.

Only the sequence value increases on the next set of row ow's inserted

Example (inserting 2 rows ) based on the below trigger:

item , refwo , sivnum
1234 , 55555 , 00001
6352 , 77777 , 00002

i want to achieve :

item , refwo , sivnum
1234 , 55555 , 00001
6352 , 77777 , 00001

CREATE OR REPLACE TRIGGER siv_mat_insert
BEFORE INSERT
ON MATUSETRANS
REFERENCING OLD AS old NEW AS new
for each row
[code]....

View 6 Replies View Related

SQL & PL/SQL :: Sequence Identification

May 29, 2012

I have round about 100 sequences in a schema. How can i identify that which sequences are not used for a long time. Or How can i identify the last date when that sequence is used.

View 5 Replies View Related

Sequence Number In 11g RAC

Sep 17, 2012

In our production, we have two nodes in the cluster. We use the sequence for one of the main table for primary key. Our application is expecting sequence number increments along with created date time stamp. Right now sequences are cached for each node and it creates problem for the application. We would not like to use NOCACHE option because it causes performance issue.

This is the current scenario -

Transaction #1 on Node 1 - Seq ID 1 - Time Stamp 12:01
Transaction #2 on Node 2 - Seq ID 51 - Time Stamp 12:02
Transaction #3 on Node 1 - Seq ID 2 - Time Stamp 12:03

When I try to query based on the time stamp, primary should also go up. To be very clear on what I would like to have, please consider the following example.Without using NOCACHE option, I need to have the data in the following order.

Transaction #1 on Node 1 - Seq ID 1 - Time Stamp 12:01
Transaction #2 on Node 2 - Seq ID 2 - Time Stamp 12:02
Transaction #3 on Node 1 - Seq ID 3 - Time Stamp 12:03

In other words, sequence number should always increment along with the time.

View 2 Replies View Related

SQL & PL/SQL :: Sequence - Getting Error?

May 13, 2011

i have create one sequece using this syntax

CREATE SEQUENCE seq_emp_id START WITH 100;

after that when i create a table using this syntax

CREATE TABLE employee
(
emp_id integer default NEXTVAL ('seq_emp_id'),
name text
);

i got an error like this
*
ERROR at line 2:
ORA-04044: procedure, function, package, or type is not allowed here

so how can i resolve my this error

View 3 Replies View Related

PL/SQL :: New Enhancement In 11G Sequence

Oct 22, 2012

I have Created sequence in oracle 10G and its working fine. its showing THE NUMBER IS 2

SQL> DECLARE NUM NUMBER;
  2  BEGIN
  3  select SERIAL_NO.NEXTVAL into num from dual;
  4  DBMS_OUTPUT.PUT_LINE('THE NUMBER IS ' ||NUM);
  5  END;
  6  /
THE NUMBER IS 2

PL/SQL procedure successfully completed.When i execute this code in oracle 11G then it does not show output.

SQL> DECLARE NUM NUMBER;
  2  BEGIN
  3  NUM :=SERIAL_NO.NEXTVAL;
  4  DBMS_OUTPUT.PUT_LINE('THE NUMBER IS ' ||NUM);
  5  END;
  6  /

PL/SQL procedure successfully completed. SQL> Why this is not showing output as THE NUMBER IS .

View 1 Replies View Related

Inserting Values From A Sequence?

Jun 10, 2011

I created a Table with a single column varchar2.. in which I wanted to insert value like 'BBBBAB1'... till 'BBBBAB100'

Created a sequence starting with 1...

and inserted single row, and multiple rows using loop also; by using below code -

insert into Trans SELECT CONCAT('BBBBAB', Trans1.NEXTVAL) from dual;

but whenever I see the values they are not as required ... 'BBBBAB1' but one character 'B' is missing, and the values populating are 'BBBAB1'.. 'BBBAB100'

View 1 Replies View Related

SQL & PL/SQL :: Sequence Increments When It Is Not Being Called

Dec 1, 2012

I have a table called "Subjects" which lists subjects to match with notations in another table I have created a simple sequence (CREATE sequence subjectid) to created the subject id for the table. But I notice that if there is a skip in the date, the sequence increments automatically when I am not even using it. It even appears to be incrementing even when I am not doing any database activity.

This is not an issue of data integrity, because the values in the subject_id column do not need to be sequential, they just need to be unique. But it really has me curious. I created another table called "keep_track" to keep track of what is happening:

16-NOV-12 2952
16-NOV-12 2953
16-NOV-12 2954
16-NOV-12 2955
16-NOV-12 2956
16-NOV-12 2957
16-NOV-12 2958
16-NOV-12 2959
16-NOV-12 2960
16-NOV-12 2961
16-NOV-12 2962

[Code] ......

View 10 Replies View Related

SQL & PL/SQL :: Using Sequence In CASE Statement

Oct 11, 2011

Can we use the sequence.nextval,sequence.currval inside case block.

CREATE TABLE EQUALITY_TEST(NUM1 NUMBER, NUM2 NUMBER, SEQ NUMBER);
INSERT INTO EQUALITY_TEST VALUES ( 2 ,0 , NULL);
INSERT INTO EQUALITY_TEST VALUES ( 2 ,2 , NULL);
INSERT INTO EQUALITY_TEST VALUES ( 2 ,2 , NULL);
INSERT INTO EQUALITY_TEST VALUES ( 12 ,2 , NULL);
INSERT INTO EQUALITY_TEST VALUES ( 12 ,12 , NULL);
INSERT INTO EQUALITY_TEST VALUES ( 12 ,12 , NULL);
CREATE SEQUENCE SEQ_TEMP START WITH 100 INCREMENT BY 1;

Now i need to update SEQ column with SEQ_TEMP sequence. When NUM1,NUM2 values are unequal sequence should be incremented otherwise need to use the same sequence number(CURRVAL)

I have tried like this

UPDATE EQUALITY_TEST
SET SEQ=
CASE WHEN NUM1=NUM2
THEN SEQ_TEMP.NEXTVAL
ELSE
SEQ_TEMP.CURRVAL
END ;
SELECT * FROM EQUALITY_TEST;

Output

NUM1NUM2SEQ
120100
222101
322102
4122103
51212104
61212105

But Required Output

NUM1NUM2SEQ
120100
222100
322100
4122101
51212101
61212101

View 4 Replies View Related







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