473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

MYSQL Error if column name true or false

Hello,
i just updated my mysql database from 4.0.x to 4.1 because i like to
have the possibility to create subqueries. My problem with the new
release is the following:
In my running project i have some tables with the column name True and
False.
In the old version it was possible to do a INSERT in the following
manner:

INSERT INTO
kinkedtube( observationID , expertID,TRUE, False)
VALUES ( 125,789, 0.235, 0.258);

Now with the new version 4.1. i get a MYSQL ERROR (SQL-State: 42000,
ErrorCode: 1064). I also know how to fix the problem, if i change the
statement to

INSERT INTO
kinkedtube( observationID , expertID,kinkedtube.TRUE,
kinkedtube.False)
VALUES ( 1020,1020, 0.235, 0.258);

I dont get an error and the data get inserted in my db;
But i dont want to chance my database or my java code, so how can i
tell the mysql database that it does insert the record without adding
the table name / alias to the column name. ( Oh, something else: It is
important that the tablename is written casesensetive. If you write
KINKEDTUBE.true i also get an error).
Thanks a lot for your help and advice. Have a good one ...
Elmar
Jul 19 '05 #1
2 5574
BDR
> But i dont want to chance my database or my java code,

The way I see it, you don't have any choice.

True and False are now used by MySql as aliases... of course you know
this now...

http://www.mysql.com/doc/en/MaxDB_Reserved_Words.html

BOOLEAN was added in MySQL version 4.1.0; it is a synonym for BOOL which
is mapped to TINYINT(1). It accepts integer values in the same range as
TINYINT as well as NULL. TRUE and FALSE can be used as aliases for 1 and 0.

Elmar Grandel wrote:
Hello,
i just updated my mysql database from 4.0.x to 4.1 because i like to
have the possibility to create subqueries. My problem with the new
release is the following:
In my running project i have some tables with the column name True and
False.
In the old version it was possible to do a INSERT in the following
manner:

INSERT INTO
kinkedtube( observationID , expertID,TRUE, False)
VALUES ( 125,789, 0.235, 0.258);

Now with the new version 4.1. i get a MYSQL ERROR (SQL-State: 42000,
ErrorCode: 1064). I also know how to fix the problem, if i change the
statement to

INSERT INTO
kinkedtube( observationID , expertID,kinkedtube.TRUE,
kinkedtube.False)
VALUES ( 1020,1020, 0.235, 0.258);

I dont get an error and the data get inserted in my db;
But i dont want to chance my database or my java code, so how can i
tell the mysql database that it does insert the record without adding
the table name / alias to the column name. ( Oh, something else: It is
important that the tablename is written casesensetive. If you write
KINKEDTUBE.true i also get an error).
Thanks a lot for your help and advice. Have a good one ...
Elmar


Jul 19 '05 #2
BDR
> But i dont want to chance my database or my java code,

The way I see it, you don't have any choice.

True and False are now used by MySql as aliases... of course you know
this now...

http://www.mysql.com/doc/en/MaxDB_Reserved_Words.html

BOOLEAN was added in MySQL version 4.1.0; it is a synonym for BOOL which
is mapped to TINYINT(1). It accepts integer values in the same range as
TINYINT as well as NULL. TRUE and FALSE can be used as aliases for 1 and 0.

Elmar Grandel wrote:
Hello,
i just updated my mysql database from 4.0.x to 4.1 because i like to
have the possibility to create subqueries. My problem with the new
release is the following:
In my running project i have some tables with the column name True and
False.
In the old version it was possible to do a INSERT in the following
manner:

INSERT INTO
kinkedtube( observationID , expertID,TRUE, False)
VALUES ( 125,789, 0.235, 0.258);

Now with the new version 4.1. i get a MYSQL ERROR (SQL-State: 42000,
ErrorCode: 1064). I also know how to fix the problem, if i change the
statement to

INSERT INTO
kinkedtube( observationID , expertID,kinkedtube.TRUE,
kinkedtube.False)
VALUES ( 1020,1020, 0.235, 0.258);

I dont get an error and the data get inserted in my db;
But i dont want to chance my database or my java code, so how can i
tell the mysql database that it does insert the record without adding
the table name / alias to the column name. ( Oh, something else: It is
important that the tablename is written casesensetive. If you write
KINKEDTUBE.true i also get an error).
Thanks a lot for your help and advice. Have a good one ...
Elmar


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
5
by: Tom Martin | last post by:
I'm a Java Web developer NEWBIE that has inherited a website that fails every 2 hours due to poor connection pooling between Tomcat 4.0.6 and mySQL. In efforts to resolve this problem, I've...
0
by: Elmar Grandel | last post by:
Hello, i just updated my mysql database from 4.0.x to 4.1 because i like to have the possibility to create subqueries. My problem with the new release is the following: In my running project i...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
0
by: zfraile | last post by:
I'm getting this error from the JIT compiler at runtime, but only on my boss' machine, not my development machine. I believe the error is generated from a call to an Excel object, but I can't tell...
4
by: Abdhul Saleem | last post by:
Hi, I am recieving error ActiveX component can't create object in the following line in the asp page. set ExcelApp = CreateObject("Excel.Application") Previously this code was working fine....
6
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.