What is wrong with these SQL statements??
-
Hiya getting a message saying "Database error - There were no columns specified to retrive." when using these 2 lines: SqlString = "DELETE * from Branches WHERE Branch_No LIKE '4%' "; OR SqlString = "INSERT INTO Branches (Branch_No,Branch_Name) VALUES ('6','Derry') "; But Branch_No is the first column and Branch_Name is the second.. Am I using the statements wrong?? Thanks, grahamoj.
-
Hiya getting a message saying "Database error - There were no columns specified to retrive." when using these 2 lines: SqlString = "DELETE * from Branches WHERE Branch_No LIKE '4%' "; OR SqlString = "INSERT INTO Branches (Branch_No,Branch_Name) VALUES ('6','Derry') "; But Branch_No is the first column and Branch_Name is the second.. Am I using the statements wrong?? Thanks, grahamoj.
DELETE statement do not need * from.Change it to: DELETE Branches WHERE Branch_No LIKE '4%' For second one,Whats the type of columns? Mazy "And the carpet needs a haircut, and the spotlight looks like a prison break And the telephone's out of cigarettes, and the balcony is on the make And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
-
DELETE statement do not need * from.Change it to: DELETE Branches WHERE Branch_No LIKE '4%' For second one,Whats the type of columns? Mazy "And the carpet needs a haircut, and the spotlight looks like a prison break And the telephone's out of cigarettes, and the balcony is on the make And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
-
You don't need the "*" but you'll need "from" so the right statement will be (at least in SQL92)
DELETE FROM branches WHERE branch_no LIKE '4%'
-- karl -
Yes. :) Mazy "And the carpet needs a haircut, and the spotlight looks like a prison break And the telephone's out of cigarettes, and the balcony is on the make And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
Would you have a full list of all the statements( that is right syntax ) available to use for me?? What is the syntax for the INSERT?? Thanks for ur help. grahamoj.
-
Would you have a full list of all the statements( that is right syntax ) available to use for me?? What is the syntax for the INSERT?? Thanks for ur help. grahamoj.
Hiya have tried the DELETE as u suggested but still not working for me. I think I know what it is though. What should this line change to for reading and writing.. // Execute the query recset.Open( CRecordset::forwardOnly,SqlString,CRecordset::readOnly ); Have tried a "CRecordset::writeOnly, but none exists. Thanks grahamoj. Have also tried this: recset.Open( AFX_DB_USE_DEFAULT_TYPE,SqlString,CRecordset::none );
-
Hiya have tried the DELETE as u suggested but still not working for me. I think I know what it is though. What should this line change to for reading and writing.. // Execute the query recset.Open( CRecordset::forwardOnly,SqlString,CRecordset::readOnly ); Have tried a "CRecordset::writeOnly, but none exists. Thanks grahamoj. Have also tried this: recset.Open( AFX_DB_USE_DEFAULT_TYPE,SqlString,CRecordset::none );
Could you post your table-definition? What database are you using? Maybe you have to use
\'
instead of'
? A full SQL-Specification can be found here: http://developer.mimer.com/documentation/Mimer_SQL_Reference_Manual/Mimer_SQL_ReferenceTOC.html[^] -- karl