janak vyas
Technical User
I was searching in this forum answers to my question and found this code :
CREATE TABLE tblNames (cId C(5), cName C(10))
INSERT INTO tblNames (cName) VALUES ("Michi")
INSERT INTO tblNames (cName) VALUES ("Mecky")
INSERT INTO tblNames (cName) VALUES ("Myaer")
INSERT INTO tblNames (cName) VALUES ("Johnny")
INSERT INTO tblNames (cName) VALUES ("Zicky")
BROWSE
CREATE TABLE tblIDs (cId C(5))
INSERT INTO tblIDs (cID) VALUES ("A2345")
INSERT INTO tblIDs (cID) VALUES ("B2345")
INSERT INTO tblIDs (cID) VALUES ("C2345")
INSERT INTO tblIDs (cID) VALUES ("D2345")
INSERT INTO tblIDs (cID) VALUES ("E2345")
BROWSE
SELECT tblIDs
SCAN
UPDATE tblNames SET cID = tblIDs.cID WHERE RECNO("tblNames") = RECNO("tblIDs")
ENDSCAN
SELECT tblNames
BROWSE
CLOSE ALL
CLEAR ALL]
I was not successful in implementing this code in my program.
USE trans21
USE bill_coy
SELECT bill_coy
SCAN ALL
*UPDATE tblNames SET cID = tblIDs.cID WHERE RECNO("tblNames") = RECNO("tblIDs")
UPDATE trans21 SET ahead = bill_coy.comp_name WHERE RECNO("trans21") = RECNO("bill_coy")
ENDSCAN
SELECT trans21
BROWSE
CLOSE ALL
CLEAR ALL]
The only difference I could see is that I have two tables, one is "bill_coy" which has all records filled and the other "trans21" with no records, while in the example that I found on the forum has two table with records in both of them.
Also can someone suggest me the old fashioned way to do this, like where I first store the fields from bill_coy to the variables and then while using DO while .not. EOF(), Replace that variables with the fields of trans21 ?
I know it is such a basic thing to do for all of you and that is why I need your help.
CREATE TABLE tblNames (cId C(5), cName C(10))
INSERT INTO tblNames (cName) VALUES ("Michi")
INSERT INTO tblNames (cName) VALUES ("Mecky")
INSERT INTO tblNames (cName) VALUES ("Myaer")
INSERT INTO tblNames (cName) VALUES ("Johnny")
INSERT INTO tblNames (cName) VALUES ("Zicky")
BROWSE
CREATE TABLE tblIDs (cId C(5))
INSERT INTO tblIDs (cID) VALUES ("A2345")
INSERT INTO tblIDs (cID) VALUES ("B2345")
INSERT INTO tblIDs (cID) VALUES ("C2345")
INSERT INTO tblIDs (cID) VALUES ("D2345")
INSERT INTO tblIDs (cID) VALUES ("E2345")
BROWSE
SELECT tblIDs
SCAN
UPDATE tblNames SET cID = tblIDs.cID WHERE RECNO("tblNames") = RECNO("tblIDs")
ENDSCAN
SELECT tblNames
BROWSE
CLOSE ALL
CLEAR ALL]
I was not successful in implementing this code in my program.
USE trans21
USE bill_coy
SELECT bill_coy
SCAN ALL
*UPDATE tblNames SET cID = tblIDs.cID WHERE RECNO("tblNames") = RECNO("tblIDs")
UPDATE trans21 SET ahead = bill_coy.comp_name WHERE RECNO("trans21") = RECNO("bill_coy")
ENDSCAN
SELECT trans21
BROWSE
CLOSE ALL
CLEAR ALL]
The only difference I could see is that I have two tables, one is "bill_coy" which has all records filled and the other "trans21" with no records, while in the example that I found on the forum has two table with records in both of them.
Also can someone suggest me the old fashioned way to do this, like where I first store the fields from bill_coy to the variables and then while using DO while .not. EOF(), Replace that variables with the fields of trans21 ?
I know it is such a basic thing to do for all of you and that is why I need your help.