Member Login
member
passwd
remember me on
this computer.

- join now -
- forgot username or password? -

Search

Jump to a Date

Sponsored Communities
Cool stuff
Select a topic of interest:
...and press:
Neat Stuff
Control.com Stuff

Visit our shop for nerds in control lifestyle products.

Fortune
"If you have to hate, hate gently"
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss/
To get a personalized feed, become a member at no cost.
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
advertisement
from the Automation List department...
Citect and mySQL
Human-Machine Interface and SCADA. topic
Posted by Alexander van Deurzen on 13 February, 2007 - 12:48 am
Hello,

I would like to know if somebody could help me with the problem I have to communicate with a mySQL database.

The ODBC connection is no problem. When I try an SQLExec function the following error occured.

(Descriptor type out of range 307). I looked for the help function and called our distributer for this problem. The couldn't give support because Citect and mySQL is not there thing.

I already read something about it and that Matthew Richardson managed the communication between Citect and mySQL.

I was wondering if somebody could help me?

With best regards,

Alexander van Deurzen


(EXCAMPLE CODE THAT IS USED)

FUNCTION
ListNames()
INT hSQL;
STRING sName;
INT Status;

hSQL = SQLConnect("DSN=ZZL_Standaard;UID=Ditis;PWD=kwasie;SRVR=why" );
IF hSQL <> -1 THEN
Status = SQLExec(hSQL, "SELECT * FROM tblloog");
IF Status = 0 THEN
WHILE SQLNext(hSQL) = 0 DO

sName = SQLGetField(hSQL, "Name");
Message("Data", sName , 48);

END
SQLEnd(hSQL);
ELSE
Message("Er rorStatus", SQLErrMsg() + " " + IntToStr(Status) , 48);
END
SQLDisconnect(hSQL);
ELSE
Message("ErrorS QLconnect", SQLErrMsg(), 48);
END
END


Posted by Michael Griffin on 13 February, 2007 - 10:46 pm
This seems to be an ODBC error message, rather than a mySQL error message. Microsoft says the ODBC error messages are located in the "ODBC Programmer's Reference" documentation (which doesn't seem to be anyplace obvious on their web site).

You might try asking this question on the mySQL lists at:
http://lists.mysql.com/


Posted by Heine Broers on 9 November, 2007 - 10:19 pm
Do not use * for a lot of fields.
Citect can only return a limited quantity.
MySQL can also have limitations.

We use MySQL with Citect.
No problem with that, but we have added a lot of code so 1 SQL statement at the time is executed.

SQLExec 1
SQLExec 2 (Multithreading)
SQLNext 1 -> Error in descriptors

Best regards, HB


Posted by Nathan Boeger on 10 November, 2007 - 2:50 pm
MySQL 5 has a hard limit of 4096 columns, but the actual limit is less depending on the amount of bytes of the columns data type.

http://dev.mysql.com/doc/refman/5.0/en/column-count-limit .html

Sorry, don't know anything about that Citect scripting.

----
Nathan Boeger
http://www.inductiveautomation.com
Total SCADA Freedom


Posted by Michael Griffin on 10 November, 2007 - 8:49 pm
In reply to Nathan Boeger: 4096 columns is not normally a serious limitation. For most applications, if you have anywhere near that many columns there is something wrong with the database data design.


Posted by Nathan Boeger on 11 November, 2007 - 6:03 pm
That is correct. Relational databases typically make more sense taller rather than wide.

From Control Engineering magazine...
Related articles from Control Engineering magazine
Above articles copyright 2008 Reed Business Information. Subject to its Terms of Use.
Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2008 Control Technology Corporation. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

Internet Explorer 6.0 Fix

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!