|
SQL is the abbreviation for Structured Query Language pronounced one of two ways; SEQUEL or ESS-Q-L
Firstly a connection to a SQL database must be made. With SQL tools, you can use Enterprise Manager or in Visual FoxPro create a data source connection and then use the SQLCONNECT(datasource, username, password)
Once you have a File Handle, you can then use SQLEXEC(FH, [SQL Command], [cCursor])
To get the data
SELECT [ALL | DISTINCT] [column1, column2, ]
FROM [table1, table2]
WHERE conditions
GROUP BY [column-list]
HAVING "conditions
"
ORDER BY "column-list" ASC | DESC
Tip: You cannot get back deleted data without a backup
Tip 2: Before doing a delete, I always use a select first, verify that the result set is what I want to delete and then change the SELECT to a DELETE
DELETE FROM <table> WHERE condition
UPDATE <table> SET FIELD Field1 = SomeValue WHERE condition
|