Insert record and return the primary key

Okay, I need to insert a record into a MSSQL database and return the primary key of that record. Im using the following code which is obviously wrong as I'm getting either 'NULL' or 'com.microsoft.jdbc.base.BaseResultSet@1d520c4' returned depending on the ways I've tried. The primary key is an int value called clientID which is incremented by one each time a new record is added.
// set the prepared statement
            String sql="INSERT INTO Client(username, country, clientIP, browser, os) VALUES(?,?,?,?,?)";
            PreparedStatement pstmt = conn.prepareStatement(sql);
            pstmt.setString(1, inUserName);
            pstmt.setString(2, inCountry);
            pstmt.setString(3, inClientIP);
            pstmt.setString(4, inBrowser);
            pstmt.setString(5, inOS);
            // Insert the row
            pstmt.executeUpdate();
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery("SELECT SCOPE_IDENTITY()");
            System.out.println("Result "+rs);The primary key value is needed so that it can be used as a foregin key in another table. Am I going about this the correct way? Any help, pointers or code fixing would be appreciated.....

Yes. I tried this way but I only ever get the answer
of 0 when i print our the result! Not really sure
whats happening.That's because you don't print a ResultSet like that. In order to get the key out, you have to do this:
int key = 0;
while (rs.next())
    key = rs.getInt(1);What were you thinking with your code?
You might want to do this in a transaction. If the INSERT fails, you'll want to roll back.
The "select @@identity" is correct for M$ Access, SQL Server, and Sybase. I believe it's also correct for MySQL, but I'm not 100% certain of that.
%

