Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing....

Status
Not open for further replies.

Pesteo

Programmer
Feb 3, 2003
17
0
0
US
I have a cursor with which I am trying to update an existing table with the primary keys already entered.

What is the proper way of scaning through the cursor, selecting the matching table in the permanent table, and then passing the values from the cursor into the permanent table...

I am having problems with reference syntax I believe....

You would use a select to find the record,in the permanent table, but how do you reference the value of the of the cell being pointed to in the cursor table???

f1 is the name of the column in the cursor, sample_num is the name of the column in the table....

My select is looking like this....my question is, how do I make f1 point to the value in the selected row, referenced column of the cursor, so that I can see that I can compare a sample_num to a sample_num, and then update the permanent table with accurate data....

SELECT * FROM table where sample_num = f1
REPLACE Column2(from table) with f2(from cursor),;
...124 more fields ...
 
HI

Example..

GridsColumnName is not material..
GridsRecordSource = myCursor
TableName = table1

Now.. if...
myCursorFieldName = F1C1
Equivalent Table1s Field name = T1C1

REPLACE table1.T1C1 WITH myCursor.F1C1

SO you can loop thru the myCursor..
Locate for changed values..
Call the equivalent record of the table..
and do the update as above.


BUT if you use an updatable view, all you have to do is.. TABLEUPDATE(). But learn about buffering and such related topics.
:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top