Seq number
Hi,
I have a master detail form.1 master block and 1 detail block.
The join field name is called join_seq.
I have a database sequence and i want to put the sequence number as a value for join_seq.
In the pre_insert trigger of the form i wrote
select my_seq.nextval into :master_block.join_seq from dual;
But for the detail block how i can pass the value of the sequence.When I say in the detail block ,copy value from the master block its not saving the detail block.
Which is the best way to do this.
Please help.
thanks and regards
Ajith
Oracle forms save first block first and second block at next. if your detail block is the first block and master block is in the hirarchy next then this will generate error due to missing of column value in detail block
Similar Messages
-
Query for row by rows-before using seq number
Hi,
I have a table of CatalogAuthor records
long : id
varchar : author
long : seqnum
I have made the table so that initially, if there are 10000 unique authors, then the rows will have sequence numbers from 1 to 10000. As authors are dynamically added, they are given the sequence number of an existing row in the table, i.e. the nearest row whose author comes before the new author. As time goes there are more and more duplicates, and at a certain point, the table has all its sequence numbers reassigned to be monotonic increasing by author name order.
We want to use this table to build a tree of about 10 nodes per parent, culminating in author names. So to expand the tree at the first level, we could divide 10000 by a suitable power of 10 to get the groups of sequence numbers. However, with duplicate seqnum, there may be 14365 rows so ideally, to overcome the problem of clumping, I would do some kind of query to identify the 1436 record in sorted order by sequence number, the 2872 record by seq number and so on.
What query would that be? With appropriate indices, would it still be slow? Would I have to do 10 of these queries to expand one node with 10 children? Is there a better design to accomplish the same goal of exploding a balanced tree by author name sort order, culminating in a leaf of one particular author?
AndyHi, Andy,
user9990110 wrote:
Hi,
I have a table of CatalogAuthor records
long : id
varchar : author
long : seqnumYou can't be serious! The LONG data type is nothing but trouble, and completely unnecessary. You must mean NUMBER instead of LONG.
I have made the table so that initially, if there are 10000 unique authors, then the rows will have sequence numbers from 1 to 10000. As authors are dynamically added, they are given the sequence number of an existing row in the table, i.e. the nearest row whose author comes before the new author. As time goes there are more and more duplicates, and at a certain point, the table has all its sequence numbers reassigned to be monotonic increasing by author name order.
We want to use this table to build a tree of about 10 nodes per parent, culminating in author names. So to expand the tree at the first level, we could divide 10000 by a suitable power of 10 to get the groups of sequence numbers. However, with duplicate seqnum, there may be 14365 rows so ideally, to overcome the problem of clumping, I would do some kind of query to identify the 1436 record in sorted order by sequence number, the 2872 record by seq number and so on.
What query would that be? With appropriate indices, would it still be slow? Would I have to do 10 of these queries to expand one node with 10 children? Is there a better design to accomplish the same goal of exploding a balanced tree by author name sort order, culminating in a leaf of one particular author?I'm just curious, why do you need this? What will this tree structure do for you that an index on author won't do?
I don't know of any way to automatically keep a tree balanced every time DML is done.
You could periodically re-balance the tree; that shouldn't be too hard. Let's say you want each parent to have up to r children. Use the analytic ROW_NUMBER function to assign unique numbers 0, 1, 2, 3, ... to each row, in order by author.
The row numbered 0 will have no parent
For all all rows numbered n (n > 0), the parent will be the row numbered FLOOR (n/r).
Whenever you re-configure the tree, use a MERGE statatment. An index on author will probably make generating the ROW_NUMBERs faster.
If you need help, post CREATE TABLE and INSERT statements to show the table as it exists with the tree out of balance, and also show how you want it to look after balancing. Use a small value of r (maybe 2 or 3) to keep the sample set small.
Edited by: Frank Kulash on Jan 12, 2011 12:41 PM -
SEq number logic on Tax on sls/purch.adv.ret (RFUMSV00 report)
Hi experts,
I have a question about the RFUMSV00 report (Tax on sls/purch.adv.ret). My question is about the first field on the result list (fyeldSequ. Number) I dont know what the criteria for assigning this numbers is. Does anybody know this logic?
Ive tried debugging the program but this code is too difficult to understand for me. It would be very helpful for me to know that.
Thank you very much,
Artur RodríguezI do not need this any more.
-
Query to find attachement information for wip operation seq number
Hi Experts,
I am working on EBS 11.5.10 and database 9i. I want table link to find attachments for particular operation sequence number.
Navigation:
WORK IN PROCESS --> DISCRETE JOBS --> OPERATIONS --> ATTACHMENTS(IN MENU YOU CAN FIND).
In operations screen, for each operation sequence number, you can have attachement.In attachement, i want to pick the remarks column.
Table: OPERATIONS -- WIP_OPERATIONS
ATTACHEMENTS - FND_ATTACHED_DOCS_FORM_VL
REMARKS - fnd_documents_short_text
Link between FND_ATTACHED_DOCS_FORM_VL and fnd_documents_short_text is media_id. But i am not able to find the link between wip_operations and fnd_attached_docs_form_vl.
Could anybody help me how to get attachement data for a particular operation sequence number.
Thanks in advance.The link is
entity_type = 'WIP_DISCRETE_OPERATIONS' and
pk1_value =wip_entity_id and
pk2_value = operation_seq_num and
pk3_value = organization_idHope this answers your question,
Sandeep Gandhi -
is there any difference between the scn number and the log sequence number.please say me
Regards
Aramdo NOT cross/multi-post
scn number -
HI
my logic is like this with material document number i need to increse the sequence number. my doc will be having same mat number as well different mat numbers.
i did the coding like this below
data: wcount(6) type n.
data: wrecord(6) type n VALUE '000000'.
describe table t_z4b2 lines wrecord.
clear t_z4b2.
read table t_z4b2 index wrecord.
write t_z4b2-wseqno+5(6) to wrecord.
wrecord = wrecord + 1.
describe table 4b2tbl lines wcount.
if wcount > 0.
loop at 4b2tbl.
at new wmblnr. wrecord = wrecord + 1. endat.
concatenate preatsg wrecord into 4b2tbl-wseqno.
modify 4b2tbl.
move-corresponding 4b2tbl to t_z4b2.
append t_z4b2.
endloop.
modify z4b2 from table t_z4b2.
endif.
endform. "GetSeqNoUr requirement is not so clear hence difficult to comment on the logic but as per the interpretation of your code it would try and do the below.
1. It counts the records from t_z4b2 table.
2. Increment the counter to total records in t_z4b2 by 1.
3. Loops at 4b2tbl and at each new wmblnr increments the counter by 1 and uses the same to update.
Here, U dont need wcount check as loop would not execute if the table 4b2tbl has no records. Secondly, the counter is incremented twice before the first document.(Since you increment it after the describe table t_z4b2 and also in at new event.)
Regards
Anurag -
Need to display seqno along with his superior number
Hi friends,
I have a table adm_menus
It's DDL is
CREATE TABLE "ADM_MENUS"
( "MENU_ID" NUMBER,
"MENU_NAME" VARCHAR2(60 BYTE),
"PARENT_MENU_ID" NUMBER,
"SEQ_NO" NUMBER,
"DISP_SEQ_NO" VARCHAR2(250 BYTE),
"MENU_ACTION_TYPE" VARCHAR2(60 BYTE),
"MENU_ACTION" VARCHAR2(2000 BYTE),
"MENU_PARAMETER" VARCHAR2(2000 BYTE),
"INACTIVE_DATE" DATE,
"CREATED_BY" NUMBER(15,0),
"CREATION_DATE" DATE,
"LAST_UPDATED_BY" NUMBER(15,0),
"LAST_UPDATE_DATE" DATE
)DML is
Insert into ADM_MENUS (MENU_ID,MENU_NAME,PARENT_MENU_ID,SEQ_NO,DISP_SEQ_NO,MENU_ACTION_TYPE,MENU_ACTION,MENU_PARAMETER,INACTIVE_DATE,CREATED_BY,CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE)
values (19,'TRANSACTION',null,10,'10',null,null,null,to_date('12-10-11','DD-MM-RR'),-1,to_date('12-10-11','DD-MM-RR'),-1,to_date('12-10-11','DD-MM-RR'));
Insert into ADM_MENUS (MENU_ID,MENU_NAME,PARENT_MENU_ID,SEQ_NO,DISP_SEQ_NO,MENU_ACTION_TYPE,MENU_ACTION,MENU_PARAMETER,INACTIVE_DATE,CREATED_BY,CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE)
values (18,'TRANSACTION',19,10,'10',null,null,null,to_date('12-10-11','DD-MM-RR'),-1,to_date('12-10-11','DD-MM-RR'),-1,to_date('12-10-11','DD-MM-RR'));
Insert into ADM_MENUS (MENU_ID,MENU_NAME,PARENT_MENU_ID,SEQ_NO,DISP_SEQ_NO,MENU_ACTION_TYPE,MENU_ACTION,MENU_PARAMETER,INACTIVE_DATE,CREATED_BY,CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE)
values (20,'Report1',18,30,'3010',null,null,null,to_date('12-10-11','DD-MM-RR'),-1,to_date('12-10-11','DD-MM-RR'),-1,to_date('12-10-11','DD-MM-RR'));My scenario in the sense is i need to display the results for the disp_seq_no column like
Since from the above DML statement i have three rows, For my explanation im taking four columns
menu_id------->parent_menu_id-------------->seq_no------------>Disp_seq_no
19 null 10
18 19 10
20 18 30For the above rows i need to display the rows for the column disp_seq_no as
For the first row from the above result the parent_menu_id is null(so, in my case he is the parent and there is no any superior to him, so his disp_seq_no has to be '010'(i.e his seq_no with *'0' infront of it*.)
For the second and third row i need like
menu_id------->parent_menu_id------------->seq_no------------>Disp_seq_no
19 null 10 010
18 19 10 010010
20 18 30 010030For the second row, he has the parent menu id as '19', so i need his disp_seq_no like (his parents seq_no and his own Seq_no(but i need '0' infront of each and every seq number)) like
010010
For the third row, he has the parent menu id as '18', so the disp_seq_no has to be 010030
How i can able to achieve it friends.
Brgds,
Mini/* Formatted on 10/12/2011 9:57:19 AM (QP5 v5.149.1003.31008) */
WITH ADM_MENUS
AS (SELECT 19 menu_id, NULL parent_menu_id, 10 seq_no FROM DUAL
UNION
SELECT 18, 19, 10 FROM DUAL
UNION
SELECT 20, 18, 30 FROM DUAL)
SELECT menu_id,
parent_menu_id,
seq_no,
CASE CONNECT_BY_ISLEAF
WHEN 0
THEN
REPLACE (SYS_CONNECT_BY_PATH (seq_no, ','), ',', '0')
ELSE
SUBSTR (REPLACE (SYS_CONNECT_BY_PATH (seq_no, ','), ',', '0'),
LENGTH (SYS_CONNECT_BY_PATH (seq_no, ',')) - 5)
END
disp_seq_no
FROM ADM_MENUS
START WITH parent_menu_id IS NULL
CONNECT BY PRIOR menu_id = parent_menu_id
19 10 010
18 19 10 010010
20 18 30 010030 -
Sequence number in process order
Hi,
Kindly brief about usage of sequence number, which is in process order with example. Is this can be used for capacity leveling. If so how that can be done.
If one sequence number is assigned to multiple process orders means double entries, then what is the impact during capacity leveling based sequence number.
Is number range is maintained any where in SPRO for sequence number. If so where? Is there any possibility to maintain number range for sequence number if required?
Thanks & Regards,
N. Laxman1.Seq. number in an order
Number that can be assigned to production orders or planned orders at the level of the task list header and is therefore valid for all the operations in an order.
The sequence number is used to sort the orders for the display on the planning table and to
form a dispatching sequence using the sort key.
3. -
Select from table in group of columns and generate a sequence number
I have to select data from a table in group of columns and generate a sequence for every group resetting the sequence to start from 1 onwards.
For example:
Data:
Col1 Col2 Col3 Col4
A NA KA 2009-08-13
B NA KA 2009-08-13
C NA KA 2009-08-13
A NA KA 2009-08-13
B NA KA 2009-08-13
A NA KA 2009-08-13
Expected output from Select Statement:
Col1 Col2 Col3 Col4 Seq_No
A NA KA 2009-08-13 1
A NA KA 2009-08-13 2
A NA KA 2009-08-13 3
B NA KA 2009-08-13 1
B NA KA 2009-08-13 2
C NA KA 2009-08-13 1
How can this be possible with a SELECT statement? Is it possible to assign seq numbers for a group of columns and reset it when it changes? In the above example, all columns form the key to generate the seq number
I know it can be done using Stored procedures and that is how I am doing it now by introducing a temporary table.
Can anyone help me in this regard? Please let me know if the question is vague to understand!
Thanks,
Nachiwith t as(select 'A' col1,'NA' col2 ,'KA' col3,'2009-08-13' col4 from dual
union all
select 'B' col1,'NA' col2 ,'KA' col3,'2009-08-13' col4 from dual
union all
select 'C' col1,'NA' col2 ,'KA' col3,'2009-08-13' col4 from dual
union all
select 'A' col1,'NA' col2 ,'KA' col3,'2009-08-13' col4 from dual
union all
select 'B' col1,'NA' col2 ,'KA' col3,'2009-08-13' col4 from dual
union all
select 'A' col1,'NA' col2 ,'KA' col3,'2009-08-13' col4 from dual)
select t.*,row_number() over (partition by col1,col2,col3,col4 order by col1,col2,col3,col4) from tYou can replace partition by col1,col2,col3,col4 with only columns that you need for grouping condition
and also order by you can just do on the column you need. -
Hi,
Can any body explain me regarding Sequence number in an assignement tab page of a Production Order.
Under what circumstannces it is used and How?
Regards,
PrasadSAP help for this issue
Seq. number order
Number that can be assigned to production orders or planned orders at the level of the task list header and is therefore valid for all the operations in an order.
Use
The sequence number serves:
To sort the orders for the display on the planning table and
To form a dispatching sequence using the sort key. -
How to query in bpm to generate next seq key
Hi,
I am working in 5.7 and DB2, I am able to insert a record in a table using Fuego.Sql.SqlObject.store() provided i assign the primary key value
prmary key needs to be generated using 'SELECT NEXT VALUE FOR BPMPR.BPM_KEY_SEQ FROM SYSIBM.SYSDUMMY1'
This query returns the next seq number outside bpm. but when i use it with in bpm, it complains : Unexpected value
Suggest me how to get the sequence key which is returned by 'SELECT NEXT VALUE FOR BPMPR.BPM_KEY_SEQ FROM SYSIBM.SYSDUMMY1' query.
I cannot use 'SELECT max(rqstKey) as nxtrqstKey FROM BPMPR.TABLE' to get the primary key value
Thanks!Hi
The first thing you might want to try is to change your logic in ALBPM to use Dynamic SQL to run your query.
Here's the syntax that might work. The logic below assumes you named your database External Resouce "DbWithTheMostest".
nextId as String[]
query as String = "SELECT NEXT VALUE as nxtRqstKey FOR BPMPR.BPM_KEY_SEQ FROM SYSIBM.SYSDUMMY1"
externalResourceName as String = "DbWithTheMostest"
for each row in executeQuery(DynamicSQL, sentence : query, implname : externalResourceName) do
// keep adding customer names to the array until all the customers have been added
nextId[] = " " + row["nxtRqstKey "]
end
The second thing you might want to try is to catalog an SQL Query (vs. SQL). During the introspection, you'll be prompted to enter your sql.
Hope this helps,
Dan -
I am having the data as like below(sample data)
Col1 Col2
A AA
A BB
A CC
B BA
B BB
C CA
D DA
D DB
E EA
E EB
I want to show the seq number as a third column as like below. (seq number is with respect to Col1)
Col1 Col2 num
A AA 1
A BB 1
A CC 1
B BA 2
B BB 2
C CA 3
D DA 4
D DB 4
E EA 5
E EB 5
Thanks in Advance,
BalaHi,
Try this
WITH T AS (
SELECT 'A' AS COL1, 'AA' AS COL2 FROM DUAL UNION ALL
SELECT 'A','BB' FROM DUAL UNION ALL
SELECT 'A','CC' FROM DUAL UNION ALL
SELECT 'B','BA' FROM DUAL UNION ALL
SELECT 'B','BB' FROM DUAL UNION ALL
SELECT 'C','CA' FROM DUAL UNION ALL
SELECT 'D','DA' FROM DUAL UNION ALL
SELECT 'D','DB' FROM DUAL UNION ALL
SELECT 'E','EA' FROM DUAL UNION ALL
SELECT 'E','EB' FROM DUAL)
SELECT COL1, COL2, RANK() OVER (partition by col1 order by col2) FROM Tor
WITH T AS (
SELECT 'A' AS COL1, 'AA' AS COL2 FROM DUAL UNION ALL
SELECT 'A','BB' FROM DUAL UNION ALL
SELECT 'A','CC' FROM DUAL UNION ALL
SELECT 'B','BA' FROM DUAL UNION ALL
SELECT 'B','BB' FROM DUAL UNION ALL
SELECT 'C','CA' FROM DUAL UNION ALL
SELECT 'D','DA' FROM DUAL UNION ALL
SELECT 'D','DB' FROM DUAL UNION ALL
SELECT 'E','EA' FROM DUAL UNION ALL
SELECT 'E','EB' FROM DUAL)
SELECT COL1, COL2, dense_RANK() OVER (order by col1) FROM T@peter - apologies for replying to your post
cheers
VT
Edited by: VT on Jan 27, 2011 7:47 PM -
Update sequence number in PLAF table.
Hi
There is a requirement where I have to update sequence number for Planned Order in ECC.
Sequence Data is stored in PLAF-SEQNR field [Seq. number order].
BAPI_PLANNEDORDER_CHANGE did not work for me. There are only 27 field which i think we can edit (ie field in import parameters BAPIPLAF_I2).
So can someone help me to find a way to update PLAF-SEQNR.
Thanks
BhaveshUse an Enhancement Spot
-
Hi,
I was wondering if there is an easy way to get a seq number column (1, 2, ....) for a select statement.
select empno, ename, 'seq' from emp
order by ename
==RESULTS==
empno ename seq
1234 John Smith 1
5678 Mary Smith 2
ThanksHmm, it works for me.
SQL> select empno, ename, dname, rownum seq
2 from (select empno, ename, dname
3 from emp e,
4 dept d
5 where e.deptno = d.deptno
6 order by ename
7 );
EMPNO ENAME DNAME SEQ
7876 ADAMS RESEARCH 1
7499 ALLEN SALES 2
7698 BLAKE SALES 3
7782 CLARK ACCOUNTING 4
7902 FORD RESEARCH 5
7900 JAMES SALES 6
7566 JONES RESEARCH 7
7839 KING ACCOUNTING 8
7654 MARTIN SALES 9
7934 MILLER ACCOUNTING 10
7788 SCOTT RESEARCH 11
7369 SMITH RESEARCH 12
7844 TURNER SALES 13
7521 WARD SALES 14
14 rows selected. -
Hope someone can help. I have a request from client to print a sequential number on an avery label. For example, if i used address labels that were 30 to a page, the first label would have 1 and the second label would have 2, etc. No data is being printed so i don't have a table, just the seq number. Am i missing something easy here or can it not be done in crystal 2008.
Thanks for any help or suggestions.
JeffJeff,
There's no reason to use Access, Excel, or any other outside application. A just about any modern database will support the use of temporary tables... and that's all you need.
If your report is built be using linked tables, add the following code as a SQL Command (tested in SQL Server)
DECLARE @SeqNum INT, @MaxValue INT;
SET @SeqNum = 1
SET @MaxValue = (SELECT MAX(SequenceNumber) FROM TableName)
IF object_id('tempdb..#MyTempTable') IS NOT NULL
BEGIN
DROP TABLE #MyTempTable
END
CREATE TABLE #MyTempTable (SeqNum INT)
WHILE @SeqNum < @MaxValue
BEGIN
INSERT INTO #MyTempTable (SeqNum) Values (@SeqNum)
SET @SeqNum = @SeqNum + 1
END
SELECT SeqNum FROM #MyTempTable
1) Be sure to alter line 3 of the code, where is says set @MaxValue = , so that it is pulling the maximum sequence number from your table... This will make sure the proper number of rows are created... Not too many, not too few.
2) Link this back to your table using an LEFT OUTER JOIN... With the new command on the left side.
-- If you are already using a command to pull your data, just add this code to the existing command and reference the #MyTempTable in the main select statement.
HTH,
Jason
Maybe you are looking for
-
Problem with TMS setup in HA systems
Dear colleagues, Our team have installed a new production environmnent to ECC in HA. We have a ASCS in cluster and two dialog instance in each server(local instance). A virtual host GPPR3CIB and two instances in local, node GPPR301 and node GPPR302.
-
My website looks different!
Hello, I need some help please. I created a website using Dreamweaver MX. i upload mypages by logging into bluehost and using their ftp. Anyway for a while my website was fine and no problems. I updated it last week in dreamweaver, but when i upload
-
hi, what i s the se16n table to view all the paymen terms pls let me know
-
Quick Java version question...
I'm unable to use VNC while connected through a semi-restricted VPN tunnel into work (I have to visit a certain website at work and when I click a button an Aventail application springs into life and I get a VPN tunnel). My work doesn't support Macs,
-
I forgot my sercurity answers, how to reset them
I forgot my security questions answers. how do you reset them?