Sequence number adjustment in the column
In my table maintenance generator,
I have one field called sequence number which increments by '1', each time user enters a new record in my table maintenance generator(have coded in such a way).
now the internal table, under sequence column if some records get deleted,
then the numbering of that column should be adjusted automatically.
Like
1st record - 1 A B D
2nd record - 2 A B C
3rd record - 3 A B D
4th record - 4 A B C
5th record - 5 E D F
If some user deletes 3rd record , then instead of showing the TMG as below
1st record - 1 A B D
2nd record - 2 A B C
3th record - 4 A B C
4th record - 5 E D F
the TMG should should show as
(I need that to be sequence column adjusted as )
1st record - 1 A B D
2nd record - 2 A B C
3th record - 3 A B C
4th record - 4 E D F
My thought is to write on new module in PAI,
and buils the logic in case of syst-ucomm = 'DELE'.
Please suggest me any function module availble or any good logic for this
Thanks in ADV.
This really isn't the way the TMG was meant to be used. Normally, one just uses it to manually add change or remove individual records, not a number of records based on some logic. It would probably be simpler to build a simple dynpro to take care of this.
Rob
Similar Messages
-
Portal Master-detail form how to auto assign detail record sequence number
Portal Master-detail form how to auto assign detail record sequence number.Please help me?
You can just read the following section
Can I specify a sequence number generator as the default value for a form column?
Yes. Enter the following in the "default value" field for the column:
#<schema name>.<sequence name>.nextval
where <schema name> is the name of the schema containing the sequence, and <sequence name> is the name of the sequence. The entry is preceded by a "#".
For example, if the schema name is "SCOTT", and the sequence name is "CUSTOMER_SEQ", the default value entry is:
#SCOTT.CUSTOMER_SEQ.NEXTVAL
same way you can do for master - detail form.
for more information on forms please refer the following URL.
http://otn.oracle.com/products/iportal/htdocs/portal_faq.htm#BuildingApplications
hope it helps. -
Sequence number in ADF FORM.
hi All,
I have a table with ID as primary key and have a sequence created for this primary key and have a trigger for generating sequence number while inserting the record in table.
How can i map this Sequence in ADF so while inserting record from Form i can skip the ID column.
Regards,
Suresh kumarI am using MySQL and primary key is auto incremented in my table. Therefore I have selected
SQL Plateform : SQL92
Data Type Map : Java
When I am trying to create entiry object, I do not get option of selecting DBSequence. I did some documents reading, I found out that DBSequence is part of "*Java Extended for Oracle*" Data type Map.
While creating the EO , in the Attribute Settings, I click the Browse and search for DBSequence. I found out oracle.jbo.domain.DBSeqence.
Can someone please let me know that I am going to face any problem in future by using DBSequence in his manner?
Thanks in Advance. -
XML insertion/updation using merge and generate sequence number
Hi,
I am working on Oracle 11g.
I have a doubt with XML load.
I get an xml and I have to insert or update data into a table A. This I can achieve using MERGE statement.
But there is one column in Table A, that I need to populate with a sequence number, based on the data sent in the xml.
The xml does not send this column data.
And I have to make sure the sequence is created based on the order in which records are present in xml.
For example the MERGE is inserting five rows and then updating next two rows and again inserting 3 rows from xml into table A. The sequence number should be created in the same order for the column in table A.
Also for each new xml, the sequence starts with 1 and ends with the number of records in the xml. So I cannot create a sequence and use seq.nextval.
Please let me know, there is a way of achieveing this.
Thank you!
Edited by: 934451 on Aug 8, 2012 6:33 AM
Edited by: 934451 on Aug 8, 2012 6:50 AMHi,
Following up on your previous thread : {thread:id=2403469}
You can use the FOR ORDINALITY clause in XMLTable to generate the required sequence :
MERGE INTO target_table t
USING (
SELECT x.seq_num, x.pk_id, x.col1, x.col2, ...
FROM XMLTable(
'/root/record'
passing my_xml_doc
columns seq_num FOR ORDINALITY
, pk_id number path 'ID'
, col1 varchar2(30) path 'COL1'
, col2 varchar2(30) path 'COL2'
) x
) src
ON ( t.pk_id = src.pk_id )
WHEN MATCHED THEN UPDATE
SET t.seq_num = src.seq_num
, t.col1 = src.col1
, t.col2 = src.col2
WHEN NOT MATCHED THEN INSERT
(seq_num, pk_id, col1, col2, ...)
VALUES (src.seq_num, src.pk_id, src.col1, src.col2, ...)
; -
How to create an INSERT trigger which creates a "sequence number"
Imagine a table T_Q with columns C_1, C_2, C_3 and UN_123.
C_1, C_2 and C_3 are all numeric and given by the user.
UN_123 has to be a calculated sequence number starting by 1 and incremented by 1 for each combination of C_1, C_2 and C_3, i.e., the sequence number depends on the key values C_1, C_2 and C_3.
Could anybody provide a code sample on how to create a BEFORE INSERT trigger , which calculates the value of the column UN_123 based on the values of C_1, C_2 and C_3 ??
Premise: Rather than using any sequence, the trigger code should only be based on the table T_Q
null<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Rainer Wagner ([email protected]):
Imagine a table T_Q with columns C_1, C_2, C_3 and UN_123.
C_1, C_2 and C_3 are all numeric and given by the user.
UN_123 has to be a calculated sequence number starting by 1 and incremented by 1 for each combination of C_1, C_2 and C_3, i.e., the sequence number depends on the key values C_1, C_2 and C_3.
Could anybody provide a code sample on how to create a BEFORE INSERT trigger , which calculates the value of the column UN_123 based on the values of C_1, C_2 and C_3 ??
Premise: Rather than using any sequence, the trigger code should only be based on the table T_Q<HR></BLOCKQUOTE>
null -
I aGenerating a Sequence Number within a String
Hi folks,
I am trying to create a control file which I would be using for load records using SQL*Loader. I need to generate the Sequence Number and use the value for the column REQ_NUM. I have a file TEST.TXT which contains 30 records with STUDENT_ID. I would like to create a control file because I want to load all 30 rows with the same REQ_NUM.
Here is what I have but I need to get the value of the Sequence Number.
spool testing.ctl
'load data infile 'TEST.TXT'
select
'append into table DUMMY_TABLE
FIELDS TERMINATED BY '','' optionally enclosed by ''"''
trailing nullcols
(req_num CONSTANT "select req_num_seq.nextval from dual",
student_id)'
from dual;
spool off;
exit 0;
{code}
Any help is greatly appreciated. I am on Oracle 9i.Sorry to have made this complicated but all I want to do is my output of the SQL as something like this.
Now, I have a Sequence out there that I was planning on using. Assuming that the Sequence is currently at 362, so when I run the SQL, I should get this output below. Makes sense ?
append into TEST_TABLE
FIELDS TERMINATED BY ',' optionally enclosed by '"'
trailing nullcols
(req CONSTANT '363',
student_id)
{code} -
Sequence number in pre-insert form trigger
i have two tables invoice (master) inv_detail(detail) and assign the invoice number using a sequence number,
by writing the folowing code in the pre-insert trigger
select a.nextval into :inv_no from dual;
( i make the trigger at the form level becuause i have a master (invoice) and detail (inv_detail) relation at the same screen,so i must fetch the value of the
sequence into the :invo_no in the screen,to let the 'copy value from' property at the detail block works so the value of the foreign key will be copied from
the sequence number at the screen.
will this method be a good one for multi user envirment(to select the a.nextval in the pre-insert trigger at the from level?)Kevin, thank you for the correct explanation. I was making an assumption and of course it was wrong.
Mohannad, please do not try to link the invoice count with the sequence number. Any time you need a count, just do a select count(*). The sequence number is ONLY a unique key, and should represent nothing else.
People have discussed this situation heavily. If you insist on trying to ensure there are no gaps, you will:
1. Fail -- there are many scenarios where gaps will occur.
2. Waste your time.
3. Whatever process you build to try to prevent gaps will cause unnecessary overhead and work for the server, and in a multi-user environment, cause processing bottlenecks due to table locks. -
Sequence number/counter in File name using FTP
Hi
I have to add sequence number in the file name. How can i do that? everytime file generates it should pick up the latest file number.
Example File1 File2 File3. 1,2 and 3 are the sequnce number.
RegardsHi ria,
You can do this by dynamic file creation. Use this following code and cretate an UDF. The map the required file format to the target header structure as below;
UDF
sequence number:
IDENTIFIER is the parameter
Import com.bp.xi.util.*;
Code:
return ServiceUtil.getSequenceValue( IDENTIFIER, container, false );
Dynamic file:
Key & Value is the parameter
Code:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get( StreamTransformationConstants.DYNAMIC_CONFIGURATION );
DynamicConfigurationKey confkey = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", Key );
conf.put( confkey, Value );
return "";
Input parameter "Key" is given a constant value"FileName"
Second parameter "Value" is the file pattern
Mapping
Constant(File)concat function sequence numberUDF ==> Dynami File udf ==>target header record.
In the receiver communication channel check the adapter specific function, filename
points if useful
regards,
Murugavel -
Enq: TX - row lock contention in forms 10g sequency number generation
Iam Getting the Deadlock issue in oracle formdeveloper 10g database is 11g Acutually in our small Hospital organization using different forms generating entrying labrequest form finally save time
one sequency number will generated i have give procedure below every save criteria form using below procedure some time iam getting lock iam using blocksession query i have find out some
OSUSER
MACHINE
TERMINAL
PROGRAM
SQL_ID
LOGON_TIME
BLOCKING_SESSION_STATUS
BLOCKING_SESSION
EVENT
user423
UMCCDOM\LEVEL4-MICU
LEVEL4-MICU
PrjMcr.EXE
0ccngw7dfkmgb
23/09/2013 11:34:41 AM
VALID
277
enq: TX - row lock contention
SYSTEM
WORKGROUP\PRIAPPSVR
PRIAPPSVR
frmweb.exe
0ccngw7dfkmgb
23/09/2013 11:32:50 AM
VALID
186
enq: TX - row lock contention
SYSTEM
WORKGROUP\PRIAPPSVR
PRIAPPSVR
frmweb.exe
0ccngw7dfkmgb
22/09/2013 2:49:47 PM
VALID
277
enq: TX - row lock contention
SYSTEM
WORKGROUP\PRIAPPSVR
PRIAPPSVR
frmweb.exe
0ccngw7dfkmgb
23/09/2013 7:00:22 AM
VALID
186
enq: TX - row lock contention
user290
UMCCDOM\LEVEL2-N
LEVEL2-N
PrjMcr.EXE
0ccngw7dfkmgb
23/09/2013 10:28:06 AM
VALID
277
enq: TX - row lock contention
lock are happen after open the code i have find out used FOR UPDATE in procedure please tell me any alternative for this every labrequest form saving time using this procedure for generating prefix sequence number multiple user using with different systems
PROCEDURE Gsp_GenSeqNum (I_SvPrefixCd IN VARCHAR2,I_SvUserName IN VARCHAR2,
O_SvSeqNum OUT VARCHAR2) IS
--This Procedure generates the sequence number
--by retrieving the prefix based on the code
--supllied to the procedure.
CURSOR crSeqGenerator IS
SELECT Gsn_prefix_last_num, Gsn_prefix_year
FROM G_SEQUENCE_NUMBER
WHERE Gsn_prefix_Cd = I_SvPrefixCd
AND Gsn_prefix_year = TO_CHAR(SYSDATE,'YYYY')
FOR UPDATE OF Gsn_prefix_last_num;
udSeqNum G_SEQUENCE_NUMBER.Gsn_Prefix_last_num%TYPE;
udNextSeqNum G_SEQUENCE_NUMBER.Gsn_Prefix_last_num%TYPE;
udYear G_SEQUENCE_NUMBER.Gsn_Prefix_year%TYPE;
udPrefix G_SEQUENCE_PREFIX.Gsp_Prefix_Value%TYPE;
BEGIN
SELECT Gsp_Prefix_Value
INTO udPrefix
FROM G_SEQUENCE_PREFIX
WHERE Gsp_Prefix_Cd = I_SvPrefixCd;
OPEN crSeqGenerator;
FETCH crSeqGenerator
INTO udSeqNum,
udYear;
IF crSeqGenerator%FOUND THEN
udNextSeqNum :=udSeqNum + 1;
O_SvSeqNum := udPrefix||'/'||TO_CHAR(SYSDATE,'YY')
||'/'||LPAD(TO_CHAR(udNextSeqNum),6,'0');
ELSE
INSERT INTO G_SEQUENCE_NUMBER VALUES(I_SvPrefixCd,TO_CHAR(SYSDATE,'YYYY'),0,I_SvUserName,SYSDATE);
udSeqNum :=0;
udNextSeqNum :=udSeqNum + 1;
O_SvSeqNum:=UdPrefix||'/'||TO_CHAR(SYSDATE,'YY')
||'/'||LPAD(TO_CHAR(udNextSeqNum),6,'0');
END IF;
UPDATE G_SEQUENCE_NUMBER
SET Gsn_Prefix_last_num=udNextSeqNum
WHERE Gsn_Prefix_Cd = I_SvPrefixCd
AND Gsn_Prefix_year=TO_CHAR(SYSDATE,'YYYY');
CLOSE crSeqGenerator;
END Gsp_GenSeqNum;
Thanks
subbuThis application is inbuit with some modules VB (cath ,cardio)and oracle forms for required sequence number generation different time used this procedure whereever required the sequence Prefix generation.If i replace the procedure sequene to oracle standard sequency if the user cannot save the form unnessary sequency generated order is missing from sequence.
-
Sequence Number By Date Option For File Naming
I would like to see Lightroom have the option to have the sequence numbers be reset when the date changes and increment accordingly. For example, I have the file naming set to use Date (YYYYMMDD) Sequence Number (0001) and the sequence number starting at 1. As Lightroom is now I will end up with 200909010001, 200909010002, 200909020003, 200909020004, 200909030005 200909030006 etc. and what I would like to see is the option for 200909010001, 200909010002, 200909020001, 200909020002, 200909030001 200909030002.
This would make it much faster for renaming or import when using this combination of date and sequence in file names.Hi
For the Transport Protocol "File Transfer Protocol (FTP)" files are always processed in ascending alphabetical order
If you want the file to be processed in sequence then you can use Quality of Service EOIO in the sender adapter.
The files are processed in the sequence they are picked up.
otherwise use BPM for File Sequencing..
Refer the following Threads
FTP Sender Adapter - Processing Sequence
Processing Sequence issue of FTP protocol
Regards
Abhijit
Edited by: Abhijit Bolakhe on Nov 4, 2009 10:32 AM -
CM25 Sequence Number Maintenance View
Dear guru ,
i enter sequence number operation in the specific view of CM25.
In the sequence number maintenance view the production orders are sorted in order of production order number.
I want that production orders are sorted in this view in order of sequence number operation.
How can i do this ?
Thanks in advance.I assume that you want to display the sequence number of each order in the mid and lower graphic panel, is that ?? And be able to sort order based in this field ?
Try this
Customizing
Production Planning
Capacity Leveling - Transaction: OPD0 : Overall profile
Go to list Profile: SAPSFCI001
Goto Profile for list variant: SAPSFCD001
Check also the profile for evaluation;
Subprofile for displayed fields: SAPSFCF0
Subprofile for sort criteria: SAPSFCS0
make the required changes, adding Sequence as field
I would suggest to create a complete set of new Z profiles.
Regards -
Gnerating sequence number in OSB
I have a proxy service which picks up XML messages from a JMS queue. I want to insert a running sequence number in one of the node of the XML. I then want to call a business service which will send the XML out via a webservice.
Is there a option in OSB where I can generate a sequence number or do I have to use the database or is there some option in jms queue. Can the JMS correlation Id be a running sequence number?
Note: The sequence number will have to be unique and should continue the sequence even after server restart.
Appreciate your help on this.
RegardsPlease check this post.
Using Weblogic jms message id for unique id
Weblogic's JMS Message ID's are statistically unique and it has a timestamp component included in it... So you can expect an increasing sequence. -
i have a small doubt :
when there is log switch , the current log sequence number is stored in the control file . Is the same current log sequence number stored in the headers of the datafiles??????
waiting for your answers eargerly.....
kumaresan.Mnops i don think so.
there is no need for doing this, only controlfile needs to know about the current sequence number
Regards -
Batch rename without sequence number
In LR3 I originally named imported images with the date, custom
word, and sequence number. I now want to batch rename with just the date, and cust
om word - no sequence number. Yet the rename includes the
numbers anyway, and they are different than the original sequence numbers. How do I get rid of
the unwanted numbers? ThanksI don't think LR provides a way to cut characters from the end of an existing filename.
Beat Gossweiler
Switzerland -
I need some help coming up with some SQL that I can put in an Insert Trigger to generate a unique id. The unique ID is composed of the two digit year, the two digit month, and a four digit sequence number. At the beginning of each month, the sequence part of the number should be reset to 0001.
An example of the data follows:
02110001
02110002
02110003
02120001
02120002
02120003
Thanks in advance for any help/advice.Creating the unique key is relatively straight forward.
CREATE SEQUENCE monthly
START WITH 1 INCREMENT BY 1 NOCACHE;
CREATE TRIGGER my_trigger
BEFORE INSERT ON my_table
FOR EACH ROW
BEGIN
:new.unique_id := TO_CHAR(sysdate,'yymm')||TO_CHAR(monthly.nextval,'fm0000');
END;Depending on your version of Oracle, you may need to select it into a variable from dual before assigning to :new.unique_id. To reset the sequence at the beginning of the month, you could use DBMS_JOB, or cron to run a procedure that drop and re-create the sequence at midnight.
John
Maybe you are looking for
-
Solaris 8 installation Help 28/02/02
Dear All I have download the companion Intel platform Edition, Solaris/Intel 427.65 Mb and unzip it by using the winzip. ( The folder name is s8ccd-7_01-i386)When i double clicked it straight away went to easy cd creator and automatically selecting c
-
Hello all. I've created document templates in Word 07 that my coworkers will be using to import(copy/paste) and create new instruction sheets/SOPs. I've been able to use content controls to structure the templates, but my primary goal now is to fin
-
I should be able to do this, but I am not. I want to change the formatting of negative numbers in tables from - to (). Fine I can do that (thanks to help from this Forum). First I do a Grep find/replace "-(?=.+)" to "(" Then "\A\(.+\Z" to "$0)" Happy
-
I was away from my mac for a couple of months. Today, trying to open my Photoshop CS4 I get the 150:30 error message. Any ideas how to fix this?
-
HH 1.5 having a nervous breakdown?
Our HH 1.5 (black) has started to randomly reboot. It's been pretty reliable, and has required only an occasional power cycle when something gets stuck that prevents web sites connecting. Now it resets quite often, and usually at a lousy 2Mbps. We've