This topic is locked

Query cannot be updated because the FROM clause is not a single simple

1/19/2010 6:45:42 AM
ASPRunnerPro General questions
M
MrDerp author

I am trying to update a record that happens to span across two tables.
My tables are Products and Stock and I am using a select query similar to the following:
SELECT

Products.ProductCode,

Products.Description,

Stock.Quantity

FROM Products, Stock

WHERE Stock.ProductCode = Product.ProductCode AND Stock.Quantity <> 0
I have created an edit page but when I try to update a field (e.g. Description) I get the following error:



<<< Record was NOT edited >>>
Query cannot be updated because the FROM clause is not a single simple table name.


It seems the only way that I can resolve this issue is by amending the SQL to not include the second table (Stock).
Please could you advise as to how I can remove the second table from my FROM clause? Or, if this isn't the way to do it, what other options do I have?
Thanks in anticipation.

M
MrDerp author 1/19/2010

Thanks for your reply, Jane.
I've been using that code but it doesn't work with images. The custom SQL adds the image name to the database, but doesn't actually upload the image.
Is there a way to force the image upload with custom SQL?
Cheers.

J
Jane 1/19/2010

Hi,
unfortunately there is no easy way to upload image automatically.

You should write custom code in the event to upload file.

M
MrDerp author 1/19/2010

Would you be able to give me some example code?
I wouldn't know where to start!

J
Jane 1/20/2010

Hi,
check sample code in the DoInsertRecord function in the include/aspfunctions.asp file.