On Tue, 1 Jan 2008 15:53:05 -0600, "Jay Sprenkle" <[EMAIL PROTECTED]> wrote:
>Good afternoon all, > >I'm working on a project using Sqlite. I'm using a query to fill a >table presented to the user. >I'd like to be able to edit the data cell by cell. I can easily call >the column metadata >functions and get the database, table, and column where that data came from. >If I want to update it then I need the rowid or key for that piece of data too. >If the original query is a join can you get any information on the >fields used for the join? > >for example: > >select Role.*, User.Name > from Role > join User on User.RoleId = Role.Id >Where User.Id = 6 > >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. > >Happy New Year! Same to you and everyone else here! -- ( Kees Nuyt ) c[_] ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------