New topic: Can RecordSet Edit values from multiple tables?
<http://forums.realsoftware.com/viewtopic.php?t=39814> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message x11joex11 Post subject: Can RecordSet Edit values from multiple tables?Posted: Tue Jul 12, 2011 4:11 pm Joined: Thu Oct 12, 2006 7:21 am Posts: 391 Location: California Lets say I have the following database Code:SQL = "CREATE TABLE htmldata(id INTEGER PRIMARY KEY, parenthesis INTEGER, resultnum INTEGER, metroID INTEGER, cityID INTEGER, datatype varchar, UNIQUE(metroID,cityID,datatype));" SQL = SQL + "CREATE INDEX idxCityID ON htmldata(cityID);" SQL = SQL + "CREATE INDEX idxMetroID ON htmldata(metroID);" SQL = SQL + "CREATE INDEX idxDataType ON htmldata(datatype);" SQL = SQL + "CREATE TABLE metrocodes(id INTEGER PRIMARY KEY, metroCodeNum INTEGER,state VARCHAR, url VARCHAR, selected BOOLEAN);" SQL = SQL + "CREATE TABLE citydata(id INTEGER PRIMARY KEY, name VARCHAR, state VARCHAR, metroCodes VARCHAR, selected BOOLEAN);" myDB.SQLExecute(sql) and I do the following query. Code:sql = "SELECT parenthesis,resultnum,datatype,cd.name,mc.metroCodeNum,cd.metrocodes AS cityMetroCodes,cd.id AS theCityID FROM htmldata hd JOIN citydata cd, metrocodes mc ON hd.cityID=cd.id AND hd.metroID=mc.metroCodeNum WHERE mc.selected='1' AND cd.selected='1'" Can I do something like this? Code: rs.Edit rs.Field("cityMetroCodes").value=rs.Field("cityMetroCodes").StringValue+"^"+metroCode rs.Update Where its editing a value that is actually in another table? (and I'm using an alias name). I tried doing this but don't think it's working. _________________ Joe Astrahan CEO - iTechware Inc. iTechware - Internet, Technology & Software Google Adwords Campaign Management "Rocketing you to the top!" 10900 Los Alamitos Blvd, Suite #210 Los Alamitos, CA, 90720 (949)354-4ADS Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
