Dumb newbie like question
-
I have been using SQL for a while but I still cant get a definitive answer to this. Given a table with a dword column which of these is correct: INSERT INTO table (dvalue) VALUES ('0') or INSERT INTO table (dvalue) VALUES (0) I seem to have some examples for each and the DB engine I'm using seems to only allow the first.
-
I have been using SQL for a while but I still cant get a definitive answer to this. Given a table with a dword column which of these is correct: INSERT INTO table (dvalue) VALUES ('0') or INSERT INTO table (dvalue) VALUES (0) I seem to have some examples for each and the DB engine I'm using seems to only allow the first.
It depends on the datatype of the column. Assuming you a re using SQL Server, if the datatype of the column is float or int, then you would use the second example. For datatypes such as varchar, char, nvarchar and nchar, you would use your first example. Jeremy Jeremy Oldham
-
It depends on the datatype of the column. Assuming you a re using SQL Server, if the datatype of the column is float or int, then you would use the second example. For datatypes such as varchar, char, nvarchar and nchar, you would use your first example. Jeremy Jeremy Oldham
-
Bangerman wrote: Shame the implementation im using is busted then. What DB are you using?
-
Bangerman wrote: Shame the implementation im using is busted then. What DB are you using?
-
EDB V4.3 Its a real pain because im porting my app to use ODBC and I think I'm ging to end up having to have two versions of every SQL in my program.
No you're not. Implement a function like this (in pseudo code here) string DecideWhetherMyDBImplementationIsBrokenAndWrapANumberProperlyForIt ( DWORD n) { if (broken db) return "'" + string(n) + "'"; else return string(n); } and use that a lot.
#include <beer.h>