mySQL 5.5 Does Not Support SHORT


jesawyers

Recommended Posts

Hello All,

Been getting more and more proficient with DF and have a question about setting up a alarm database using mySQL 5.5.

I've got the ALARMS setup to log to a database and have the ODBC connection setup and working fine. Problem is when DF tries to create the table for ALARMS, it appears that DF is wanting to create a column with a data type of SHORT which mySQL5.5 does not support that I can see. I manually created a table in mySQL and the SHORT data type is not listed as an option.

Here is the actual error reported by DF...

C1021 Could not create table for alarm logging. Msg: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SHORT, Status TEXT(1))' at line 1

Can this be fixed?

John

Link to comment
Share on other sites

Sure, here's the exact SQL statement DF uses:

CREATE TABLE ALARMLOG (TheTime DATE, Name TEXT(100), Description TEXT(255), Priority SHORT, Status TEXT(1));

Do the same thing in mySQL, adjusting the values appropriately. You can probably replace SHORT with INT and TEXT with VARCHAR.

Link to comment
Share on other sites

Got the alarm table created using the following SQL command in mySQL Workbench...

CREATE TABLE ALARMLOG (TheTime DATE, Name VARCHAR(100), Description VARCHAR(255), Priority TinyINT, Status VARCHAR(1))

However when an alarm fires I still get the error that was previously reported.

Any thoughts?

John

Link to comment
Share on other sites

  • 3 weeks later...

Have not heard anything about my reply. Again I got the alarm table created, but DF is still reporting the error I orginally reported in my first post.

Thanks...john

Link to comment
Share on other sites

Ok..found the problem. When creating the alarmlog table I tried using TinyInt for the priority. Set the priority column in the alarmlog table to INT and it's working.

Link to comment
Share on other sites

Yeah, that'd probably do it. Just as an aside, unless you are doing gigantic databases (billions of records), the days of having to worry about conserving integer sizes is kind of long gone. Hell, even if you have a billion records, the difference in space between a TINYINT (which is 1 byte) and an INT (which is 4 bytes) is only 3 gig of hard drive space. Considering 1 TB (1000 gig) drives are about $100, its really not worth the trouble.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the info. I'm from the days of main frame computers and conserving memory is just something I have never gotten over in all of these years of programming.

Thanks again....John

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.