dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: SQL Server
Expertise: Beginner
Aug 30, 1999

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Problem Using Execute SQL in Microsoft Query

Question:
In Microsoft Query I can't seem to use the Execute SQL function. I'm learning SQL from a book called The ColdFusion 4.0 Web Application Construction Kit (Macmillan, 1998). The book has an example that goes like this:
  1. Open Execute SQL in Microsoft Query.
  2. Specify Data source.
  3. Type:
      INSERT INTO Departments(Department)
      VALUES ('Administration')
    
Each time I try to do this I get an error message that says, "This operation must use an updateable query". I am not really sure what that means and I can't find any help files to explain it to me.

Please help!

Answer:
I must admit I find it mystifying myself but I will hazard a guess that what makes a query updateable is the presence of a primary key column, a way to distinguish one row from another.

In your example you provide only "Administration" as a value. I wonder what would happen if the Departments table also had a field called "ID"? If so, I bet changing your statement to read something like this will fix it:

INSERT INTO Departments(Department, ID)
VALUES ('Administration', 4) would do it.
Mind the data type of ID. As you can see, I have assumed INT and that there is no other ID of 4 in the column, but it could be almost anything.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date