Your table definition looks pretty reasonable to me (perhaps I'm missing something).

Are you sure it's really that column? You have a lot of "NOT NULL" constraints in "table event", maybe it's one of the other ones?

You previously wrote that inserting values "by hand" (sqlite3 command line tool?) works fine, which seems to imply a bug in your Java code.

-- Kostya

14.03.2011 19:11, Brad Stintson пишет:
What happens is that it doesn't allow multiple entries for that pro_id. I'm not able to understand why that is happening.


On Mon, Mar 14, 2011 at 8:48 PM, Kostya Vasilyev <[email protected] <mailto:[email protected]>> wrote:

    14.03.2011 17:36, Brad Stintson пишет:

        I assigned pre-defined  value for foregin key. The thing that
        happens is that on first time use of that key, an entry is
        created in database. But if I use that value for second time
        then value is not updated in database


    Brad,

    Not sure if I understand what you meant about predefined values.

    The basic idea is: every time you insert a new row into "table
    event", make sure that "pro_id" is set to one of the existing
    values of "_id" in "table profile".

    For updates, use the "_id" in "table event" to identify the row
    you're updating, and either leave the "pro_id" alone (thus keeping
    the old value) or set it to a valid "_id" in "table profile".


-- Kostya Vasilyev -- http://kmansoft.wordpress.com

-- You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to
    [email protected]
    <mailto:[email protected]>
    To unsubscribe from this group, send email to
    [email protected]
    <mailto:android-developers%[email protected]>
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to