Need to manually update an automatic primary key sequence

EDIT:  I think this is actually a privileges issue not letting me see the sequences.  Sorry for the trouble
Hi everyone. I actually didn't know this was possible until I came across this table. This table has a primary key that autoupdates without a trigger or a sequence. so...
id name
1 jim
2 mark
insert into t1 (name) values ('bob') :
id name
1 jim
2 mark
3 bob
My problem is that I manually inserted some rows into this table with the id's as part of the insert statement and now the old way doesn't work. I am assuming because wherever this sequence is it still thinks 3 is the next value. Does anyone know how i can update this value so that the bob-style insert will work again? There are no triggers or sequences in this database (according to what I'm looking at in SQL Navigator. Thanks!
Edited by: samspot on Feb 4, 2009 12:08 PM

Can you please run following query and send us the output?
select *
from all_triggers
where table_name = 'T1' ;Edited by: arpit_shah4u on Feb 4, 2009 3:07 PM

Similar Messages

  • [Solved] Do I need to manually update my -vcs packages in the AUR?

    I've got a few -vcs packages in the AUR (one hg, 3 svn).  Do I need to manually update the versions in the AUR as the code changes, or does this happen automatically?  I know that makepkg updates the version automatically in the local PKGBUILD, but I want to make sure the people using these packages see the new versions in the AUR.
    Last edited by nofrak (2010-11-06 19:03:42)

    You need to do it manually.
    !next

  • Automatic primary key generation for pointbase

    Hello friends,
    I was wondering whether it is possible to automatically generate primary keys for a pointbase database. Just like the SQL Server pointbase also has a indentity property. I have used weblogic builder to specify automatic key generation. Through the pointbase console I can see that all the columns for all the tables are marked as nullable except the primary key columns. However when I try to insert data into the database using ejb. I get the exception :
    javax.ejb.EJBException: EJB Exception:: java.sql.SQLException: Data exception -- null value not allowed. .
         at com.pointbase.net.netJDBCPrimitives.handleResponse(Unknown Source)
         at com.pointbase.net.netJDBCPrimitives.handlePrimitiveResponse(Unknown Source)
         at com.pointbase.net.netJDBCPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.__WL_create(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3177)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.ejbPostCreate(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3094)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.manager.DBManager.create(DBManager.java:1151)
         at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1100)
         at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1_LocalHomeImpl.create(DirectoryItem_lh4yf1_LocalHomeImpl.java:94)
         at yellowpages.web.controller.AddEntryAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    ; nested exception is: java.sql.SQLException: Data exception -- null value not allowed. .
    java.sql.SQLException: Data exception -- null value not allowed. .
         at com.pointbase.net.netJDBCPrimitives.handleResponse(Unknown Source)
         at com.pointbase.net.netJDBCPrimitives.handlePrimitiveResponse(Unknown Source)
         at com.pointbase.net.netJDBCPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.__WL_create(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3177)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.ejbPostCreate(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3094)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.manager.DBManager.create(DBManager.java:1151)
         at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1100)
         at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1_LocalHomeImpl.create(DirectoryItem_lh4yf1_LocalHomeImpl.java:94)
         at yellowpages.web.controller.AddEntryAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    I am not sure whether I understand your question.
    The 'NamedSequenceTable' method is independent of data base type.
    <from-docs>
    Create a table named SEQUENCE to hold the current primary key value. The
    table consists of a single row with a single column, as defined by the
    following statement:
    CREATE table_name (SEQUENCE int)
    INSERT into table_name VALUES (0)
    </from-docs>
    Then, you can add the following in the DD -
    <automatic-key-generation>
    <generator-type>NamedSequenceTable</generator-type>
    <generator_name>table_name</generator-name>
    <key-cache-size>100</key-cache-size>
    </automatic-key-generation>
    The PK type should be set to java.lang.Integer or java.lang.Long
    --Sathish
    <Panduranga Swamy> wrote in message news:[email protected]..
    Hi,
    With named sequecne table,I am able to develop the application. What I
    wanted is Say Table 1 having Identity column as Primary key in the table
    Pointbase database.
    With Automatic primary key generation in Deployment descriptor, We
    generally specify SQL_SERVER or Named Sequencetable for Primary key
    generation.
    For pointbase database, I dont know how to configure this?
    Could you help me in this regard,
    Thanks,
    Pandu

  • Updatable report strange "Primary Key Source" behaviour

    I have an updatable report based on a table with one primary key
    When I create the report and try to edit the last field to give it a default value, I get
    "Primary Key Source" while I should get the default option.
    The field in question isn't a primary or foreign key and can be NULL.
    Does anyone know why this is?

    The solution you're suggesting is the best in my oppinion as well, however, I would like to know if it's possible to resolve this issue in another way. Using technical key's is best practice, but it's not wrong if you don't... so why isn't there a way in APEX to handle this?
    Maybe using the "Primary Key Source Type" as "Custom PL/SQL Function" in the "Tabular Form Element" is a possibility?
    I will try to convince the customer (other IT department) to use a technical primary key and replace the user generated key by a unique constraint, but ... I just want to know :)
    Edited by: Voxie2 on Jan 7, 2010 2:30 PM

  • How to update a parent (primary key) value?

    hello...can anybody give me a hint that how to update a primary key value in master table through forms as well as update all child records keeping in mind that "ALTER TABLE" and constraint disabling is not permitted by DBA. Parent Records are being displayed in form in a database block while child records are not displayed on form.

    See
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:914629004506
    and
    http://tkyte.blogspot.com/2009/10/httpasktomoraclecomtkyteupdatecascade.html
    cheers

  • Help required to generate primary key sequence

    Hello All,
    I need your help in generating a sequence for primary key in my db table created using java dictionary project in my NWDS 7.3.
    The table column EMPL_ID is a primary and needs to be a sequence. The code in the JPA entity is as below. The underlying database is DB2 on Linux. Kindly help me resolve this issue.
    * The persistent class for the TMP_EMPL_DATA database table.
    @Entity
    @Table(name="TMP_EMPL_DATA")
    public class TmpEmplData implements Serializable {
         private static final long serialVersionUID = 1L;
         @Id
         @SequenceGenerator(name="EMPLID_GENERATOR", sequenceName="EMPID_SEQ", initialValue = 10000, allocationSize = 1)
         @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="EMPLID_GENERATOR")
         @Column(name="EMPL_ID")
         private String _emplId_;
    My bean class contains a public method as follows.
    public TmpEmplData createEmployee(String employeeName, int age, String location)
             TmpEmplData emplData = new TmpEmplData();
             emplData.set_emplName_(employeeName);
             emplData.setAge(age);
             emplData.setLocation(location);
             entityManager.persist(emplData);
             entityManager.find(TmpEmplData.class, emplData.get_emplId_());
             return emplData;
    During execution, i am getting an error as below.
    Caused by: javax.persistence.PersistenceException: The generated SQL statement is not valid for the underlying database platform (platform no. 99). For more details see attached exception. SQL statement is SELECT NEXT VALUE FOR "EMPID_SEQ" FROM ( VALUES (1) )
    at com.sap.engine.services.orpersistence.sqlmapper.mapping.JPASQLMapperImpl.createSequenceIDGeneratorSelectText(JPASQLMapperImpl.java:1239)
    at com.sap.engine.services.orpersistence.entitymanager.CachedJPASQLMapper.createSequenceIDGeneratorSelectText(CachedJPASQLMapper.java:259)
    at com.sap.engine.services.orpersistence.generator.GeneratorFactory.<init>(GeneratorFactory.java:156)
    at com.sap.engine.services.orpersistence.entitymanager.EntityManagerFactoryImpl$MetaDataImpl.<init>(EntityManagerFactoryImpl.java:323)
    at com.sap.engine.services.orpersistence.entitymanager.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:137)
    at com.sap.engine.services.orpersistence.entitymanager.JtaEntityManagerFactoryImpl.<init>(JtaEntityManagerFactoryImpl.java:39)
    at com.sap.engine.services.orpersistence.provider.PersistenceProviderImpl.createJtaEntityManagerFactory(PersistenceProviderImpl.java:251)
    at com.sap.engine.services.orpersistence.provider.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:236)
    at com.sap.engine.services.orpersistence.container.EMFInstanceCreator.getEntityManagerFactory(EMFInstanceCreator.java:134)
    at com.sap.engine.services.orpersistence.container.ORPersistenceObjectFactory.getEMF(ORPersistenceObjectFactory.java:300)
    at com.sap.engine.services.orpersistence.container.ORPersistenceObjectFactory.getObjectInstance(ORPersistenceObjectFactory.java:73)
    at com.sap.engine.lib.injection.ReferenceObjectFactory.getObject(ReferenceObjectFactory.java:96)
    at com.sap.engine.lib.injection.FieldInjector.inject(FieldInjector.java:113)
    ... 122 more
    Caused by: com.sap.engine.services.orpersistence.sqlmapper.generate.SQLMappingException: SQL statement is not valid for underlying database platform.
    at com.sap.engine.services.orpersistence.sqlmapper.common.CommonSQLMappingResult.getStatementString(CommonSQLMappingResult.java:237)
    at com.sap.engine.services.orpersistence.sqlmapper.mapping.JPASQLMapperImpl.createSequenceIDGeneratorSelectText(JPASQLMapperImpl.java:1237)
    ... 134 more
    Caused by: com.sap.sql.tree.StringRepresentationFailureException: Cannot represent next value expression as string.
    at com.sap.sql.tree.impl.OpenSqlTextExpert.nextValueExpressionToText(OpenSqlTextExpert.java:185)
    at com.sap.sql.tree.impl.NextValueExpressionBuilderImpl$NextValueExpressionImpl.toSqlTxt(NextValueExpressionBuilderImpl.java:140)
    at com.sap.sql.tree.impl.AbstractSqlTextExpert.selectSublistToText(AbstractSqlTextExpert.java:130)
    at com.sap.sql.tree.impl.SelectSublistImpl.toSqlTxt(SelectSublistImpl.java:150)
    at com.sap.sql.tree.impl.QuerySpecificationImpl.toSqlTxt(QuerySpecificationImpl.java:361)
    at com.sap.sql.tree.impl.SelectStatementImpl.toSqlTxt(SelectStatementImpl.java:139)
    at com.sap.sql.tree.impl.SQLStatementImpl.toSqlString(SQLStatementImpl.java:75)
    at com.sap.engine.services.orpersistence.sqlmapper.common.CommonSQLMappingResult.getStatementString(CommonSQLMappingResult.java:233)
    ... 135 more

    Hi,
    does the sequence exist? SAP JPA does not support creation of sequences, you have to create it manually.
    Maybe SAP JPA also does not support DB2 sequences with "Open SQL" correctly.
    - Tryp to set your data source to "native" or "vendor".
    - Try to turn on oracle compatibility:
    db2set DB2_COMPATIBILITY_VECTOR=ORA
    Regards
    Rolf

  • Knowing the Primary Key Sequence Generator of a table

    Hello All,
    I'm working on an application that uses Oracle toplinks/JPA for persistence. The entity classes in the application have primary key fields with annotations @Id and @GeneratedValue(strategy = GenerationType.AUTO). Per our understanding, this means the primary key generation is done by JPA/Top-links. When we see our database, we notice only one SEQUENCE table available and that table has only one row, while in the application, we are getting different sequence numbers for the primary key of each entity. So, not clear on how this sequence number is generated. Could anybody share information on where the sequence number is stored for each entity/table? Really appreciate your help here. Our database is MSSQL.
    Thank you,
    Venkatesh

    EclipseLink/TopLink uses Table sequencing for GenerationType.AUTO because it is more portable between databases. My understanding of your issue is from
    http://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Table_sequencing
    Each row in the table represents one sequence generator, and your entities are all using the same default sequence generator and so all use the same row.
    To use multiple rows I believe you need to define multiple TableGenerators.
    Best Regards,
    Chris

  • How to update data when primary key is set through for update cursor

    Dear friends,
    I have tried to update data in the table through forms using cursor for update and i have given the plsql i have used please help me where i do mistake.
    DECLARE CURSOR EMP IS
    SELECT EMPNO,EMPNAME,FATHERNAME,COMMUNITY,SEX,BILLUNIT,BIRTHDATE,RLYJOINDATE,RETIREMENTDATE
    FROM PRMAEMP WHERE BILLUNIT=:CTRL.BILLUNIT AND SERVICESTATUS='SR'ORDER BY DESIGCODE,SCALECODE
    FOR UPDATE;
    BEGIN
    GO_BLOCK('EMP_DETAILS');
    SYNCHRONIZE;
    FOR I IN EMP
    LOOP
    I.BILLUNIT:=:EMP_DETAILS.BILLUNIT;     
    I.EMPNO:=:EMPNO;
    I.EMPNAME:=:EMPNAME;
    I.FATHERNAME:=:FATHERNAME;
    I.COMMUNITY:=:COMMUNITY;
    I.SEX:=:SEX;
    I.BIRTHDATE:=:BIRTHDATE;
    I.RLYJOINDATE:=:RLYJOINDATE;
    I.RETIREMENTDATE:=:RETIREMENTDATE;
    DOWN;
    END LOOP;
    COMMIT;
    END;
    your help is needed immediately

    DECLARE CURSOR ABC IS
       SELECT EMPNO,
              EMPNAME,
              FATHERNAME,
              COMMUNITY,
              SEX,
              BILLUNIT,
              BIRTHDATE,
              RLYJOINDATE,
              RETIREMENTDATE
    FROM PRMAEMP
    WHERE BILLUNIT=:CTRL.BILLUNIT
    AND SERVICESTATUS='SR'
    ORDER BY DESIGCODE,SCALECODE
    FOR UPDATE OF COMMUNITY;
    V_EMPNO           PRMAEMP.EMPNO%TYPE;
    V_EMPNAME         PRMAEMP.EMPNAME%TYPE;
    V_FATHERNAME      PRMAEMP.FATHERNAME%TYPE;
    V_COMMUNITY       PRMAEMP.COMMUNITY%TYPE;
    V_SEX             PRMAEMP.SEX%TYPE;
    V_BILLUNIT        PRMAEMP.BILLUNIT%TYPE;
    V_BIRTHDATE       PRMAEMP.BIRTHDATE%TYPE;
    V_RLYJOINDATE     PRMAEMP.RLYJOINDATE%TYPE;
    V_RETIREMENTDATE  PRMAEMP.RETIREMENTDATE%TYPE;
    BEGIN
       GO_BLOCK('EMP');
       SYNCHRONIZE;
       OPEN ABC;
       LOOP
          FETCH ABC INTO .... /*yOU NEED TO MENTION YOUR VARIABLES HERE*/;
          UPDATE PRMAEMP
          SET BILLUNIT= :EMP.BILLUNIT,
              EMPNO= :EMPNO,
              EMPNAME= :EMPNAME,
              FATHERNAME= :FATHERNAME,
              COMMUNITY= :COMMUNITY,
              SEX= :SEX,
              BIRTHDATE= :BIRTHDATE,
              RLYJOINDATE= :RLYJOINDATE,
              RETIREMENTDATE= :RETIREMENTDATE
          WHERE CURRENT OF ABC;
          EXIT WHEN ABC%NOTFOUND;
       END LOOP;
       CLOSE ABC;
    END;
    COMMIT;
    END;Cheers
    Sarma.

  • Primary Key in tabular form is not a number

    I created a table called tblRegions.
    The primary key is RegionCode(VarChar2) - example - USA.
    I then tried to create an updateable Tabular Form using tblRegions, but it won't let me choose the primary key as an updateable field.

    O.K.
    1. create a trigger which will populate a real primary key out of a sequence - search internet
    on triggers and sequences in oracle
    2. use this primary key for tabular form processing
    3. if you need a manually entered pseudo (fake) primary key, you can handle this column
    as any other - tabular form will not complain about it
    4. you may create a constraint on your table, which will take care this column is allways
    populated and unique - this is not the nicest way since it involves processing and the errors
    you gat may not look user friendly. However, this is the most secure and easiest way -
    you don't need to write any code on the application side to handle eventual errors.
    Search internet on constraints.
    5. you may decide to create a manual validation process to fetch the eventual errors
    before you commit the changes to the database. This forum is full of the threads on
    the topic "tabular form" and "manual creation of tabular forms". If you are new to apex,
    you should stay away from that for the first (this is only my opinion).
    Denes Kubicek

  • Update a primary key and Fk

    Hello
    I have to update a primary key (PK) which is referenced by many foreign keys (FK).
    The primary key columns cannot be updated as this would orphan the dependant tables,
    and the dependant tables cannot be updated prior to the parent table as this would also make them orphans.
    I think this problem was solved by disabling the foreign key constraints or deleting the original records and recreating them.
    Since neither of these solutions is particularly satisfactory for me I read about 'deferred constraints'.
    My question is:
    Can I use(modify to) 'INITIALLY DEFERRED' keyword on constraints's table already created with The default, INITIALLY IMMEDIATE ,
    that is, update my primary key and foreign keys, and then re-set to
    'INITIALLY IMMEDIATE'? Or another trick exists ?
    Thanks in advance for your attention

    It is very popular the idea that the updates on primary key columns are a very bad thing.
    Oracle supports this idea and that's why they don't give the "on update cascade" clause on foreign keys.
    So in this case I suggest you to define a master table like this.
    create table master_table (
         key_id number primary key,
         your_primary_key varchar2 not null unique
    /Then you must use that key_id column as foreign key in place of your original primary key. In this way don't even need to update referencing rows when updating the original primary key because the foreign key value doesn't change and everything is always fine as before.
    So instead to lose time implementing some strange sort of cascade triggers plain to do something like this on your schema.
    insert into master_table (id_key,primary_key) (
         select rownum,primary_key
         from your_main_table
    alter table your_main_table add (
         id_key number,
    update your_main_table a
    set id_key = (
              select b.id_key
              from master_table
              where b.primary_key=a.primary_key
         Drops foreign keys
    alter table your_main_table drop primary key cascade
    alter table your_main_table add constraint pk
         primary key(id_key)
    alter table your_main_table add constraint fk
         foreign key(id_key) references master_table
    alter table your_main_table drop (
         your_primary_key
    alter table a_referencing_table add (
         id_key number,
    update a_referencing_table a
    set id_key = (
              select b.id_key
              from master_table
              where b.primary_key=a.primary_key
    alter table a_referencing_table add constraint fk_2
         foreign key(id_key) references master_table
    alter table a_referencing_table drop (
         your_primary_key
    /If you have many objects referencing those tables I suggest you to rename the tables and to create views with the original name of the renamed tables that show data as it was before with a join on master_table. in this way you don't need to change the code of the application referencing them but you just need to recompile invalidated objects.
    Bye Alessandro

  • Update Record Wizard, tng_Recordset and Primary Key

    Hi - trying to make an image gallery that allows the user to add captions to each image displayed in a loop without having to send the user to a different form/detail page.
    My question is - can the tng_recordset generated by the Update Record Wizard be modified to use a field of another recordset on the same page as it's primary key?
    I.e. (on the Update Record behaviour) - Primary Key = Entered Value = {imagegalleries.galleryimages}
    this doesn't work, but it's where I'd like to be...
    The recordset 'imagegalleries' has been filtered using a URL variable that was defined as the gallery being edited.
    Hope this makes sense - have been trying for days on this.
    Dan

    -------
    I just get a blank page
    this means you´re having a PHP syntax error somewhere, and I´d recommend to always activate PHP error reporting at least on your local development server to have PHP indicate the reason why things aren´t working.
    However, when using such native PHP syntax within this context, you´ll usually need to add some more stuff around the variable -- means:
    $upd_boomcms_galleries_files->setPrimaryKey("bcms_galleryimage_id", "NUMERIC_TYPE", "VALUE", "".$row_galleryimagelist['bcms_galleryimage_id']."");
    works better now ?
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Primary Key Materlized View and primary key in master tables

    We are using Oracle 11g2 and I created a materlized view on several master tables. The master tables all have primary key, but I did not include all primary key columns in the defining query.
    According to Oracle Manual e10592 Specify WITH PRIMARY KEY to create a primary key materialized view. This is the default ....
    The master table must contain an enabled primary key constraint, and the defining query of the materialized view
    must specify all of the primary key columns directly.My MV created OK and works. My question is what can be the impact on my MV? Could it hit the performance. It takes 40 minutes for the MV to be created and 5 minutes to refresh for single row insert in each mater table. I would like to see it refresh in seconds.

    Retrieving rows from the mview is purely a function of the number of rows and indexing on the mview itself. Refreshing the mview wall time depends on the quality of the query used to refresh the mview. Whether you include PKs from the source table in the mview is of little, or no, consequence here. What matters is the execution path of the refresh query. Is there proper indexing on the underlying tables to support the joins. Did you use mlog$_s to enable fast refresh - are mlog$_s even usable for your mview. There are a number of possible causes to your problem and we do not have enough information to make an estimate of the problem.
    BTW, if the mview could refresh in seconds w/o mlog$_s, you probably do not need an mview.

  • DBMS_CDC find only the columns that are changed along with the primary key in the table

    Hello,
    We are having a requirement to find the change data in the production environment.
    We are planning to use the DBMS_CDC utility.
    But for  example in the create change table 1 picked emp_id,ename, address, salary,dob.
    I have a sample data of
    empid
    ename
    address
    salary
    DOB
    1
    test1
    24 test street
    2000
    20-Jan-98
    2
    test2
    25 test street
    2500
    15-Aug-97
    if ename for empid 1 is changed to test1_test3 from test1.
    My CDC is capturing  the values in the old and new values in the 5 columns.
    But i need to get only the empid (primary key of the source table) and the ename column as only that's been updated not the rest of the 3 columns.
    Can i accomplish this.
    Please advice.

    Hello,
    Thanks for the information.
    but if i change the change table  then i will miss the other columns right?
    I want to get the columns( empid and ename) only if ename is changed. i.e when ever any column in emp table changes i need to get all the columns where the data is changed along with the primary key columns empid.
    Is there any way i can tweak the parameters so that i can achieve this or is there any other way using the cdc i can get this data.
    Thanks

  • Altering Primary Key Constraint

    hi this may sound silly .
    but is it possible to alter a primary key constraint and add another column to it ?
    eg. >desc t1
    c1 number(3) not null
    c2 number(3)
    here I have created primary key on column c1.
    Now I want to alter this constraint and add second column also as part of primary key constraint (so that it will be composite primary key )
    How do i do that ? Do the column needs to be empty ?
    Thanks

    You should use ALTER TABLE DROP CONSTRAINT / ADD CONSTRAINT option.
    Do the column needs to be empty ?Because primary key constraint supposes NOT NULL constraints for columns
    included into primary key, all columns havn't to have nulls values (NOT NULL constraint will be added to c2 column):
    SQL> create table t1 (c1 number(3) not null, c2 number(3));
    Table created.
    SQL> alter table t1 add constraint t1_pk primary key(c1);
    Table altered.
    SQL> insert into t1 values(1,1);
    1 row created.
    SQL> insert into t1 values(2,null);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> alter table t1 drop constraint t1_pk;
    Table altered.
    SQL> alter table t1 add constraint t1_pk primary key (c1,c2);
    alter table t1 add constraint t1_pk primary key (c1,c2)
    ERROR at line 1:
    ORA-01449: column contains NULL values; cannot alter to NOT NULL
    SQL> update t1 set c2 = 3;
    2 rows updated.
    SQL> alter table t1 add constraint t1_pk primary key (c1,c2);
    Table altered.
    SQL> desc t1
    Name                                      Null?    Type
    C1                                        NOT NULL NUMBER(3)
    C2                                        NOT NULL NUMBER(3)Rgds.

  • Error in primary key generation

    Hello,
    I am using Postgresql database with jboss. I am using sequence block pattern for generating automatic primary key using source code provided by ejbdesignpattern book. but when i use transaction attribute of RequiresNew for method getValueAfterIncrementingBy I get following exception. excpetion disappear when transaction attribute is changed to Required but book recommends using RequiresNew attribute for the mehtod
    can sombody tell y this exception is being raised and workaround.
    15:57:23,507 WARN [TxCapsule] Transaction XidImpl [FormatId=257, GlobalId=c40//
    1, BranchQual=] timed out. status=STATUS_ACTIVE
    15:57:23,707 WARN [TxCapsule] Transaction XidImpl [FormatId=257, GlobalId=c40//
    2, BranchQual=] timed out. status=STATUS_ACTIVE
    15:57:23,707 WARN [BeanLock] wait() interrupted in txLock, possibly a timeout
    15:57:23,707 ERROR [BeanLock] Thread[RMI TCP Connection(2)-192.168.0.46,5,RMI Ru
    ntime]Saw rolled back tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=c40//2,
    BranchQual=] waiting for txLock
    15:57:23,707 WARN [TxCapsule] Lock contention, tx=XidImpl [FormatId=257, Global
    Id=c40//2, BranchQual=]
    15:57:23,727 ERROR [LogInterceptor] RuntimeException:
    java.lang.RuntimeException: Transaction marked for rollback, possibly a timeout
    at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.waitForTx(QueuedP
    essimisticEJBLock.java:339)
    at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.doSchedule(Queued
    PessimisticEJBLock.java:211)
    at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.schedule(QueuedPe
    ssimisticEJBLock.java:159)
    at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep
    tor.java:103)
    at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreation
    Interceptor.java:69)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
    rceptor.java:107)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
    torCMT.java:291)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:9
    8)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
    java:130)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
    at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
    at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLoca
    lContainerInvoker.java:301)
    at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
    at $Proxy34.getValueAfterIncrementingBy(Unknown Source)
    at com.gmi.mportal.SequenceSessionBean.getNextSequenceNumber(SequenceSes
    sionBean.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
    tatelessSessionContainer.java:660)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
    ke(CachedConnectionInterceptor.java:186)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
    elessSessionInstanceInterceptor.java:77)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
    rceptor.java:107)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
    torCMT.java:237)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:9
    8)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
    java:130)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
    at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
    ner.java:313)
    at org.jboss.ejb.Container.invoke(Container.java:738)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
    at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
    383)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
    at sun.rmi.transport.Transport$1.run(Transport.java:148)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    60)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:701)
    at java.lang.Thread.run(Thread.java:536)
    15:57:23,747 ERROR [LogInterceptor] EJBException, causedBy:
    java.lang.RuntimeException: Transaction marked for rollback, possibly a timeout
    at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.waitForTx(QueuedP
    essimisticEJBLock.java:339)
    at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.doSchedule(Queued
    PessimisticEJBLock.java:211)
    at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.schedule(QueuedPe
    ssimisticEJBLock.java:159)
    at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep
    tor.java:103)
    at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreation
    Interceptor.java:69)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
    rceptor.java:107)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
    torCMT.java:291)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:9
    8)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
    java:130)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
    at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
    at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLoca
    lContainerInvoker.java:301)
    at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
    at $Proxy34.getValueAfterIncrementingBy(Unknown Source)
    at com.gmi.mportal.SequenceSessionBean.getNextSequenceNumber(SequenceSes
    sionBean.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)

    I'm experiencing the exact same problem.
    I do have a piece of information to add, though.
    This problem only occurs when I run the code (generating a PK for a given table) the FIRST time. Once a row exists in the sequence table for a table, the code works.
    On the first run, the problem occurs after the row is inserted into the table. If the row already exists, you're all set.
    Still a problem, but at least you can work around it by prepopulating your sequence table.
    --- Matt

Maybe you are looking for

  • A flashing folder with question mark

    Dear all, I have a rather strange problem with my  MacBook Pro (13-inch, Late 2011). Whenever I start my computer I see a flashing folder with a question mark. I know this is supposed to be a common problem wich can be usually solved by the solution

  • Sales order status with down payment requests.

    Due to our requeriments, all the invoices created from a sales order has down payment request as billing category. The problem is that the sales order status continues as "Being processed" instead of completed. Is there any customising that makes the

  • OSX 10.6.8 installed bricked my MacBook Air

    the OS X 10.6.8 install completed on my MacBook Air. Now it won't restart. Anyone else had this problem? And the solution is?

  • Object locking in Distributed cache

    Hi,      I have gone through some of the posts on the forum regarding the locking issues.      Thread at http://www.tangosol.net/forums/thread.jspa?messageID=3416 specifies that      ..locks block locks, not gets or puts. If one member locks a key, i

  • Translate string using hex(0020) in Unicode system.

    Hello all, We are facing a problem of the "translate" statement in the Unicode system. The original statement goes as follows: TRANSLATE BULOG USING WS_STRING1. Here  BULOG is a structure and ws_string1 is declared as follows: DATA : ws_string1(2) ty