Similar Messages

  • Help me to return the primary key after insert the row

    Hi
    I am using JDBC, with oracle database. i have welformed normalization tables .i am inserting parent table with dynamic sequence number as primary key .after inserting i need inserted row primary key .how to get the inserted row primary key with out using select statement
    please help me
    Thanks in advance
    Edited by: 849614 on Apr 4, 2011 5:41 AM
    Edited by: 849614 on Apr 4, 2011 5:54 AM

    Hello
    If I undestand you, I think you should do this:
    Connection conexion = dataSource.getConnection();
    int idCenter=-1;
    String query = "Begin Insert into CENTER (NAME_CENTER) values (?) returning ID_CENTER into ?; end";
    callableStatement = conexion.prepareCall(query.toString());     
         callableStatement.setString(1, "Center name");               
         callableStatement.registerOutParameter(2, java.sql.Types.INTEGER);
              callableStatement.executeUpdate();
              idCenter=callableStatement.getInt(2);
    This way, you have in idCenter the primary key of the line that has just been inserted.
    Edited by: cris on 05-abr-2011 5:28

  • Does JDBC insert a value into the Primary Key?

    Hi,
    I'm using a servlet to input data froma n html form ,into an ACCESS Database.I'm using SQL statements i t he servlet ,and i'm confronted with the question:
    ALL database records are indexed with B_ID as the "Primary Key".
    I want to know: If I add the fields without a B_ID ..will SQL/JDBC/Access automatically add one for me?
    Or must I create the system that will count the records before adding a new B_ID?
    Hope you can help me.Thanks!
    Aesh83

    Access has a datatype claus for this autoincrement feature.
    I just can't remember its name.
    If you have such a primary key column in your table, you would simply insert values in each column except that, so this would automatically generate its value by incrementing the key.
    Your INSERT had to enumerate all columns you explicitely fill with values and skip this key column and those ones which shall be set to NULL btw. the defined default value (is there a DEFAULT clause in Access?)

  • What is the best way to drop and recreate a Primary Key in the Replication Table?

    I have a requirement to drop and recreate a primary key in a table which is part of Transaction replication. What is the best way to fo it other than remove it from replication and add again?
    Thanks
    Swapna

    Hi Swapna,
    Unfortunately you cannot drop columns used in a primary key from articles in transactional replication.  This is covered in
    Make Schema Changes on Publication Databases:
    You cannot drop columns used in a primary key from articles in transactional publications, because they are used by replication.
    You will need to drop the article from the publication, drop and recreate the primary key, and add the article back into the publication.
    To avoid having to send a snapshot down to the subscriber(s), you could specify the option 'replication support only' for the subscription.  This would require the primary key be modified at the subscriber as well prior to adding the article back in
    and should be done during a maintenance window when no activity is occurring on the published tables.
    I suggest testing this out in your test environment first, prior to deploying to production.
    Brandon Williams (blog |
    linkedin)

  • JDeveloper 10g Creating a new record with trigger sequence primary key

    Hi there, I'm sorry to post this incredibly simple question and I'm sure that someone must have answered this on this forum before but the searching of this site is incredible slow and painful and after 30 mins I can't find help.
    I am using a struts Data Action to create a new record in the database and then being forwarded to an edit page where I can enter the new details. Then when the details are entered I am clicking an update button and returning to a browse screen where I can either commit the change to the database or rollback. Sounds pretty simple but I am really struggling with trying to get the trigger of the number sequence to work properly.
    Ideally I would like to click the create new record button and then the primary key/triggered sequence number is already displayed on the empty form...
    ... but if this is too tricky or not possible then I would like the user to either not enter any value in the key field (which currently causes error - JBO-27014: Attribute PoNo in PO_SYS_MODULE.PoSystemView1 is required) OR the user enters a number and the trigger overwrites this number with the next in the sequence.
    I can enter a new record if I look in the manager console and see the next number in the sequence and then create the record using this number and then click commit twice, as the first time I get the error: JBO-25019: Entity row of key oracle.jbo.Key[154 ] not found in PoSystem. Or if I enter a value 5 times greater than the next in the sequence I have to click the commit button 5 extra times to get the sequence to match the input.
    I hope that this lengthy explanation fills you in on my problem, there must be a simple solution to this and I will be VERY grateful to anyone who can help me.
    Many thanks
    Ben Sayers (clearly a newbie)

    Hi,
    ADF Business Components handles this for you - unless yo prefer doing this manually. In the Entity Object, set the PK attribute's type to DBSequence. Then create a database sequence and use a database trigger to add the sequence value on insert
    Frank

  • Generate the primary key  automatically while records are saved

    Hi experts,
    I need to generate the primary key of a custom table automatically when a new record is saved. Pleas help asap. Urgent.

    Hi Rob and vikas,
       Thanks for your answers . Both of the solutions you mentioned were syntactically correct and activated but they are not populating the numbers.In case of Rob's soultion  I guess I am not able to catch the return number. I am giving the code below. So Please look into it,
    FORM gen_manu_siteid .
    data : number type zsiteid value 155.
    CALL FUNCTION 'NUMBER_GET_NEXT'
      EXPORTING
        NR_RANGE_NR                   = '02'
        OBJECT                        = 'zmanusite'
        QUANTITY                      = '1'
      SUBOBJECT                     = ' '
      TOYEAR                        = '0000'
      IGNORE_BUFFER                 = ' '
      IMPORTING
        NUMBER                        = number
      QUANTITY                      =
      RETURNCODE                    =
    EXCEPTIONS
      INTERVAL_NOT_FOUND            = 1
      NUMBER_RANGE_NOT_INTERN       = 2
      OBJECT_NOT_FOUND              = 3
      QUANTITY_IS_0                 = 4
      QUANTITY_IS_NOT_1             = 5
      INTERVAL_OVERFLOW             = 6
      BUFFER_OVERFLOW               = 7
      OTHERS                        = 8
    *IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ztblqm_sqm-zsiteid = number .
    ENDFORM.                    " gen_manu_siteid
    When this did not work. i tried Vikas's soution and the code i used for this is
    FORM gen_manu_siteid .
    data : w_count like ztblqm_sqm-zsiteid,
           e_wa like ztblqm_sqm occurs 0 with header line.
    select max( zsiteid ) from ztblqm_sqm into w_count .
    w_count = w_count + 1.
    e_wa-zsiteid = w_count.
    modify ztblqm_sqm  from e_wa.
    ENDFORM.                    " gen_manu_siteid
    Please look into this and give me a solution.
    NB: I have tried them at the event 01 include.

  • Returning autogenerated primary key after insertion

    Hi
    I am inserting a row into the database using simple jdbc statement. The primary key for that row is autogenerated by the database.
    Is there any way to get the primary key and return it to the user?

    PreparedStatement ps = con.preparedStatement("INSERT INTO Table (title, name) VALUES ("test", "name")", PreparedStatement.RETURN_GENERATED_KEYS);
    ps.executrUpdate();
    ResultSet rs = ps.getGeneratedKeys();
    while (rs.next()) {
    primaryKey = rs.getInt(1);
    }

  • Parameters in Url..how do I use login information to insert the primary key

    Uggg, it is 3 am, I am so tired. Please help.
    I have made a registration page for my site. Hurray it works.
    Login Page. It works
    Protected some pages. Works
    Now I am trying to make a page that the users can go to and update their user information. User name, password, email ect.
    I can get it to prepopulate if I put ?id=3, or someother primary key in the url by hand.....and it does update the data.... but I can't, for the life of me, figure out how to make it use the users login information to get and insert the primary key in the url from the link to the update page.
    I have used the hyperlink box and chose the updateaccount.php file, then went to parameters and selected Name: id Value: I chose id from the dropdown from the data base. This puts in an echo that looks like it should work. NO SUCH LUCK.
    Pleeeese!!! What am I doing wrong.
    I am a total novice. Done a few static sites. So please speak slowly.
    Thanks sooooo much

    I really can´t recommend exposing critical stuff like e.g. the user´s login_id in the URL, because once it´s visible, it can be changed by anyone. Better insert the Session Variable kt_login_id, which will only be availabe on a custom PHP page when inserting...
    <?php session_start(); ?>
    ...on line 1 of this document.
    Cheers,
    Günter

  • Insert a DB record and receive the Record ID

    Hi !
    I'm trying to populate a DB (two tables) based
    on the classic master/detail approach.
    These steps represent what I would like to achieve :
    1) add the master record and get the corresponding primary key
    2) add multiple records in another table using the Master Prim.key
    That seems to be so simple,
    but I have no idea how to get the Master PrimaryKey.
    Thanks.
    GB.

    You can't get a result back from the standard database call. If there is another unique field, you could query again based on that. I needed something with one child record. I did the whole thing in a PL/SQL block passing all the parameters to one call.
    To get a value back from a call, look at this thread: http://www.adobeforums.com/webx/.59b7d6b1/3

  • I have a macbook pro with OSX Mavericks 10.9.5 and some keys that are not working. Specifically, the enter/return button, the "p", "0", ";", and all the function keys.  What's really weird is that happens randomly.  I've never spilled anything on it

    I have a macbook pro with OSX Mavericks 10.9.5 and some keys randomly are not working. Specifically, the enter/return button, the "p", "0", ";", and all the function keys.  What's really weird is that happens randomly.  I've never spilled anything on it, and I can't for the life of me figure out how to fix this.  Can anyone help?  of course this happened after my warranty expired.

    **update**
    I don't know if this will help someone but I am posting this for that purpose.  In the past when I first had this problem, I'd read a post somewhere (sorry, long ago, don't have the link) where an individual was having the same problem and they stated that when the MBP got heated, that's when the keys would stop working, and they went into the MBP and jiggle some stuff around (a specific wire, I'm not electronically inclined so I know NOT of what they spake!).  Well I didn't want to do that but it always stuck in the back of my mind.  I had given up, really, and was planning to take my MBP to the apple store.  But by chance one night I left my MBP on the floor where it's cool, and when I turned it on, the problem went - poof! It seems there was some validity to the post that spoke about heat, because my problems started when I would stream foreign dramas on my MBP for hours at night, and I would hear the fan going off all the time, and in the mornings, my "p", "enter", "0", ";", and all the function keys would stop working. 
    So, maybe try keeping the MBP in a cool place when it's off.  Since I've started doing this overnight every night (keeping it on the cool floor, out of reach of any big feet), I have not had a single problem with my keyboard.
    Hopefully this might help someone.

  • Please check the LIVE CHAT Record and return my money back.

    This is the situation.
    My 2-year contract ended on 1-15-2015, and I ordered a new device iphone 6 plus (64G) on 1-13-2015 and selected Edge plan (I line, 1GB data, unlimited call and message from 1-15-2015, totally price $80/ month). I had a live chat with a lady and a man, and also confirmed it with call. 
    Now I found that the bill became $183 !!!  6GB data is stead of 1GB. The stupid thing is that I paid the same amount ($183) last month as I thought first month charged more because of handing fee.... Now this month It also 183. So I contact with LIVE chat person and ask them to check the LIVE CHAT record to compensate the losses. They told me that they can't enter the record and can't make this remedy. 
    So, why do I need take resposible for this mistake? Why do I need pay $200 more? Why can't your guys see the record and find the evidences? Actually I only use 20% data of 1GB, why you HELP me order 6GB? 
    Solved!
    Go to Solution.

    Welcome to the forums.  You're talking to other users here.  Further, your talking to users of Verizon's fixed location residential services including FiOS, DSL and telephone.  Your issue is with Verizon Wireless.  Visit their web site for support options.
    http://www.verizonwireless.com/
    Good Luck.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.

  • Using a custom PL/SQL to populate the primary key in a tabular form

    I want to use a Custom PL/SQL Function to populate the primary key when I insert a new record into a tabular form. I want to get the value from a hidden page Item. The code I am using for the primary key source is:
    BEGIN
    INSERT INTO TEAM_MEMBERS(TEAM_ID)
    VALUES(:P75_TEAM_ID);
    END;
    When I try to insert a new record I get the following error:
    Error      ERR-1904 Unable to compute item default: type = Function Body computation_type= BEGIN INSERT INTO TEAM_MEMBERS(TEAM_ID) VALUES(:P75_TEAM_ID); END; .
    ORA-06550: line 5, column 2: PLS-00103: Encountered the symbol ";" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe The symbol "exit" was substit
    Any ideas what I am doing wrong?
    Thanks!

    Brian - Sometimes whitespace at the end of the block causes this. Be sure to trim everything after the last semicolon including tabs and newlines.
    Scott

  • Too many objects match the primary key oracle.jbo.Key

    Hi OAF Gurus,
    Currently we are implementing R12 Upgrade , for this we have deployed all the custom OAF Application related files on to the the respective JAVA_TOP folder.
    We have a custom municipal postal application which tracks the Postal Details.
    The page runs perfectly fine without any error in 11i instance, but the same is erroring out In R12.
    In R12 it shows an error as Too many objects match the primary key oracle.jbo.Key[112010 2014-10-01]
    here 112010 is nothing but the postal code id and 2014-10-01 is the Effective Start Date
    We have a custom table as xxad_postal_codes_f  (Date Track table)which contains the postal_code_id and effective_start_date (primary key is combination of postal_code_id and effective_start_date ).
    The Table already contains a row for postal_code_id = 112010  and Effective_Start_date = Sysdate.
    Now we want to update the entry for the same postal code with the Id being same as 112010  and  Effective_Start_date as 2014-10-01 through custom PostCodeChangePG
    at the time of save we are getting an error as Too many objects match the primary key oracle.jbo.Key[112010 2014-10-01]
    The table doesn't contain any of the data mentioned ([112010 2014-10-01]) at the time of insertion, hence there should not be any duplication of primary key but still we are getting the error.
    Please let us know how can we handle this..?
    Below is the code which is getting called on Click of Save button of PostCodeChangePG
    if (pageContext.getParameter("Apply") != null)
          PCodeCoWorkerBase coWorker = getCoWorker(pageContext, webBean);
              coWorker.processApply();
    Code in PCodeCoWorkerBase
        public void processApply()
          String postalCodeId = UIHelper.getRequiredParameter(pageContext, "postalCodeId");
          Date startDate = UIHelper.getRequiredDateParameter(pageContext , "EffectiveStartDate");
         Serializable[] postalCodeData = (Serializable[]) applicationModule.invokeMethod( "insertPostalCodeMajorChange", params, paramTypes );
          finalizeTransactionAndRedirect( postalCodeData );
    Code in Application Module
      public Serializable[] insertPostalCodeMajorChange ( String postalCodeId, Date date )
        PCodeAmWorker amWorker = new PCodeAmWorker(this);
        return amWorker.insertMajorChange( postalCodeId, DateHelper.convertClientToServerDate( getOADBTransaction(), date )
    Code in PCodeAmWorker
      public Serializable[] insertMajorChange ( String postalCodeId, Date date )
        // Get the view objects we need from the application module
        OAViewObject viewObject = (OAViewObject) applicationModule.getPCodesVO();
        PCodesVORowImpl currentRow = (PCodesVORowImpl) viewObject.getCurrentRow();
        currentRow.validate();
        currentRow.setEffectiveStartDate(date);
        currentRow.setComment1(currentRow.getNewComment());
    // Create a new row based on the current row
    PCodesVORowImpl newRow = (PCodesVORowImpl) viewObject.createAndInitRow(currentRow); //This is failing out and gives the error
    // Get the new effective start date as entered by the user
    Date effectiveStartDate = currentRow.getEffectiveStartDate();
        // Calculate the previous period's effective end date
        Date previousEffectiveEndDate = DateHelper.addDays(effectiveStartDate, -1);
        // Refresh the current row (the one changed by the UI) with the data it had at the beginning of the transaction
        currentRow.refresh(Row.REFRESH_UNDO_CHANGES);
        // The current row will now represent data for the the previous period set the effective end date for the previous period
        currentRow.setEffectiveEndDate(previousEffectiveEndDate);
        // Insert the newly created row that now represents the new period
        viewObject.insertRow(newRow);
        applicationModule.apply();
        return generateResult(newRow);
    PCodesVO() is based on PostalCodeEO
    below is the code from PostalCodeEOImpl
      public void create(AttributeList attributeList)
        // NOTE: This call will set attribute values if the entity object  is created with a call to vo.createAndInitRow(..)
        super.create(attributeList);
        if (getPostalCodeId() == null)
          setPostalCodeId(getOADBTransaction().getSequenceValue("XXAD_POSTAL_CODES_S"));
        if (getEffectiveStartDate() == null)
          setEffectiveStartDate(getOADBTransaction().getCurrentDBDate());
    After diagnosing the issue we found that the error is on the code of AMworker file while creating a new row PCodesVORowImpl newRow = (PCodesVORowImpl) viewObject.createAndInitRow(currentRow);
    we tried so many things such as clearing entity cache, VO cache, validating for duplicate primary key but still not able to resolved this.
    Please advice how to insert a new row on the PCodesVORowImpl without any exception.
    Thanks,
    Pallavi

    Hi ,
    One question here , if you are udating a existing record then why you are trying to create a new row
    PCodesVORowImpl newRow = (PCodesVORowImpl) viewObject.createAndInitRow(currentRow);
    Thanks
    Pratap

  • Error while creating the Unique Index of the Primary Key of an Item

    Hi all,
    I have deployed a new item (CO_CONTRACTUNIT_PRODUCT) in my publication. The deploy appears to be successfull as the item can be seen in the repository through the Mobile Manager.
    The problem occurs when i sync my local DB to get the item offline. While synchronizing, the following error appears, both in the sync window and the log file ol_sync.log.
    "ERROR",POL-5130,"11/09/2010 11:43:52","table or view %s.%s not found:CO_CONTRACTUNIT_PRODUCT,CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID","DB_ROSHNI"
    However, the debug file gives this other error regarding this table.
    ALL_INDEX:CREATE UNIQUE INDEX "TPCO_CONTRACTUNIT_PRODUCT_PK" ON CO_CONTRACTUNIT_PRODUCT (CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID) -5130Error at C:\ADE\omeprod_ol103021\olite\db\build\win\ocapi\..\..\..\src\ocapi\allindexes.cpp line:329 rc:-5130
    Build date Mar 29 2010
    okErr=(table or view %s.%s not found)
    mess=(CO_CONTRACTUNIT_PRODUCT,CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID)
    AddLog(-5130 "ERROR",POL-5130,"11/09/2010 11:43:52","table or view %s.%s not found:CO_CONTRACTUNIT_PRODUCT,CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID","DB_ROSHNI")
    But the index that is being created and is giving the error is the index created automatically with the Primary Key of the table, and so nothing has been modified in that.
    The primary key of the table is created with the three columns that are part of the index that is returning the error.
    As I could not solve the error, I tried to drop and re-create the item in the repository, but no luck. As a last option, i tried to remove the item from the repository to be able to sync properly again (just like before creating the item), but the error still happens.
    Another weird point is that i have tried creating the item in another publication of another database (but with almost equal items), and the item could was downloaded to my local DB without any problem, which makes this problem still more bizarre.
    What can it be?
    Any help would be great!
    Roshni

    have you tried unistalling the client and reinstalling it?
    schema evolution changes are not always handled correctly please check thread:
    Modification of publication item into Mobile Server
    i quote from rekounas instructions:
    If you are just adding a field, you should only have to run the alter publication item API call.
    Here is an old note on schema evolution on different scenarios. The names for the APIs that they use are now deprecated. Use the ConsolidatorManager class and call the method alterPublicationItem("PUBLICATION_ITEM_NAME", "SELECT STMT") :
    A) Add column
    1. Upload all client data. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Change the Oracle8i/9i database schema (add column)
    4. Create a Java program to call the Consolidator Admin API AlterPublicationItem()
    5. Start Mobile Server
    6. Execute a sync from the client
    7. The new column should be seen on the client. Use MSQL to check snapshot definitions.
    B) Drop column
    1. Upload all client data. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Delete column of the base table in the Oracle database schema
    4. Create a Java program to call the Consolidator Admin API DropPublicationItem()
    5. Create a Java program to call the Consolidator Admin API CreatePublicationItem() and AddPublicationItem().
    6. Start Mobile Server
    7. Execute a sync from the client
    8. The new column should be seen on the cliet. Use MSQL to check snapshot definitions.
    C) Change column datatype
    Changing datatypes in a repliatated system is not an easy task. You have to follow certain procedures in order to make it to work. Use DropPublicationItem, CreatePublicationItem and AddPublicationItem methods from the Consolidator Admin API. You must stop/start Mobile Server listener to refresh the cache.
    1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Drop/create column (do not use conversion procudures) at the base table
    4. Call DropPublicationItem(). Check if the ErrorQueue and InQueue no longer exist.
    5. Call CreatePublicationItem() and AddPublicationItem(). Check if the ErrorQueue and InQueue reflect the new column datatype
    6. Start Mobile Server. This automatically resumes application
    7. Client executes sync. This should drop the old snapshot and recreate the new snapshot. Use MSQL to check
    snapshot definitions.
    D) Drop table
    1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Drop base table
    4. Call DropPublicationItem(). Check if the ErrorQueue and InQueue no longer exist.
    5. Start Mobile Server. This automatically resumes application
    6. Client executes sync. This should drop the old snapshot. Use MSQL to check snapshot definitions.
    E) Add table
    1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Add new base table
    4. Call CreatePublicationItem() and AddPublicationItem() method
    5. Start Mobile Server. This automatically resumes application
    6. Client executes sync. This should add the new snapshot. Use MSQL to check snapshot definitions.
    F) Changing Primary Keys
    Chaning PK is a severe operation which must be executed manually. A snapshot must be deleted and recreated to propagate the changes to the clients. This causes a full refresh on this snapshot.
    1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
    2. Stop Mobile Server listener
    3. Drop the snapshot using DropPublicationItem() method o
    4. Alter the base table
    5. Call CreatePublicationItem()and AddPublicationItem() methods for the altered table
    6. Start Mobile Server. This automatically resumes application
    7. Client executes sync. The old snapshot will be replaced by the new snapstot using a full refresh. Use MSQL to check snapshot definitions.
    G) To Change a Table Weight =>
    Follow the procedure below to change the Table Weight parameter. The table weight is used by the Mobile Server/Synchronization to determin the sequence in which client records are applied to the Oracle database.
    1. Run MGP to apply any changes in the InQueue to the Oracle databse
    2. Change table weight using SetTemplateItemMetadata() method
    3. Add/change constraint on the the base table which reflects the change in table weight
    4. Synchronize
    gl m8

  • Sql*loader and sequence() for primary keys

    I have a question regarding SQL*Loader with the sequence() function and using it for a primary key to load records in multiple tables from one input record. I am pulling data from a delimited file and populating several tables from each row. For the primary key, I am using the sequence function.
    For the first table (the parent), I use sequence(40000,1) for the key. Since the remaining inserts are based on the same logical record, I use sequence(40000,1) for those too (one record for each month). The problem comes in when a child record does not pass a WHEN clause (the amount is zero). Then it almost seems as if the parent record is not loaded and the child (or children) that does pass the WHEN clause are assigned to the next parent! Obviously, the sequence is getting out of sync between the children and the parent.
    I've looked in the documentation and tried several different ways to attack this problem. Is there a bug in SQLLDR (8.1.7) or is it just my coding.
    I will try to include the files below but they are very large.
    Thanks for your help.
    Dan
    ***CONTROL FILE***
    LOAD DATA
    INFILE 'rent.csv'
    INTO TABLE BUDGET_LINE
    append
    WHEN TOT_AMT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER CHAR,
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    OCT_AMT          FILLER CHAR,
    OCT_CNT          FILLER CHAR,
    NOV_AMT          FILLER CHAR,
    NOV_CNT          FILLER CHAR,
    DEC_AMT          FILLER CHAR,
    DEC_CNT          FILLER CHAR,
    CUT               FILLER CHAR,
    NETMANGEN          FILLER CHAR,
    NETMAN_item          BOUNDFILLER CHAR,
    NETMAN_item_seq     BOUNDFILLER CHAR,
    NETMAN_location     BOUNDFILLER CHAR,
    UPDATED_ON          DATE "MM/DD/YYYY",
    NETMAN_com_desc     BOUNDFILLER CHAR,
    NETMAN_vendor          BOUNDFILLER CHAR,
    NETMAN_generation     BOUNDFILLER CHAR,
    CREATED_ON          SYSDATE,
    CREATED_BY          CONSTANT '0',
    UPDATED_BY          CONSTANT '0',
    ACTIVE          CONSTANT 'T',
    GL_CODE_COMBO_ID     CONSTANT '0',
    BUDGET_TYPE          CONSTANT 'B',
    AMOUNT_TYPE          CONSTANT 'D',
    source          constant 'N',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    DESCRIPTION          "(:NETMAN_item)||'-'||(:NETMAN_item_seq)||'; '||:NETMAN_com_desc||'; '||:NETMAN_vendor||' ('||:NETMAN_generation||')'"
    INTO TABLE GL_CODE_TEMP
    append
    WHEN TOT_AMT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    SPENDER          CHAR ,
    ACCT               CHAR ,
    TOT_AMT          FILLER CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '1',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '2',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '3',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '4',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '5',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '6',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '7',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '8',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '9',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '10',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '11',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    OCT_AMT          FILLER CHAR,
    OCT_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '12',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    OCT_AMT          FILLER CHAR,
    OCT_CNT          FILLER CHAR,
    NOV_AMT          FILLER CHAR,
    NOV_CNT          FILLER CHAR,
    AMOUNT          CHAR
    *** PIECE OF DATA FILE ***
    Item,Spender,Account,Total Amt,Jan Amt,Jan Count,Feb Amt,Feb Count,Mar Amt,Mar Count,Apr Amt,Apr Count,May Amt,May Count,Jun Amt,Jun Count,Jul Amt,Jul Count,Aug Amt,Aug Count,Sep Amt,Sep Count,Oct Amt,Oct Count,Nov Amt,Nov Count,Dec Amt,Dec Count,Status,Netman Gen,Netman Item,Netman Unit,Location,Last Update Date,Component Description,Vendor Description,Generation Process
    10110993,10993,8301-01,90134,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7667,0,7667,0,0,+,LEASE PYMT,207,WIMOS,5/22/2002,LEASE PAYMENTS,"VIKING HOLDING, INC.",ACTUAL BUDGET
    10410993,10993,8301-04,15240,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,0,+,JANITORIAL,58,WIMOS,5/22/2002,JANITORIAL,BUILDING ONE SVC SOLUTION,ACTUAL BUDGET
    10810993,10993,8301-08,2232,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,0,+,ELECTRIC,77,WIMOS,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",WISCONSIN PUBLIC SERVICE,AVGD 01 04 07 10 NOT WEIGHTED
    10910993,10993,8301-09,4220,26,0,348,0,609,0,383,0,348,0,371,0,348,0,371,0,360,0,348,0,360,0,348,0,0,+,FIRE EQUIP,51,WIMOS,5/22/2002,RENT CONTRACT SERVICES,"CENTRALCOM, INC.",ACTUAL EXPERIENCE
    11610993,10993,8301-16,1272,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,0,+,L/H MOSINE,1,WIMOS,5/22/2002,LEASEHOLD IMPROVEMENTS,ELLIS STONE,ACTUAL BUDGET
    10110994,10994,8301-01,69960,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,0,+,LEASE PYMT,228,WISTEWEL,5/22/2002,LEASE PAYMENTS,BJ INVESTMENTS LLC,ACTUAL BUDGET
    10410994,10994,8301-04,840,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,0,+,JANITORIAL,69,WISTEWEL,5/22/2002,JANITORIAL,MARSDEN,ACTUAL BUDGET
    10710994,10994,8301-07,6067,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6067,0,0,+,LEASE PYMT,228,WISTEWEL,5/22/2002,LEASE PAYMENTS,BJ INVESTMENTS LLC,ASSUME 5% INCREASE OVER ACTUAL 2000 EXPENSES
    10810994,10994,8301-08,2460,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,0,+,ELECTRIC,84,WISTEWEL,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",BJ INVESTMENTS LLC,AVGD 03 06 09 NOT WEIGHTED
    10910994,10994,8301-09,1050,70,0,70,0,105,0,105,0,70,0,105,0,35,0,140,0,35,0,70,0,210,0,35,0,0,+,SANITATION,12,WISTEWEL,5/22/2002,RENT CONTRACT SERVICES,WASTE MANAGEMENT OF WIS,ACTUAL EXPERIENCE
    11910994,10994,8301-19,1099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1099,0,0,0,0,0,0,0,0,0,0,+,INSURANCE,6,WISTEWEL,5/22/2002,INSURANCE,BJ INVESTMENTS LLC,ACTUAL EXPERIENCE
    10110998,10998,8301-01,2440,2440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ACTUAL BUDGET
    10410998,10998,8301-04,146,146,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ACTUAL BUDGET
    10610998,10998,8301-06,336,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,0,+,DRINK H2O,46,ILELG,5/22/2002,COOLER AND BOTTLED WATER,"HINCKLEY & SCHMITT, INC.",AVGD 01 02 03 04 05 06 07 08 09 10
    10710998,10998,8301-07,276,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ASSUME 5% INCREASE OVER ACTUAL 2000 EXPENSES
    10810998,10998,8301-08,3108,433,0,315,0,234,0,173,0,181,0,292,0,320,0,337,0,316,0,153,0,183,0,171,0,0,+,ELECTRIC,20,ILELG,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",COMMONWEALTH EDISON,AVGD 01 02 03 04 05 06 07 08 09 10 WEIGHTED
    *** SCRIPT FOR TABLES LOADED ***
    CREATE TABLE BUDGET_LINE (
    BUDGET_LINE_ID NUMBER NOT NULL,
    BUDGET_TYPE CHAR (1) NOT NULL,
    GL_CODE_COMBO_ID NUMBER NOT NULL,
    AMOUNT_TYPE CHAR (1) NOT NULL,
    ACTIVE CHAR (1) DEFAULT 'T' NOT NULL,
    SOURCE CHAR (1),
    CUT CHAR (1),
    DESCRIPTION VARCHAR2 (180),
    CAP_ITEM_ID NUMBER,
    PBT_ID NUMBER,
    BILL_ID NUMBER,
    CREATED_ON DATE DEFAULT SYSDATE NOT NULL,
    CREATED_BY NUMBER NOT NULL,
    UPDATED_ON DATE DEFAULT SYSDATE NOT NULL,
    UPDATED_BY NUMBER NOT NULL,
    CHECK (ACTIVE IN ('T','F') ) ,
    CHECK (CUT IN ('C',NULL) ),
    CONSTRAINT BUDGET_LINE_PRI
    PRIMARY KEY ( BUDGET_LINE_ID ) ) ;
    CREATE TABLE BUDGET_COST (
    BUDGET_LINE_ID NUMBER NOT NULL,
    PERIOD_ID NUMBER NOT NULL,
    AMOUNT NUMBER (13,2),
    CONSTRAINT BUDGET_COST_PRI
    PRIMARY KEY ( BUDGET_LINE_ID, PERIOD_ID ) ) ;
    CREATE TABLE GL_CODE_TEMP (
    BUDGET_LINE_ID NUMBER NOT NULL,
    SPENDER CHAR (5),
    ACCT CHAR (7),
    GL_CODE_COMBO_ID NUMBER,
    CONSTRAINT GL_CODE_TEMP_BDGT_ID
    PRIMARY KEY ( BUDGET_LINE_ID ) ) ;

    Thanks for the reply .. user do have their user credentials but only for the application ... but all users use a common loader and control file once they log into the application. So irrespective of which user is logged in he selects the same control file and loads to the same table mentioned in the control file .. i instead want user to be able to load to the table in control file but into his schema like username.tablename instead of just the tablename mentioned in .ctl file.

Maybe you are looking for

  • Good RAM to place in MacBook 2.2Ghz?

    I am interested in replacing the 2X512MB that comes with the MacBook, I did not want to upgrade it to 2GB for $160 because I know you can get it for cheaper. Is it really worth it to upgrade the 1GB? If so, what would good types of RAM be for a great

  • Port number while mentioned the RFC for reciever business system

    hi   Could somebody tell me what is the port number to be mentioned while specifying the RFC for reciever busines system in the integration builder)configuration phase

  • Can't access movies on Apple TV after update

    I updated my Apple TV today and I can now no longer access the movies section.  As soon as I go into movies (or TV shows), the Apple TV re-sets and shows the home page again in 5-10 seconds.  Other apps on Apple tv like youtube and NBA are working fi

  • Help! Compressor 1.2.1...Deadline Looms!

    I have a movie created in FCP HD 4, exporting it into Compressor and using presets for MPEG2 60min High Quality. The footage is "8mm movie footage" ...using this compressor setting with De-Interlace(even) and due I suppose t all the motion in the mov

  • Big targets on linechart

    Pretty strait forward. I have a chart with a single series of data, using a line chart and I want to make the tips more pronounced. The style I am going for is very much like the Dashboard example where each point is just bigger then the line so you