Implement sequence in the creation of table?
Hey, I was wondering if it is possible to implement the sequence function in when I am creating the table.
For example:
create table customer(
customer_id number(6) PRIMARY KEY,
name varchar2(40)
and then I got the sequence:
create sequence aut_customer_id
minvalue 100000
maxvalue 999999
start with 100001
increment by 1
When im going to use the sequence, I will use "insert into" and then the aut_cumster_id.nextval to get a number...
Is it possible to implement this when im creating the table?
Edited by: 806568 on Oct 31, 2010 9:56 AM
Just to expand a bit ...
While the most common use of a sequence is to generate a PK for a table, as far as oracle is concerned a sequence is nothing more than a number generator. There is no inherent connection between a sequence and a table. It is simply up to the application designer to decide how he wants to use a sequence. That is why there is no way to define a sequence and/or somehow bind it to a table when the table is created.
Similar Messages
-
Problem regarding the creation of Table using CSS.
Hi ,
Here I have a Problem regarding the creation of Table using CSS.
In My Application i have a table with multiple rows(Rows are Dynamically added to the table).First i am setting the table with the following properties:
width:900px;
height : auto,
Overflow : visible,
Max-height: : 200px.
If I use above properties,I'm getting a table with 5 or 6 rows(height upto 200px).After that i am getting the Vertical ScrollBar.
The problem is when a table has many columns, Vertical and Horizontal Scrolls are coming at the time of setting the table. The table height is not Increasing dynamically.
How can i use "height" property in CSS? (I want the table height to be increased when the columns are more.)
Thanks & Regards
MadhaviHey humble user. Errr I'm trying to understand what ur trying to do. U want to create a section of a region destructively from an existing region right? If so select the option convert to new region (opt-comm-R or selecting it by right clicking). Check your audio bin to make sure. Whats the "merge" function? Are u refering to the glue tool?
-
Restricting the creation of table in a particular user
Hi All,
WE have Oralce Enterprise 7.3.4 running on Sun Solaris. We have a number of
users owning specific schemas and running differnet applications.
We don't want all users to be able to create or alter tables in their own
schemas either but want them to allow insert/update/delete.
We have removed standard roles and assinged custom roles without creae table system privlege. But users are still able to create tables in their schemas.
How can I allow all update/insert/delete but deny create table privelegs.
All help is welcome.
Balwinder
[email protected]IMHO, everyone's responses are sidestepping the primary problem. It is a fundamentally sound practice that for a given application, that there be made a seperate and physical distinction between the application schema that "owns" the objects and another schema that "connects" to use those objects.
So here's my basic recipe for resolution,
1. Call the current application user the "owning" schema.
2. Create a new application "connect" user that has connect privileges only and no tablespace quota whatsoever.
3. Make grants on the owning schema objects to the "connect" user or roles granted to the "connect" user (preferred) as you require.
4. Create private synonyms for the "owning" schema objects of the same name in the "connect" user schema.
No application code requires alteration, and you now have infinite data structure integrity of the application objects.
The really scarry thing that you didn't even mention is that you can't even stop the application from dropping its own tables. Quite scarry.
Michael -
Reg: Creation of Table Types
Hi All,
I have a small question regaridng the creation of Table type.
Let us suppose I am creating Table type for a custom table zsample which is having 5 fields. I am generally creating a structure similar to custom table and using that structure as line type for the table type. Let us suppose if there are any changes in the custom table like change in the order of fields or if new fields are added the table type will give dump.
My question is If I use the custom table itself as a line type, will there be any effect in the performance or some thing or I can go ahead and use it..
Thanks,
RaveeWhat dump are you expecting ???
It is idea behind the creation with reference to get structures and tables which always look like
the tables they refer to.
I can not see a possibilty for a dump as long as you create only an internal table.
A dump could appear, if the internal table is later used to update another db-table. But there it should be clear that the structure of an internal should be created with reference to the tables which they change.
Siegfried -
Creation of table in interactive form
hai,
any one can explain me the creation of table in interactive forms transcation code(sfp)
or any can send any material because i am new to this, how to build interactive forms
advance thanks.
regards,
shravanramidi .Hi,
TRy https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cacb9a7d-0c01-0010-1281-be4962c9ab3e
Regards,
Shiva Kumar(Reward if helpful). -
Creation of sequence and trigger for each table!!!!!!!1
Hi
I am new to trigger and Sequence field. In one of my database we have many tables with fields for specifing ID numbers. Iam planning to insert the ID field with help of a Sequence and trigger...that trigger fires by adding the sequence value from the dual table. Now the point is here we r having around *60* table with ID field. And i am planning use the above process for each table by creating sequences and trigger for each table.
Will this affects the performance of database.
Is there any other option other than the above process, I mean other than creating sequences and trigger for each table.
PLzz help to resolve this issuee......
Shiyas
Edited by: user13170361 on Jun 7, 2010 12:37 AMTiger, I didn't mind about your comment, but the point is try to use
select NVL(max(a) + 1,1) into i from p1_temp;This line in your trigger code and see what is happening. The problem is with your trigger. You are using group by function and you will not get no_data_found !
For more help, this is some modification of your code.
SQL> create table p1_temp (a number(10) primary key, b number(10));
Table created.
SQL> create or replace trigger trg_p1_temp
2 before insert on p1_temp for each row
3 declare
4 i number(10);
5 begin
6 begin
7 select NVL(max(a) + 1,1) into i from p1_temp;
8 exception
9 when no_data_found then
10 i := 1;
11 end;
12 :new.a := i;
13 end;
14 /
Trigger created.
SQL> insert into p1_temp(b) values (1);
1 row created.
SQL> insert into p1_temp(b) values (2);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from p1_temp;
A B
1 1
2 2
SQL> Edited by: Saubhik on Jun 7, 2010 2:30 AM -
The customer wants to know the timing ASFACT table creation
Hi, experts,
The customer wants to know when ASFACT table is created and when ASVFACT view update.
I check the table property, it seems
ASFACT_CLB_DISCUSS_0_2010_04 the creation date was 2010/05/01 18:58.
ASFACT_CLB_DISCUSS_0_2010_07 the creation date was 2010/08/01 14:54.
the date is first day of month, but time is different, could you tell why? the start time of batch? is different.
the ASVFACT view is also different, I checked collector log, the time are different by day. Could you give us ideas?
19 5 2011 14:42:51,141 INFO PartitionUtil - Successfully dropped the view ASVFACT_LOGINS:0
20 5 2011 05:50:25,953 INFO PartitionUtil - Successfully dropped the view ASVFACT_LOGINS:0
Thanks & Regards
SaiThanks a lot for your reply. The version they have is Software Version
4.2.176.0.
I suggested him to think about upgrading his WLCs in order to have such a feature in place,
Once again, thanks a bunch.
Regards,
AL -
How to maintain the sequence in the custom table
Hi,
We have custom table where we will store the standard text name based on different flags and it will be fetched the value according to the condition.
Example code
SELECT SINGLE field1
field2
INTO ( vaiable1 variable2 )
FROM custom table
WHERE tdobject = iv_signature
AND bukrs = vbdkr-bukrs
AND vkorg = iv_vkorg
AND vkbur = iv_vkbur
AND lland = vbdkr-land1
AND fkart = vbdkr-fkart
AND kschl = iv_kschl.
CHECK sy-subrc <> 0.
SELECT SINGLE field1
field2
INTO ( vaiable1 variable2 )
FROM custom table
WHERE tdobject = iv_signature
AND vkorg = iv_vkorg
AND vkbur = space
AND fkart = vbdkr-fkart
AND kschl = iv_kschl.
CHECK sy-subrc <> 0.
SELECT SINGLE field1
field2
INTO ( vaiable1 variable2 )
FROM custom table
WHERE tdobject = iv_signature
AND vkorg = iv_vkorg
AND vkbur = space
AND fkart = vbdkr-fkart
AND kschl = space.
The solution I created to avoid the select is, i have created the FM with all parameter. Addition to the FM, I have created a Table as well to maintain the flag.
New table
TDOBJECT TDID BUKRS VKORG VKBUR KUNNR MWSKZ AUART VGBEL_AUART KTGRM LLAND FKART WERKS KSCHL STNAME
FOOTER X X ZNET_DICI_FTR_FI
FOOTER X X ZNET_DICI_FTR_NL
FOOTER X X X
i.e. say example if we maintain the value in the custom table based on the first select query. Then we need to maintain the flag in the table which was created newly.
Note In the both field the key fields are same.
The problem now is we have plenty of select query for different condition, i though of maintain the sequences of the entries. But my worry is how many sequence number will be maintained and in what bases it will be maintained.
Could you please help me to resolve this problem?
Regards,
VijayHi,
I got your requirement as,
whenever a new entry is made in the table, one sequence has to be maintained somethign like serial number and everytime it has to be incremented. If it is so, then you can go for an additional field as serial number. Then get the max serial number from the following select query:
select max(serial) from cust_table
into v_serial.
Now, when you make a new entry, just give (v_serial + 1) to serial number...
Please let me know if i understood wrongly... or what you want... -
How to find the creation date of a column in a table?
Hi,
i scroll all the view and table of the Oracle RDBMS catalog and i didn't find how i can find when a column has been added to a table.
Is there a way i can find this info?
The column added is not the same date tehn the date of the table creation or the analyse column.
ThanksHi,
Something like this
select table_name, created from user_objects where object_type = 'TABLE'Regards
Anurag Tibrewal
Oops: I did not see the requirement correctly. If auditing is not the option for you then logminer (if archive is present) else no other option i can think of.
Edited by: Anurag Tibrewal on Oct 6, 2009 8:37 PM -
Loading the different result sets in the same sequence for the target table
Dear all,
I have 5 tables say A,B,C,D as my source and i made 3 joins P,Q,R .the result sets of these 3 joins are loading into a target table X but with 3 different targets with same table name.
I created one sequence say Y as my target table has primary key and mapped to three different targets for the same target table which i need to load.
But after deployed and executed successfully ,i am able to load the data from three join result sets with differeent sequence numbers.
I am looking to load data like this.
If First Result set P has 10 Records,SEcond Result Set Q Has 20 and the third result set has 30 records then while loading data into first target it creates the seq for the 10 records from 1..10 and while loading the data for second result set ,it creates the sequence from 11 ...20 and while loading the third target with the third result set it creates the sequence from 21 ----30.
But i am looking to load the three result sets in the sequence 1to 10 but not like creating fresh sequence for each result set.
how can we achieve this in owb?
any solution for this will be appreciated.
thank you
kumarMy design is like following
SRC1
---->Join1--------------------------->Target1( Table X)<-----Seq1
SRC2
SRC3
----> Join2----------->Target2(Table X)<----Seq1
SRC4
-----> Join3 -------> Target3(Table X)<-----Seq1
SRC5
Here the three 3 targets are for the same Table X as well sequence is same i.e seq1
If the First Join has 10 rows ,Seq1 generates sequence in 1 to 10 while loading target1
But while loading second target,Same Seq1 is generating new sequence from 11 but i am looking to load target2 and target 3 starting from sequence 1 but not from 11 or so.
As per your comments :
you want to load 3 sources to one target with same sequence numbers?
yes
Are you doing match from the other two sources on first source by id provided by sequence (since this is the primary key of the table)?
No
can you please tell me how to approach for this?
Thank You
Kumar -
Find the sequence name for a particular table
Hi,
Please give query to find the sequence name for a particular table in oracle.
ThanksI mean getting List of Sequence names defined in DB.
I got the answers
select *from user_sequences -
Error reading the standard sequence from the document tables
Hi PM Experts,
Please help!
Recently SAP patching is carried out in our R/3 environments. Before patching, all our customized RFCs were working correctly.
We are using BAPI ''BAPI_ALM_ORDER_GET_DETAIL' in a RFC. After the patching, the version date of the BAPI ''BAPI_ALM_ORDER_GET_DETAIL' is changed to new date of patching.
Now, when we are calling the customized RFC, ''BAPI_ALM_ORDER_GET_DETAIL' is returning an error 'Error reading the standard sequence from the document tables'.
This comes when we are pasiing any order with Order type 'ZM02' ( Maintenance Order - Preventative). It is working absolutely fine with Order Type ZM01(Maintenance Order - In Hours Opex).
Sometime, when RFC is run individually, it works fine with same data and sometime it is throwing this error with the same data. Very Inconsistent.
Please advice whether patching is the reason.
Any advice..is welcomed.
Many Thanks,
Rohit
Edited by: Rohit Kumar on Jan 14, 2009 3:50 PMThanks a lot.
We found that the flow of the code(RFC) was making a situation where even correct order id was passed to this BAPI, the result was an error 'Error reading the standard sequence from the document tables'. we reverted the RFC to it's earlier version. now that problem is not there. -
SAP Patch :'Error reading the standard sequence from the document tables
Hi Experts,
Please help!
Recently SAP patching is carried out in our R/3 environments. Before patching, all our customized RFCs were working correctly.
We are using BAPI ''BAPI_ALM_ORDER_GET_DETAIL' in a RFC. After the patching, the version date of the BAPI ''BAPI_ALM_ORDER_GET_DETAIL' is changed to new date of patching.
Now, when we are calling the customized RFC, ''BAPI_ALM_ORDER_GET_DETAIL' is returning an error 'Error reading the standard sequence from the document tables'.
This comes when we are pasiing any order with Order type 'ZM02' ( Maintenance Order - Preventative). It is working absolutely fine with Order Type ZM01(Maintenance Order - In Hours Opex).
Sometime, when RFC is run individually, it works fine with same data and sometime it is throwing this error with the same data. Very Inconsistent.
Please advice whether patching is the reason.
Any advice..is welcomed.
Many Thanks,
RohitWe found that the flow of the code(RFC) was making a situation where even correct order id was passed to this BAPI, the result was an error 'Error reading the standard sequence from the document tables'. we reverted the RFC to it's earlier version. now that problem is not there.
-
Different databse tables affected during the creation of a PR
Can someone please explain the different databse tables affected during the creation of a Purchase Requisition except EBAN?
Hi Ajit,
Thanks for the reply.
Kindly let me know how these tables will be affected when PR will be created(STXH,STXL)?
Thanks,
Lina -
Help-how can i see the sequence in the table?
Hi, i created sequence for the table. but how can i view the sequence as a column in the table? like the sequence started with 1 and increment by 1. how can i make it available as a column in the table? thanks a lot for anyone's prompt reply. much appreciated.
eg.
Create table:
create table t1 (
id number(10),
col1 varchar(2)
Create sequence:
CREATE SEQUENCE "PEMARTEN"."T1_ID" NOCYCLE NOORDER CACHE 20 NOMAXVALUE MINVALUE 1 INCREMENT BY 1 START WITH 1
You can do 2 things:
Use the sequence in your insert query:
eg.
insert into t1 (id, col1) values (t1_id.nextval, 'example');
OR
Create a before insert trigger (prefered):
CREATE OR REPLACE TRIGGER "PEMARTEN"."BI_T1" BEFORE INSERT ON "PEMARTEN"."T1"
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
new_id number;
BEGIN
SELECT t1_id.nextval
INTO new_id
FROM dual;
:new.id := new_id;
END;
Now you can just insert data:
insert into t1 (col1) values ('example');
sequence.nextval increments the sequence and returns the next value
sequence.currval returns the current value of a sequence
I hope that helps.
Kind regards,
Pieter
Maybe you are looking for
-
I have tried to get a magazine subscription D/L on my IPAD without success for almost a year now. I called the mag company and they had some tech difficulties but I have never received my subscription. I asked for my $19.99 back they told me to conta
-
Problem with credit memo and withholding tax
Please, I need your help: I have tried pay some invoice, each one does not exceed the minimum amount for Withholding Tax , but the adding of them exceed the Max Amounts for Withholding Tax Codes. For this I am using u201CBase exempt amt check a
-
HT201272 I downloaded a Calculator App (TI-NSPIRE CAS)
...for my macbook bro and I don't know where to find it? It says it's downloaded but I can't find it anywhere on my laptop. I can't open it from my Itunes either.
-
Posting Date Error when using TPM10
Hi, All I am using TPM10 to reserve the cash flows that were previously posted using TBB1. The problem occurs when I enter a different posting date (which I want to use as the reversal date) from the original posting date in TBB1. There is little inf
-
Exposing EJB interfaces as Web Service
Hi all, I created a prototype using EJBs and Web Services and found out that JDeveloper only allows to expose as Web Services the Remote interfaces of EJBs and not the Local ones. Assuming I have included Local and Remote interfaces for each of my EJ