Auto incremented field mobile device

hello,
my colleague requires to make a mechanism in the mobile device (oracle lite client) where the primary field of a table is automatically incremented.
according to the documentation in order to make that happen in a consistent manner so that all clients can sync correctly without ambiguities , we created a sequence
through the MDW and attached it to the publication. then with the sync , this sequence has been downloaded to all clients and each one has a specified window.
now we suppose that we must create the trigger that uses this sequence in order to provide the correct primary key field.
lets say that the sequence is names SYSTEM.AUTOINCSEQUENCEA
the table is named SYSTEM.TABLEA
and the primary key that we want to auto incr is named ID.
the trigger we suppose that should look like:
CREATE TRIGGER SYSTEM.TRIGGERTABLEA
BEFORE INSERT
ON SYSTEM.TABLEA REFERENCING NEW AS New OLD AS Old
FOR EACH ROW
BEGIN
select AUTOINCSEQUENCEA.nextval into :new.ID from dual;
END ;
1)But if i execute this from the msql on the client device (mobile windows device) it returns a "syntax error". how can i create the trigger that i need which will use my sequence in order
to appoint the new values on the primary key (auto incremented field??) .
2)if i cant do it through a normal sql statement then how can i do it?
thank you

You need Java Store Procedure as the trigger. PL/SQL is not support on the Oracle Lite client.
Let me know if you need an example on how to do this.

