On Tue, 1 Jan 2008 16:40:21 -0600, "Jay Sprenkle"
<[EMAIL PROTECTED]> wrote:

>> >If they try to edit a column from the Role table how do I get to Role.Id?
>> >If I can get Sqlite to tell me what it used to select the row in the result 
>> >set
>> >it would be much easier that the alternatives.
>>
>> You can always query the ROWIDs (as long as there is no GROUP
>> BY), with something like:
>>
>> SELECT Role.ROWID,Role.*, User.Name
>>   FROM Role
>>   JOIN User ON User.RoleId = Role.Id
>>  WHERE User.Id = 6
>>
>> Instead of the ROWID, you also could use the value of the
>> PRIMARY KEY of the row in the resultset (Role.id ?), it probably
>> already is available in Role.*.
>> Iterate over the columns in the resultset and it should be
>> there. But perhaps I didn't understand your question correctly?
>
>Thanks :)
>I know how to find the column I want, but I'm not sure how my program will
>identify the correct column in the result set. It could be any of the rows,
>or not even in the result set. If you use this query:
>
>select role.name, user.name from role join user on user.roleid = role.id;
>
>The key column isn't in the result set for either table.
>
>Sqlite parsed my query and as it reads the results knows the row it's
>reading from for each column.
>I want that data so I can go back and edit the data I presented to the users.
>I don't think what I want is available from sqlite now.

It doesn't come automatically, but you can get it if you ask for
it, so I don't understand what the problem is.


>I can get a query column's name, size, type, and value, but I can't
>tell if it's an index column or what column(s) were used to select
>that column.

You know the query, and also the schema, for example from 
        PRAGMA table_info(tabelname);
That includes primary key info.
Merge that with the info from the resultset and you know what
you need to know, don't you? 

Ok, you don't get the primary key or ROWID unless you explicitly
ask for it. That's SQL ;)
-- 
  (  Kees Nuyt
  )
c[_]

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to