Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
INSERT INTO targettable (Field1, Field2) VALUES (value1, value2)
USE targettable
APPEND FROM sourcetable
INSERT INTO targettable SELECT * FROM sourcetable
USE tblNames
UPDATE tblNames SET ID = ID.ID WHERE tblNames.RECNO() = ID.RECNO()
GO TOP IN csrIDs
SELECT csrNames
SCAN
GO RECNO("csrIDs")
REPLACE csrNames.nID WITH csrIDs.nID
SKIP IN csrIDs
ENDSCAN
Code:UPDATE tblNames SET ID = ID.ID WHERE tblNames.RECNO() = ID.RECNO()
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
mjcmkrsr already mentioned it's a bad idea to use reserved words for names of tables (or fields, or variables), I'll not dive into this.pcwaleed said:I have two tables... name and id
OK, that doesn't tell how the table is structured, but ok.pcwaleed said:table name have 400 records
OK, and that same record count indicates you want to join data 1:1pcwaleed said:table id have 400 id
Confirms my intuition, and now tells me, you have the id field in both name and id table. Or do you have two tables with each just one field, name.name and id.id and want to generate a third table t3 with both fields?pcwaleed said:i would like inset 400 ids in table name
like this
name id
pcWaleed said:i would like inset 400 ids in table name
like this
name id
ghghg 15565
gfghfgh 6786
kjggjg 8768
2) If the RECNO() in the two tables may serve as the link you might code something like below.
however the recno() should never ever serve as a relation identification
I must insert table id to table name randomly
* --- The following assumes that there are as many or more ID's than Names ---
SELECT IDTable
SCAN
m.id = IDTable.ID
SELECT NameTable
LOCATE FOR EMPTY(NameTable.ID)
REPLACE NameTable.ID WITH m.ID
SELECT IDTable
ENDSCAN