Similar Messages

  • Integer auto-increment fields

    I am using 3.0.3 and have a PC class that uses application identity and
    MSSQL server, so we are using auto-increment fields for our primary keys.
    In the past (with sequence-generated ids) we have used Integers for our
    mapped attributes, but with the application identity, it seems we need to
    use ints. Is there a reason for this, or is it a bug?
    Nathan

    Great. Thanks for the help.
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    This is a bug. I've reported it at:
    http://bugzilla.solarmetric.com/show_bug.cgi?id=910
    I expect it will be fixed in the next release. In the meantime, if you
    want to use a numeric wrapper for your auto-increment field, it will
    need to be of type java.lang.Long.
    In article <[email protected]>, Nathan Voxland wrote:
    It does work with Longs. I could switch my code to use Longs, although
    I
    don't always need that large of an id field.
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    If you change them both from Integer to a Long field, then does it
    work?
    >>>
    >>>
    In article <[email protected]>, Nathan Voxland wrote:
    Here is the code for the class and the ApplicationId class. The
    ApplicationId class was generated using the appidtool.
    public class Portfolio {
    private Integer id;
    private String name;
    private String notes;
    private Organization client;
    private Portfolio parentPortfolio;
    private Set subPortfolios;
    private Set projects;
    private Date created;
    private Person createdBy;
    private Date lastModified;
    private Person lastModifiedBy;
    public Portfolio(PersistenceManager pm) {
    pm.makePersistent(this);
    this.subPortfolios = new HashSet();
    this.projects = new HashSet();
    this.created = new Date();
    this.createdBy = new PersonPeer(pm).findLoggedIn();
    this.lastModified = this.created;
    this.lastModifiedBy = this.createdBy;
    public Integer getId() {
    return new id;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public void jdoPostLoad() {
    public void jdoPreStore() {
    if (!((PersistenceCapable) this).jdoIsNew()) {
    this.lastModified = new Date();
    this.lastModifiedBy = new
    PersonPeer(((PersistenceCapable)
    this).jdoGetPersistenceManager()).findLoggedIn();
    public void jdoPreClear() {
    public void jdoPreDelete() {
    * Auto-generated by:
    * kodo.enhance.ApplicationIdTool
    public class PortfolioId
    implements Serializable
    static
    // register persistent class in JVM
    Class c = Portfolio.class;
    public Integer id;
    public PortfolioId ()
    public PortfolioId (String fromString)
    if ("null".equals (fromString))
    id = null;
    else
    id = new Integer (fromString);
    public String toString ()
    return String.valueOf (id);
    public int hashCode ()
    return ((id == null) ? 0 : id.hashCode ());
    public boolean equals (Object obj)
    if (this == obj)
    return true;
    if (!(obj instanceof PortfolioId))
    return false;
    PortfolioId other = (PortfolioId) obj;
    return ((id == null && other.id == null)
    || (id != null && id.equals (other.id)));
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    Is the primary key field an Integer in both the application
    identity
    class and the persistent class itself? They need to both be the same
    class.
    If they are the same, and you are still getting the exception, could
    you post the code for the classes (or else mail them to
    [email protected])?
    In article <[email protected]>, Nathan Voxland
    wrote:
    When I have my object use an int id, my test runs fine, when Iswitch
    to
    an
    Integer, I get the exception:
    kodo.util.FatalException: java.lang.ClassCastException
    NestedThrowables:
    java.lang.ClassCastException
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:563)
    at
    com.correlat.intranet.projectmanagement.PortfolioTest.testFlush(PortfolioTes
    t.java:393)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(UnknownSource)
    at
    com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
    Source)
    at
    com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
    Source)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(UnknownSource)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(UnknownSource)
    Caused by: java.lang.ClassCastException
    at
    com.correlat.intranet.projectmanagement.Portfolio.jdoReplaceField(Portfolio.
    java)
    atkodo.runtime.StateManagerImpl.replaceField(StateManagerImpl.java:2771)
    at
    kodo.runtime.StateManagerImpl.storeObjectField(StateManagerImpl.java:2272)
    atkodo.runtime.StateManagerImpl.storeObject(StateManagerImpl.java:2252)
    at
    kodo.jdbc.meta.ValueFieldMapping.setAutoIncrementValue(ValueFieldMapping.jav
    a:346)
    atkodo.jdbc.meta.ClassMapping.setAutoIncrementValue(ClassMapping.java:381)
    at
    kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.ja
    va:137)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:357)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:153)
    at
    kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:72)
    atkodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:507)
    at
    kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:158)
    at
    kodo.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:412)
    at
    kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.jav
    a:794)
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:550)
    ... 24 more
    NestedThrowablesStackTrace:
    java.lang.ClassCastException
    at
    com.correlat.intranet.projectmanagement.Portfolio.jdoReplaceField(Portfolio.
    java)
    atkodo.runtime.StateManagerImpl.replaceField(StateManagerImpl.java:2771)
    at
    kodo.runtime.StateManagerImpl.storeObjectField(StateManagerImpl.java:2272)
    atkodo.runtime.StateManagerImpl.storeObject(StateManagerImpl.java:2252)
    at
    kodo.jdbc.meta.ValueFieldMapping.setAutoIncrementValue(ValueFieldMapping.jav
    a:346)
    atkodo.jdbc.meta.ClassMapping.setAutoIncrementValue(ClassMapping.java:381)
    at
    kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.ja
    va:137)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:357)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:153)
    at
    kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:72)
    atkodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:507)
    at
    kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:158)
    at
    kodo.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:412)
    at
    kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.jav
    a:794)
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:550)
    at
    com.correlat.intranet.projectmanagement.PortfolioTest.testFlush(PortfolioTes
    t.java:393)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(UnknownSource)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(UnknownSource)
    Nathan
    "Patrick Linskey" <[email protected]> wrote in message
    news:[email protected]...
    What behavior are you seeing that is preventing you from using
    Integers?
    -Patrick
    Nathan Voxland wrote:
    I am using 3.0.3 and have a PC class that uses application
    identity
    and
    MSSQL server, so we are using auto-increment fields for our
    primary
    keys.
    In the past (with sequence-generated ids) we have used Integers
    for
    our
    mapped attributes, but with the application identity, it seems
    we
    need
    to
    use ints. Is there a reason for this, or is it a bug?
    Nathan
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Auto increment field in database issue

    Ok, I have read all about the issues with the auto increment field when trying to hook my form up to a ms access database.
    My problem is that the auto increment field is the one field I want in my form.
    Any suggestions how to create a new record with my form? its a simple database, date field, and PO number (the auto incremented field)
    Just trying to get a fresh PO number on my PO form each time its filled out....

    I have a vital form that clients fill out, which is passed to many people in the company along the workflow. The form is a Planner and we have in the following PDF, Word Doc..
    Well before, the Planner.pdf was originally created in Word, since most people have access to Word.. but evolved to a PDF form created from the Word Doc via Adobe LiveCycle Designer 8.0 w/ User Rights enabled so that the form could be filled out and saved using Adobe Reader.. which was a step better than Word.. being that it is free. But this needed to be easier and more to the point b/c some clients don't particularly like installing the latest version of Reader, even if you provide them the link. Nor do they like saving the form, filling the form, and attaching the form to send back.
    My goal is to have the client fill an HTML version of the form, submit and be done with it, but everyone in the workflow be able to easily receive the filled Planner as a PDF form.
    So some months ago I ran into this post Chris Trip, "Populate Livecycle PDF from mySQL database using PHP" #8, 22 Sep 2007 4:37 pm
    which uses the command line Win32 pdftk.exe to merge an FDF file into an existing PDF on the remote server, and serve this to whoever.
    My problem was with shared hosting and having the ability to use the Win32 pdftk.exe along with PHP which is predominantly used on Linux boxes. And we used a Linux box.
    so i created the following unorthodox method, which a client fills the HTML version of the Planner, all field values are INSERTED into a table in MySQL DB, I and all filled planners that have been filled by clients to date can be viewed from a repository page where an XML file is served up of the corresponding client, but someone would have to have Acrobat Professional, to import the form data from the XML file into a blank form.. altoughh this is simple for me.. I have the PHP file already created so that when a Planner is filled and client submits. >> the an email is sent to me with a table row from the repository of the client name, #, email, and a link to d-load the XML file,
    But I also have the PHP files created so that the Planner can be sent to by email to various people in the workflow with certain fileds ommitted they they do not need to see, but instead of the XML file beiong served up i need the filled PDF Planner to be served.
    I can do this locally with ease on a testing server, but I am currently trying to use another host that uses cross-platform compatibility so i can use PHP and the pdftk.exe to achieve this, as that is why I am having to serve up an XML file b/c we use a Linux server for our website, and cant execute the exe.
    Now that I am testing the other server (cross-platform host), just to use them to do the PDF handling (and it's only $5 per month) I am having problems with getting READ, WRITE, EXECUTE permissions..
    Si guess a good question to ask is can PHP do the same procedure as the pdftk.exe, and i can eleminate it.
    or how in the heck can i get this data from the DB into a blank PDF form, like i have described??
    here are some link to reference
    Populating a LiveCycle PDF with PHP and MySQL
    http://www.andrewheiss.com/Tutorials?page=LiveCycle_PDFs_and_MySQL
    HTML form that passed data into a PDF
    http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.htm l
    and an example
    http://accesspdf.com/html_pdf_form/

  • Creating auto-increment field in SharePoint List

    In SharePoint, we can create the auto-incremental field by many ways, I am going to discuss two ways of doing it.
    Calculated field
    Item Event Receiver
    1. Using Calculated field:
    Using this we can accomplish it without doing any programing and it is a relatively simple way of doing it. By using “Calculated” column in SharePoint List we can create auto-increment field. We can accomplish this by creating a new column and choosing the
    column type as “Calculated (calculation based on other columns)”. And in Formula field, we have to enter [ID]
    In fact this will be using the values from “ID” field from SharePoint list that starts from 1.
    For example, if we want to start our auto-increment column from 100, we can modify the “Formula” field of Create New column screen, we can have to enter [ID] + 99
    For detailed info please follow the blog I wrote here: http://faisalrafique.wordpress.com/2011/03/19/creating-auto-increment-field-in-sharepoint-list/
    2. Using Item Event Receiver:
    By using this strategy, users have advantage to edit the existing values, we can also avoid it by making field read-only on feature activation. Using item event receiver, on ItemAdded event, we have to find the highest value among previously added items
    and then save the incremented value to current newly created auto-incremental column.
    For code of event reciever please follow the blog I wrote here:
    http://faisalrafique.wordpress.com/2011/03/19/creating-auto-increment-field-in-sharepoint-list/
    Happy Coding

    Use Sharepoint Designer to create a Workflow for the list containing the field to increment. For my project I had an Invoice field that I wanted to start with 1001 and increment from there so I made the following workflow to do this.
    In the new workflow screen in Sharepoint Designer create two actions in Step 1:
    Calculate Current Item:ID plus 1000 (Output to Variable: calc)
    then Set AutoIncrementNumber to Variable: calc
    This is just a guide. If you just want the auto-increment to start with 1 then you can just use this step
    Set AutoIncrementNumber to Current Item:ID
    Also, make sure you select the correct name for your field in the Workflow action instead of AutoIncrementNumber.
    Save the Workflow, close it, and then open it again in Sharepoint Designer. Check the box for "Start workflow automatically when an item is created." Save it again and then click on the Publish button to make it active on the sharepoint site. The value should
    now increment for each new item created in the list.

  • Auto Increment Field / Sequence - How?

    Am I missing something here - is there no build in support to tie a datatables auto incriment field to a sequence so that it will be automatically retrieved on a update command?
    I have a table that has a field (RECORD_ID) that gets it's value from a Sequence (RECORD_IDSEQ).
    I am retrieving a dataset and setting the RECORD_ID field to autoincrement, setting the seed & step to -1. Then I am adding some records & I see the autoincrement field i working correctly. UNFORTUNATELY, I still have to iterate through the table before I call an update in order to insert (from another function) the RECORD_IDSEQ.NEXTVAL value into the RECORD_ID column.
    Surely I am missing something. It sure seems simple enough to have a property of the autoincrement field/command builder that relates to the SEQUENCE name so that the update method generates the RECORD_IDSEQ.NEXTVAL automagically.
    Can anyone shed any light on this for me?
    Thanks!

    Bob,
    Currently, there's no built-in "link" between the .NET DataTable's auto-increment field and the Oracle sequence.
    Therefore, you will need to execute a custom update command or a custom insert command which uses the RECORD_IDSEQ.NEXTVAL for the RECORD_ID column (rather than the auto-generated SQL via the CommandBuilder).
    Furthermore, in your custom SQL you can have a RETURNING clause which returns the RECORD_ID column value to populate back into the DataTable so that the sequence values in the Database is in sync with those in the DataTable.
    We'll consider providing a way to "link" the DataTable auto-increment column to an Oracle sequence in a future release.

  • Does all RDBMS support auto-increment field?

    Hi,
    I am designing a java application in which I have to write some logic to auto-increment one database field. Can anyone tell me that all the databases support the auto-increment fields.
    Thanks in advance.
    Chris

    There seem to be two kinds of facility for this in databases. One kind has an auto-increment field. Unfortunately they aren't consistent about how you obtain the value just created after an insert (which you almost invariably require to know). Generally you use a select statement to pick up the value of some kind of last row index function, but the name and syntax varies.
    The other kind uses a separate object in the database called a SEQUENCE. You create this with a CREATE SEQUENCE statment, and generally you reference nextval(sequence_name) in the default attribute of the database field.
    To get the last allocated sequence number you use select currval(sequence_name)
    Again the syntax is a bit inconsistent. You should also probably use transaction isolation if someone else might be incrementing the same sequence.

  • Auto increment field with reset in a query

    Hi,
    I have the following query, I want 'field number' should count as a auto increment number and reset accordingly a group. e.g
    for the group 1 if there are 10 rows then it should give me rownum as 1--10
    for the group 2 if therea are 5 rows then it should give me rownum as 1--5
    select d.drop_prog_id,
    a.opre_cms_oppty_id,
    c.more_tipo_revisione,
    decode(f.grdo_prog_id,16,null,
    decode(f.grdo_prog_id,75,'Other','Euro')
    ) Field_Number,
    decode(f.grdo_prog_id,16,e.doma_testo, f.grdo_descrizione) GROUP1,
    decode(f.grdo_prog_id,16,h.risp_valore,d.drop_valore_risposta) MILESTONE_RESPONSE,
    d.drop_valore_commento1,
    d.drop_valore_commento2
    from wrt.tr002_opportunita_revisioni a,
    wrt.tr005_opportunita_rev_moduli b,
    wrt.tr008_moduli_revisione c,
    wrt.tr006_domande_risposte_oppor d,
    wrt.tr009_moduli_domande g,
    wrt.tr010_domande e,
    wrt.tr012_gruppo_domande f,
    wrt.tr015_risposte h
    where b.ormo_opre_prog_id = a.opre_prog_id and c.more_prog_id in (1, 19) and
    d.drop_ormo_prog_id = b.ormo_prog_id
    and d.drop_modo_prog_id = g.modo_prog_id
    and g.modo_more_prog_id = c.more_prog_id and
    g.modo_doma_prog_id = e.doma_prog_id
    and e.doma_grdo_prog_id = f.grdo_prog_id
    and (f.grdo_prog_id in (76, 75)
    or (e.doma_testo like '%Are payment terms from invoice%' and
    f.grdo_prog_id = 16))
    and a.opre_ultima_revisione = 'S'
    and h.risp_prog_id = d.drop_risp_prog_id
    group by d.drop_prog_id,
    a.opre_cms_oppty_id,
    c.more_tipo_revisione,
    drop_prog_id,
    e.doma_testo,
    d.drop_valore_risposta,
    h.risp_valore,
    d.drop_valore_commento1,
    d.drop_valore_commento2,
    f.grdo_descrizione,
    f.grdo_prog_id
    order by a.opre_cms_oppty_id,
    min(f.GRDO_ORDINE) ,
    min(g.MODO_ORDINE)

    row_number() over (partition by <group> order by <whatever>)

  • Gets the new id of auto-increment field by jdbc

    There is a auto-increment index field of a table. I would like to add a row in that table by jdbc. The process is success and the index will increase automatically. However i would like to get the newly added index number. How can i do this? Thanks a lot.

    This is off of Microsoft's T-SQL site http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_tsqlcon_6lyk.asp
    @@IDENTITY and SCOPE_IDENTITY will return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value only within the current scope; @@IDENTITY is not limited to a specific scope.
    IDENT_CURRENT is not limited by scope and session; it is limited to a specified table. IDENT_CURRENT returns the identity value generated for a specific table in any session and any scope. For more information, see IDENT_CURRENT.

  • Prefixing and auto-increment field

    Hello
    I have a web application (php/mySQL) that has an auto-increment primary key field called job_id.
    Could anyone help me add a prefix to this?
    I want to add the year and month (YYMM/) in front of the field (e.g. 0811/1234 then 0811/1235 assuming current month and year is Nov 2008).
    Maybe Im wrong about adding the prefix to the primary key. Should I maybe add an additional field to maintain this?
    Any advice greatly appreciated...
    Regards
    Paul

    Hi Paul,
    MySQL table and column names may only consist of letters, underscores and numbers anyway, so the date format you´d like to use would lead to errors due to the forward slashes.
    Maybe Im wrong about adding the prefix to the primary key.
    I don´t know what you want to achieve with this approach, but I´d really leave the name of the Primary Key column "as is" and use a different column for storing data which contains such date values.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Creating an auto incrementing field with CREATE TABLE from Java

    I'm using the "sun.jdbc.odbc.JdbcOdbcDriver" to get a connection towards an ODBC data source that's linked to a Access (.mdb) database.
    I've tried various combinations in my CREATE TABLE statement execution in order to create a table with an auto incrementing integer but neither of them work, not even the most obvious one:
    stmt.executeUpdate("CREATE TABLE mytable(uid integer AUTO_INCREMENT PRIMARY KEY);");
    I always get this runtime exception: *java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition*; and AUTO_INCREMENT is the problem. I've tried all variations like AUTO, INCREMENT, AUTOINCREMENT and such, but nothing works.
    I've looked everywhere but couldn't find an answer to this. Thanks for the help.

    You used MySQL syntax. I think you agree with me that Access isn't a MySQL database. Either use MySQL with a real JDBC driver (recommended) or use Access syntax.
    That said, creating databases and tables using Java is a bad idea. The database and table must be already there. With Java you just do the usual table operations like select, insert, update and delete. Nothing more is needed.

  • Auto-incrementing field?

    I am designing a publication which refers to numbers on a Reader Service Card and am looking for a technique to have these numbers auto-increment.
    Throughout the document, a Text Frame appears that reads "Circle# 10 on the Reader Service Card." This may appear multiple times on a single page, or not at all. I need for the 10 to start at 1 and increment each time we get to it in order.
    I have read several helpful posts relating to similar issues. I could certainly use multiple Text Frames, one with "Circle# on the Reader Service Card." and a smaller one for the number. Thread the smaller ones together and fill them with:
    "1
    2
    3
    4
    5
    6
    This would work, but I would have to re-thread each time the ads are reordered. And I would have to change the spacing on the bottom Text Frame at the point that we go from single-digit to double-digit numbers.
    I also investigated Data Merge, but it seems better suited for single-page documents in which the only thing that changes are the content records. Using the same data source from above, I don't see a way to insert the field throughout a multi-page document and have it go to the next record each time it is encountered.
    I am using CS5. Any suggestions would be appreciated. Thanks.

    I have made some progress by using a script, as suggested: http://forums.adobe.com/message/2366871.
    count = 0;
    str = "";
    while (count < 100)
    count++;
    str += "Circle #"+count+" on reader service card."+"\r";
    app.selection[0].contents = str;
    This script will insert the proper text lines into the selected Text Frame. The subsequent ones still have be manually threaded, but at least each is in a single Text Frame and I don't have to worry about spacing. If numbers change I can go to the first one and re-run the script.
    Now if there were some way to dynamically thread Text Frames...

  • Auto increment field

    Hi Pals,
    How to add an autoincrement to a field?\
    Thanks in advance

    user633962 wrote:
    It is either sequence or trigger that i need to use not both , coz when the finger print is read it should add the record with the sequece no. generatedA sequence is just a number generator with some extremly usefull attributes.
    - each time you call sequence.NEXTVAL it gives you a new unique number
    - several users(=sessions) fetch a new sequences number and you will have no overlaps
    - no locking = fast multi user access
    - synchonized between RAC instances
    - usually no sequences numbers are lost
    How you use that sequence is up to you. To generate primary key (ID) numbers with it is certainly the most common way.
    To do this you can use two approaches.
    a) use sequence.nextval each time you write an insert statement
    b) do not fill the ID column by yourself, but have a before row insert trigger that calls sequence.nextval to automagically fill the ID with the correct new value.
    Approach b) is what resembles an autoincrement field (similiar to MS Access) most. However a seqeunce provides much more flexibility. For example you can reuse the same sequence for other tables. Also things like MS Access have trouble doing this with several users accessing the same database simultaniously.

  • Problem with Auo Increment field in Database table

    HI...
    I have a table with Auto increment field.
    I am using Sql Server 2000.
    I have a Table Component on front end which is binded with that (auto increment) table.
    When I call commitChanges() I receive following exception :
    Exception Details:  java.lang.RuntimeException
      Number of conflicts while synchronizing: 1 SyncResolver.INSERT_ROW_CONFLICT row 2 [sunm][SQLServer JDBC Driver][SQLServer]Cannot insert explicit value for identity column in table 'Authorization_Book' when IDENTITY_INSERT is set to OFF.Anybody knows the solution...

    The following excerpts are from http://blogs.sun.com/roller/page/jfbrown?entry=using_creator_to_insert_into. Do they help?
    What about IDENTITY or AUTOINCREMENT or other database-generated columns?
    This is highly database dependent. Some databases require you to obtain the key through vendor-specific means. Others say "set the value to null". Some say to not include the column in the INSERT statement.
    So how do I exclude my IDENTITY or other column from the INSERT statement?
    Use the RowSet's advanced insertableColumns property. Create a boolean[] array with one value for each column in the result. Use true to include the column in the INSERT statement, otherwise use false. The RowSet's property sheet doesn't allow you to set this property (in Creator2-EA2), so set the property in your java code.

  • CMP with auto-increment primary key.Please help

    Hi all,
    I new with EJB technology so please bear with me.
    Env: 2k Server, SQL 2k Server
    Sun One(Forte EE) to develop and deploy CMP
    I got the servlet to load the data from CMP's business mehods
    is fine. Calling the findPrimaryKey is OK too. Even when I try to insert the row into DB is OK. At this time I make key PK is int AND NOT
    AUTO INCREMENT everything is OK. In the ejbCreate method
    I called setPK, setName ...It's fine.
    The problem comes when I try to make the PK(still int) to be auto-increment field.In ejbCreate not call setPK because of in SunOne IDE, under the J2EE RI tab of EJB Module property, the Auto generate SQL I set to false so that I can
    modify the SQL statement under SQL Deployment.createRow not taking the PK. I thought that will do it but it doesnot like it at all (I got Exception with transaction rollback)I just want to insert a single row with ID and name that's all.
    Then I changed the SQL statment take PK and changed the Auto Generate SQL to True and in ejbCreate the PK as one of the args and called setPK this time with null object. It doesn't like neither.(Exception Cannot set the primary key with null. That is reasonable.)
    I thought using EJB fast and clean technique would help developer to develop application with easiness.
    So I realy stuck with this, I wonder ejb 2.0 support for auto increment at all because I would like to take advantage of the auto increment feature of the DB without writing the PrimaryKeySequence generator at all.
    Am I missing something with this? May be just config thing to tell
    that my PK is auto-increment field so that when the ejbCreate called it knows not taking the PK or even not asking to call setPK in ejbCreate.
    Any help would appreciated.

    Check out this thread, there's a bunch of good info:
    http://www.theserverside.com/patterns/thread.jsp?thread_id=4976

  • How to get auto-increment value after insert on ACCESS db?

    When you insert a new record to a table with an auto-incrementing key, how do you find the value for the row you just inserted? This works differently with different databases. I know how it's done on ORACLE and mySql.
    How does it work with ACCESS through ODBC? How about MSSQL?

    I have discovered there's a LAST aggregate function which when I've tested it gets the just inserted auto-increment, but I'm not sure if it's reliable. You have to do:
    SELECT LAST(index-field) FROM table
    That ought to be faster than MAX, which I've noticed some people use. Persumable LAST will get the value from the last row in the table's natural order.
    In fact an auto-increment field has no business filling in missing slots since the main point is a a foreign key in other tables and a foreign key pointing to a deleted table row ought to be invalidated, not point to some unrelated successor record.
    I could use a separate table as a source of counters, of course, though that's one more call. In either case I'm worried about thread safety. In Oracle there are special sequence objects for this purpose which are incremented and read atomically. I'm not sure if the access driver transaction handling works adequately.
    Perhaps the safest approach might be to use a separate sequencer table and Java sychronisation to serialise access to each row in the sequencer table (assuming all the access is from the same app).

Maybe you are looking for