CiaoBaby
asked on
Executing Querys in code
IBDatabase1.Open;
IBQuery1.Database := IBDatabase1;
IBQuery1.SQL.Clear;
//All the examples show
// Insert into employee(Field1, Field2) Values('1','Price')
// Problem is that the entire string has to be in single quotes
//None of these work
IBQuery1.SQL.Add('Insert into Employee(PersonID, LastName) Values(1, Price)');
IBQuery1.SQL.Add('Insert into Employee(PersonID, LastName) Values(1, "Price")');
IBQuery1.Transaction.Start Transactio n;
IBQuery1.ExecSQL;
// This generates the error - 'Dynamic SQL Error SQL Error Code = -206
// column unknown
// PRICE
IBQuery1.Transaction.Commi t;
IBDatabase1.Close;
IBQuery1.Database := IBDatabase1;
IBQuery1.SQL.Clear;
//All the examples show
// Insert into employee(Field1, Field2) Values('1','Price')
// Problem is that the entire string has to be in single quotes
//None of these work
IBQuery1.SQL.Add('Insert into Employee(PersonID, LastName) Values(1, Price)');
IBQuery1.SQL.Add('Insert into Employee(PersonID, LastName) Values(1, "Price")');
IBQuery1.Transaction.Start
IBQuery1.ExecSQL;
// This generates the error - 'Dynamic SQL Error SQL Error Code = -206
// column unknown
// PRICE
IBQuery1.Transaction.Commi
IBDatabase1.Close;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, no. This depends on the programming language used, and is no part of SQL specification.
ASKER