×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How do you make an updatable SQL table?

How do you make an updatable SQL table?

How do you make an updatable SQL table?

(OP)
Rajrajcoomar replied to a post below in regard to an SQL statement saying that he would first make an updatable SQL table.  How do you do this?  I've been trying to figure it out for some time now.  I have several places in my app where I want to pull selected records out of an existing table and put them in a grid for the user to select from.  I need one or two fields from the original table and a TAGGED field that can be toggled by the user's actions.  I would love to use an SQL query to fill the grid, but that always makes a read-only cursor, which is useless to me, so I end up with a page of code from CREATE CURSOR to the SCAN FOR..ENDSCAN block that fills it.

So, how do you make an updatable SQL table?

RE: How do you make an updatable SQL table?

Hi
Select your DATA tab.. select the view you want to make updatable.. Click on modify..
NOw click on the tab.. UPDATE CRITERIA
Now clik just below the key picture and
then adjacent to all fields you want to update .. if you cant figure out.. click on UPDATE ALL button.. you will see the tick mark againt all fields.. now you can figure it out.. The wizard is guiding you all these what I said..
Hope this is helpful

ramani
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

RE: How do you make an updatable SQL table?

(OP)
So, this isn't something you can create programmatically?  It has to be made in the database?  What I was hoping for was just a cursor, local to the session, that can have its data changed, but that is not persistent in the database.  Is this possible?  Or do I have to do this:

create cursor myCursor(field 1,field 2,field 3,...,tagged l)
select myTable
goto top
m.tagged = .F.
scan for (mycriteria)
    scatter memvar memo
    insert into myCursor from memvar
endscan

What I was hoping for was some kind of SQL statement that would pull the records I want, but would be LOCAL to the session and NOT persistent in the database.

RE: How do you make an updatable SQL table?

Actually the easiest way to get a SQL 'selected' cursor updatetable is to use  the new VFP 7.0 option:
... INTO CURSOR CursorName READWRITE ...

Before this, you "cheat" and access the temporary table that VFP uses IF you don't create a SELECT that VFP can create by simply filtering the original table.

Your example would work something like this:
SELECT a.field1,a.field2,a.field 3, ...,;
 .T. as tagged;
 FROM myTable a ;
 INTO CURSOR myCursor ;
 WHERE <mycriteria>
USE DBF('myCursor') alias pTable IN 0 AGAIN
SELECT pTable
BROWSE

Rick

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close