Sequence of Table
How can I see If a table have a Sequence ?
tks
Check also this thread
Re: Keeping track of auto-incremented keys
Gints Plivna
http://www.gplivna.eu
Similar Messages
-
Sequence of tables in from clause and sequence of "where clause" conditions
Is Sequence of tables in "From Clause" and sequence of "where clause" conditions matters in 10g for performance?
Edited by: user6763079 on Jun 1, 2011 3:33 AMuser6763079 wrote:
Is Sequence of tables in "From Clause" and sequence of "where clause" conditions matters in 10g for performance?In general it does not matter.
It could matter if the Rule Based Optimizer (RBO) is used. However this RBO is only used if enforced by a hint or if no table statistics are collected. Starting from 10g the table statistics are automatically selected by a regular database job. So in general the CBO would be used.
The CBO will consider different access paths. If the number of tables is low enough, then all possible combinations are considered and the order does not make any difference.
Edited by: Sven W. on Jun 1, 2011 4:00 PM -
Polling for database updates fails to update sequence file/table
I have a small system to poll for changes to a database table of student details. It consists of:
Database adapter, which polls the database for changes, retreives a changed row, and passes the generated XML to -
"receive" router service, which simply passes the retrieved database XML data to -
"execute" router service, which transforms the XML and passes the new message to -
File Adapter, which writes the transformed XML to a file.
The problem is that the database polling is not updating the sequence recorder - I have tried using a sequence file which stores the personnumber, a sequence table which stores the personnumber and a sequence table which stores the last-updated timestamp. In all cases the database adapter successfully reads the sequence file/table and retreives the correct row, based on the sequence value ( I have tested this by manually changing the sequence value), the data is transformed and a correct xml file is created, but the system then fails to update the sequence file/table so that when the next polling time comes around the very same database row is extracted again and again and again.
In the ESB control panel I have one error: "Response payload for operation "receive" is invalid!"
The Trace is:
oracle.tip.esb.server.common.exceptions.BusinessEventRejectionException: Response payload for operation "receive" is invalid! at oracle.tip.esb.server.service.EsbRouterSubscription.processEventResponse(Unknown Source) at oracle.tip.esb.server.service.EsbRouterSubscription.onBusinessEvent(Unknown Source) at oracle.tip.esb.server.dispatch.EventDispatcher.executeSubscription(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscription(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.processSubscriptions(Unknown Source) at oracle.tip.esb.server.dispatch.EventDispatcher.dispatchRoutingService(Unknown Source) at oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(Unknown Source) at oracle.tip.esb.server.dispatch.BusinessEvent.raise(Unknown Source) at oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(Unknown Source) at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.processMessage(Unknown Source) at oracle.tip.esb.server.service.impl.inadapter.ESBListenerImpl.onMessage(Unknown Source) at oracle.tip.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:281) at oracle.tip.adapter.db.InboundWork.onMessageImpl(InboundWork.java:1381) at oracle.tip.adapter.db.InboundWork.onMessage(InboundWork.java:1291) at oracle.tip.adapter.db.InboundWork.transactionalUnit(InboundWork.java:1262) at oracle.tip.adapter.db.InboundWork.runOnce(InboundWork.java:501) at oracle.tip.adapter.db.InboundWork.run(InboundWork.java:401) at oracle.tip.adapter.db.inbound.InboundWorkWrapper.run(InboundWorkWrapper.java:43) at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242) at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215) at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819) at java.lang.Thread.run(Thread.java:595)
The payload is:
<PersonCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/ISSSimIN">
<Person>
<name>Bob</name>
<surname>Stupid</surname>
<istatus>2</istatus>
<active>Active</active>
<personnumber>3001</personnumber>
<role>Staff</role>
<organization>TEX</organization>
<updateTimestamp>2007-11-29T14:06:55.000+00:00</updateTimestamp>
</Person>
</PersonCollection>
The payload above is the XML output from the Database adapter, the xsd for which was autogenerated by JDeveloper, so I don't understand how it can be invalid.
I have only been working with ESB for 3 days, but half of that time has now been spent stuck on this issue. Anyone got any ideas??
RichardYou need to be careful. Submit and committing to the database are two different things.
Submit on a page (and autoSubmit the property) are only posting the changes you typed into the field, back down to the application server. NOTHING is happening with the database at this point. So the applications's internal "cache" of records (using something like ADF BC) is holding the changes but the database doesn't know anything. So if you quit now, no changes will go to the database.
These changes onlyget submitted down to the app server when you do some sort of action like press a button. Simply navigating fields will be doing nothing back to the app server. If you add autoSubmit then you will automatically submit the changes on that field down to the app server when you leave the field (but again, this is not touching the database)
You have to explicitly add a COMMIT operation to save those changes to the database.
Maybe if you try in a simple EMP example and send us your findings we can help direct you further.
Regards
Grant -
Problem with S001 - Key field Sequence in table
Hi,
We want to use the extractor 2LIS_01_S001 with Delta. But delta is not working with these extractor. When I checked LBW0, I am getting error "The LIS environment is setup incorrectly".
According to note 115192, the key fields in tables S001, S001BIW1 and S001BIW2 have to be in the same sequence.
But we are on 4.7 with following Support Packs:
SAP_APPL 470 0025 SAPKH47025 Logistics and Accounting
PI 2004_1_470 0007 SAPKIPZI57 R/3 Plug-In (PI) 2004.1 for
R/3 Enterpri
PI_BASIS 2004_1_620 0010 SAPKIPYI5A Basis Plug-In
(PI_BASIS) 2004_1_620
And according to this note, solution is delivered with this Support Packs.
Can you please tell me that if this note is mandatory for all the releases..?
Did any one encounter this issue before..?
Thanks & Regards,
Samay MehtaI changed my entity: unchecked the X column to be primary key added RowID as a primary key. Now it works.
What's wrong with my CHAR(1) as a primary key ?
I also tried to add a Refresh button:
<af:commandButton text="Refresh" id="cb3"/>and in the table add a partialTarget to the button. Now when I add new row and press the Refresh button - then it works.
So it seems that the problem is when I add new row and enter data, the table is not refreshed and the row is missing it's primary key.
Any solutions?
Edited by: a.gruev on Nov 26, 2009 4:18 PM -
Can't get Sequencing working (table or view does not exist...)
Hello,
I'm running JDeveloper 10.1.2 on a Oracle 9i database.
All my mappings are correct, i mean, i can query the database using the Toplink API and list all the objects on teh database. What it's not working is inserting new objects due to this sequencing problem.
This is what i'm doing:
myClass newObject = (myClass) uow.newInstance(myClass.class);
uow.assignSequenceNumber(newObject);
But this is generating this Exception:
Local Exception Stack: Exception [TOPLINK-4002] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.DatabaseExceptionException Description: java.sql.SQLException: ORA-00942: table or view does not exist
Internal Exception: java.sql.SQLException: ORA-00942: table or view does not exist
Error Code: 942
I figured this could be a problem with the sequencing configuration and all that stuff (I don't have a sequence table). So i checked my configurations...
'Toplink Mappings' is setup to 'Use Native Sequencing', as per Notes on http://www.boku.ac.at/oradoc/ias/10g(9.0.4)/web.904/b10313/dataaccs.htm. This page also states this:
"When using native sequencing with Oracle, specify the name of the sequence object (the object that generates the sequence numbers) for each descriptor. The sequence preallocation size must also match the increment on the sequence object" (...) "Use preallocation and native sequencing for Oracle databases.
And this is exactly what i'm doing. On myClass mappings, the 'Use Sequencing' checkbox is checked, the correct sequence name is typed correctly, once this is the same sequence i've been using for years prior to Toplink, the selected table is the correct one, just as the id field on the table.
Another thing is that the 'Preallocation Size' on Toplink Mappings match the increment value on the database sequence.
I must be missing something...
Can anybody shed some light on this?
Thanks a lot to all.Hello
The method accessing check box tells TopLink to use the get/set methods on your object to set its attributes - If it is unselected, TopLink will set the attribute directly. Great if you have business logic in your get/set methods that you don't want TopLink to hit each time it creates an object after a read from the database (or registers, etc).
The problem you are encountering seems like you have sequencing set to "Use Default Sequencing Table". This option is on the "TopLink Mappings" page on the "Database info" tab just below where you would have set which connection to use. You will need to ensure you have the "use Native sequencing" selected. If you set this information instead through code, be sure you do it on the database login before you login to the session.
If this doesn't help, try turning on TopLink logging to see the SQL statement that causes the problem. The knowing the table name and SQL being used might help figure out where it is being set.
Best Regards,
Chris -
Jdeveloper does not show sequence and table name in dB navigator.
Hi my jdev version is 11.1.1.5.0
I have a table and sequence.I need to map sequence to this table.
But i don't see this table and sequence in jdeveloper DB navigator under my connection.Why is this happening?Incase if you are not the owner of the table, why don't you look under synonyms/views as well. Also double check you database connection to see if it is pointing to right database server (i.e. DEV or TEST) sometime you may overlook them as well.
To double check this, connect from any other sql client tools like toad and see if you are seeing those database objects in the desired location, if not then you are looking in wrong location. -
Creating a sequence of table entries
Hi,
I have a test table and I want to populate ten thousand records in it. I just want to append a standard string and a number sequence to create it.
I am not sure whether it can be done in one SQL statement.
I created the following sequence:
CREATE SEQUENCE SEQUENCE1
START WITH 1
INCREMENT BY 1
MAXVALUE 10000;
I can use SELECT SEQUENCE1.NEXTVAL to display the value 1.
How can I use the UPDATE statement to populate the table with test records?
I tried
UPDATE TABLE TABLE1
SET COL1 = 'PREFX'+(select sequence1.nextval from dual)
and got the error
ORA-02287: sequence number not allowed here
ThanksSQL> create table test as select * from emp ;
Table created.
SQL> create sequence seq ;
Sequence created.
SQL> select * from test ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 800 20
7499 ALLEN SALESMAN 7698 20-FEB-1981 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-1981 1250 500 30
7566 JONES MANAGER 7839 02-APR-1981 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-1981 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-1981 2850 30
7782 CLARK MANAGER 7839 09-JUN-1981 2450 10
7788 SCOTT ANALYST 7566 19-APR-1987 3000 20
7839 KING PRESIDENT 17-NOV-1981 5000 10
7844 TURNER SALESMAN 7698 08-SEP-1981 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-1987 1100 20
7900 JAMES CLERK 7698 03-DEC-1981 950 30
7902 FORD ANALYST 7566 03-DEC-1981 3000 20
7934 MILLER CLERK 7782 23-JAN-1982 1300 10
14 rows selected.
SQL> update test set deptno = seq.nextval ;
14 rows updated.
SQL> select * from test ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-1980 800 1
7499 ALLEN SALESMAN 7698 20-FEB-1981 1600 300 2
7521 WARD SALESMAN 7698 22-FEB-1981 1250 500 3
7566 JONES MANAGER 7839 02-APR-1981 2975 4
7654 MARTIN SALESMAN 7698 28-SEP-1981 1250 1400 5
7698 BLAKE MANAGER 7839 01-MAY-1981 2850 6
7782 CLARK MANAGER 7839 09-JUN-1981 2450 7
7788 SCOTT ANALYST 7566 19-APR-1987 3000 8
7839 KING PRESIDENT 17-NOV-1981 5000 9
7844 TURNER SALESMAN 7698 08-SEP-1981 1500 0 10
7876 ADAMS CLERK 7788 23-MAY-1987 1100 11
7900 JAMES CLERK 7698 03-DEC-1981 950 12
7902 FORD ANALYST 7566 03-DEC-1981 3000 13
7934 MILLER CLERK 7782 23-JAN-1982 1300 14
14 rows selected.
SQL> -
Hi all. Meet again with mr junior
I want to control 5 servos by sliders for each.
Can anybody show me how:
-to put an array of data for the valuethat I control into a table. Every column show value (of degree) for each servo
-every row is the sequence/step for the movement, so I can set many movement that I can save and send it to serial port to run through all the steps
Thanks
-TaL, MalaysiaHi TaL,
A simple way is to just wire your array into a For Loop. It will automatically index the input, meaning each iteration of the loop, it will use the corresponding element of the array.
Attached is a simple VI showing how that works. Use that as a starting point for your program.
Hope this helps.
Best regards,
Vern Yew
Applications Engineer
Attachments:
array.jpg 24 KB -
Hi there,
I've a table with (YEAR,SEQNO) as pk.The sequence must be restarted at the beginning of each year. This will be accessed very often by a lot of users at the same time.
There are (at least) 2 ways of doing this:
a) I can create a table with year and max_seqno. Every time a user access it, I'll do a SELECT FOR UPDATE and add 1. When a new year starts I'll simple insert a new record.
b) I can use a sequence but need a process to reset it
Probably b) is the best approach, but I like you to comment. What would be the best way to automatically reset the sequence ?
tks in advance
Helena.The only way is to use a sequence. If you keep a table your application will not scale, it will be slow, and you risk duplicate values.
To reset the sequence if this is really required, you can create a procedure like:
CREATE OR REPLACE PROCEDURE reset_my_seq IS
BEGIN
EXECUTE IMMEDIATE 'DROP SEQUENCE my_seq';
EXECUTE IMMEDIATE 'CREATE SEQUENCE my_seq
START WITH 1 INCREMENT BY 1
NOCYCLE CACHE 500';
END;Then using DBMS_JOBS or cron (on UNIX) or at (on NT), or any other scheduler you like, set up a recurring job to run at 00:00:01 on January 1 each year that calls the reset_my_seq procedure.
TTFN
John -
How to get maxvalue of sequence in table
hi,
i have made a sequence to be used for an ID column of a table as a primary key. now this sequence is incremented by one,, suppose the maxvalue in this column is 5,,and i want to store next row with ID = 6,,and the statement rollbacks or failed due to any other reason,,the value of 6 has gone,,and nextval would be 7,,how can i get my ID column as an autoincrement such as Autonumber in MS SQL Server ,,is there any other technique available in Oracle??
onetechnique is this tht we get maxvalue of the column thru query and then ourself increment in it,,but this is not a sophisticated way,,
any suggestion would be highly appreciated.
Regards
Muhammad Umar Liaquat.By definition, you cannot guarantee that values in a sequence generated column are gap-free. There are a number of different things that can cause gaps, including rollbacks.
Is there a legitimate business reason that you want a gap-free sequence of values? 99% of the time, this sort of request has no real justification. If there is a justification, the underlying problem can be solved by adding rownum or dense_rank() to a view on the data for the business users to query.
If you do need gap-free sequences, you have to serlialize transactions-- only one transaction at a time can get an ID. This is obviously a scalability killer.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
PR00 Access sequence Condition table changed
Hi Friends,
Someone changed the PR00 Access Sequence Table Settings..
It shows as
Ac Tab Descripion Reqirement Exclusive
5 305 cus/mat checked
10 5 cus/mat checked
20 6 price/cur/mat checked
30 6 price/cur/mat checked
40 4 material checked..
Please tell me the actual Tab Setting and Acc Sequence.. My system is not moving further
ThanksHi
The access sequence for PR00 is PR00 or PR02
the condition tables in PR00 is as folows :
Customer / Material
Price list / Currency / Material
Material
For PR02 access sequence, Try to copy the condition table 304,305and 306 condition tables this will solve the problem
Reward if useful
Regards
Srinath -
Master Column Sequence in Table
Hello,
Is there any way to move Master Column like TableTree to the second place and let a normal column have the first seat?
ThanksAlternatively:
SQL> select table_name,
trim (dbms_xmlgen.getxmltype ('select max(sal) m from ' || table_name).extract ('//text()')) max_sal
from user_tab_cols
where column_name = 'SAL'
TABLE_NAME MAX_SAL
BONUS
EMP 5000
2 rows selected. -
Hi All,
I have a scenario which goes like this:
We have a common table(Table1) in our DB which maintains the sequence numbers(we are not using oracle supplied db sequence).
For every transaction we are using the current sequence number from the table Table1 and put in Table2, while saving
we increment that number by 1 in Table1 for next transactions use. For every transaction the sequence number should be unique.
At any point of time a record with same sequence number should not be inserted in Table2.
In Table2 this sequnce number is not a unique column.
To achieve this, we are checking using view object whether current sequence num already exists in Table2 before saving.
If exists we refresh with new number from Table1. In normal scenario this works fine.
But if concurrent users are accessing, there are cases where same sequence number getting inserted in the Table2
with a time difference of 2 seconds or so(very short span, hence programmatic check fails).
We are unable handle this case using programmatic check of records in table.
Cany any one suggest the best solution possible to tackle this scenario.
Thanks,
Sanjaykarsanjaykar,
Unless you use locking on the "sequence number generator" table, you WILL at some time get duplicates when two people try to insert at nearly the same time. Sounds like you are going for the infamous "gap-free sequence." My honest and not sarcastic nor facetious suggestion would be to go with a sequence number and abandon your approach.
However, if you insist, you can do this by locking the row in the sequence generator table. You can do this in Oracle by using the FOR UPDATE clause of the SELECT statement like this:
select current_value
from my_sequence_table
where sequence_name = 'foobar'
FOR UPDATEThat will lock the row. You can then increment the number, specify it as your key value, update the current_value in your sequence table and commit. If another user jumps in around the same time, the SELECT FOR UPDATE will block, as the row is already locked. However, I cannot stress enough that if you are looking for a high-performance application, one that lets more than one person work at the same time, this is a horrible idea. Just pop over to http://asktom.oracle.com and search for gap-free sequences to read plenty of long discussions why.
Best,
John -
Hello WD-Experts,
I have bind a table into WD dynpro using table UI-Element. The data will shown perfectly.
My issue: I like to change the sequence of the different columns.
Example:
col1 col2 col3
col3 col1 col2
Changing the columns by track and drop is just visible in the ROOTUIELEMENTCONTAINER, but not in the layout itself.
Has anybody an idea how i can change the column sequence?
Thank you very much in advance.
regards
AxelHi Axel,
We can change the sequence of table column. For this Chose the Edit Mode for your view. Navigate to your Table UI element. Click on it so it shows you all the Columns. Now select a column u wish to move and just right click on that . u will see a option called up and down . With this u ws will move ur column in upper and downward direction. So by this u can change the sequence of any column in ur table.
Regards
Manoj kumar -
WDA Table: Getting column sequence as it really is for the user
Hi Folks!
I need the current sequence of table columns as it really is for the user. He may have personalized his table: he may have removed some columns and may have changed the sequence of some columns. And this is what I need to know.
But unfortunately so far I could only get the column sequence as it is defined in the View Layout using this coding:
DATA lo_table TYPE REF TO cl_wd_table.
DATA lo_table_columns TYPE cl_wd_table_column=>tt_table_column.
DATA lo_table_column TYPE REF TO cl_wd_table_column.
DATA lt_abstr_table_columns TYPE STANDARD TABLE OF REF TO cl_wd_abstr_table_column.
DATA ls_abstr_table_column TYPE REF TO cl_wd_abstr_table_column.
lo_table ?= wd_this->mv_view->get_element( 'RLTAB' ).
lt_abstr_table_columns = lo_table->get_grouped_columns( ).
LOOP AT lt_abstr_table_columns INTO ls_abstr_table_column.
lo_table_column ?= ls_abstr_table_column.
ENDLOOP.
Thus: How to get the table column information as they are currently outside in the reald user world (only visible columns in the displayed sequence).
Background: I need this information, because I want to export the table to excel and/or print it in exactly the state the user currently sees it (in personalized state).
Thanx and points for any useful hints - ideally coding snippets!
Regards,
VolkerHi both!
1) I have searched the framework like a mad man an dI think I will dream of all these IF_WD... and CL_WD... most having the useful information in protected or even private areas. A fact I cannot really understand.
2) Although some kind of "criminal" I trewd to go the way in the second answer by creating child classes for cl_wd_abstr_table_column and cl_wd_table_column both containing the protected attribute PERSINDEX I need.
I added a public class get_pers_index to the child classes. So far so good.
But when I try to type-cast SAP standard instance to my instance vairables I get type-cast errors in both cases.
Any ideas?
Here's the relevant coding snippet:
DATA lo_table TYPE REF TO cl_wd_table.
DATA lo_table_columns TYPE cl_wd_table_column=>tt_table_column.
DATA lo_table_column TYPE REF TO cl_wd_table_column.
DATA lo_table_column2 TYPE REF TO /rand/cl_wd_table_column.
DATA lt_abstr_table_columns TYPE STANDARD TABLE OF REF TO cl_wd_abstr_table_column.
DATA ls_abstr_table_column TYPE REF TO cl_wd_abstr_table_column.
data lo_abstr_table_column type ref to /rand/cl_wd_abstr_table_column.
data lv_pers_index type i.
lo_table ?= wd_this->mv_view->get_element( 'RLTAB' ).
lt_abstr_table_columns = lo_table->get_grouped_columns( ).
LOOP AT lt_abstr_table_columns INTO ls_abstr_table_column.
lo_table_column ?= ls_abstr_table_column. "this casting is successful
lo_table_column2 ?= lo_table_column. "this casting throws type-cast exception
lv_pers_index = lo_table_column2->get_pers_index( ).
lo_abstr_table_column ?= ls_abstr_table_column. "this casting throws type-cast exception, too
lv_pers_index = lo_abstr_table_column->get_pers_index( ).
ENDLOOP.
Any help very welcome.
Thanx and Regards,
Volker
Maybe you are looking for
-
Inserting images in OS independant way
Hi All, I have a report which has few bmp files on boilerplates. The development(9iDS-902 R2) goes on in Win2K machines. While inserting images from local disks, the reports builder requires the path of the file to be present. The final deployment of
-
Hi, I've read olds topics in nokia discussions web site, but i still have the same problem. I bought N95 free SIM, i've installer pc suite and NSU. All work fine, PC Suite detect the N95 connected to pc with a usb cable. I can backup and restore my d
-
Bug with the cover flow in OS3.1.2
I am a Chinese user of iTouch and I have found a bug with the cover flow. In the normal mode, there is only 1 album. But when i switch it to the cover flow, it has more than one, all of which have the complete album after it. what's still peculiar is
-
I'm having a problem updating my N79 to the new firmware, which is V30. I bought the phone from the middle east, and now I am in the US, and i called the Nokia Flagship store to see if they could update it for me, but they said they could not since i
-
SSISDB Verbose Logging Level and Unexpected Terminiation
If we set the SSISDB Logging Level to Verbose, will we get more details on Unexpected Termination events? With basic logging level, the reports for Unexpected Termination do not provide any useful information to what happened. --- Ryan Ryan P. Casey