Forums

This topic is locked

Insert new record - Inner Joins

Posted 31 Jul 2003 13:19:48
1
has voted
31 Jul 2003 13:19:48 Dave Desormeaux posted:
Please help. This must be a common enough scenario but I'm having troubles.

I'm trying to create a new record. I have an inner join to another table. But I don't see the fields for the joined table in the "insert Record" dialogue box. This is an admin section and I want the user to select one or more "themes" from a selection of radio buttons or check boxes. The selections are coming from the table "theme", which I don't want to update, just use as a data source.

Here is my SQL statement for the recordset (which works fine for searching and retrieving records from the DB). Should I be adding something to this?

SELECT photo.photoid, photo.filename, photo.description, photo.thumbname, photo.cityid, photo.countryname, photo.filename, photo.date, photo.themename, theme.theme, theme.themeid
FROM theme INNER JOIN (photo INNER JOIN photo_theme ON photo.photoid = photo_theme.photoid) ON theme.themeid = photo_theme.themeid

Thanks!!!

Replies

Replied 31 Jul 2003 14:26:37
31 Jul 2003 14:26:37 Vince Baker replied:
The insert record action in DW only lets you insert into a single specified table.

If you want to insert data into two or more tables you will need to hand code the insert statements.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 31 Jul 2003 16:15:19
31 Jul 2003 16:15:19 Dave Desormeaux replied:
Thanks. I was hoping it would be easier than that...

However, I am absolutely unfamiliar with writing SQL statements and incorporating them into an asp page.

Might you have any suggestions on where to start for pointers, tips, examples, etc?

Dave

Reply to this topic