Max string length in Intouch

zhphust

Member
Join Date
Dec 2004
Location
Kobe,Japan
Posts
10
When I execute a long SQL statement using SQLSetStatment and SQLExecute in Intouch8.0, I always got a error of Unkown Error Code.

I known that the max length of Message Tagname is 131, so I think if any string, including a string constant, of Intouch can not extend the length of 131. (I am sure that my SQL statement extends the length of 131)
 
Try breaking your string into two or more shorter strings and then concatenate them together with several SQLPrepare statements and the "+" operator. I believe there is help on this on the Knowledge Base CD or in a tech note somewhere.
 
Jshiepe is absolutely right, the SQLPrepare statement will allow you to use SQL statements that exceed 131 characters.

It's been a while since I last used InTouch, but if I remember correctly it is also possible to store the SQL statement in a separate text file and call it up through an InTouch script. I'll check some old projects in the morning and post the details if I can find them.

Best Regards
 
I checked some old projects where I used SQL statements in InTouch.

I wrote the SQL statements in a separate text file. If it was necessary to put parameters in the SQL statement, the character "?" was used. e.g. SELECT * FROM MYTABLE WHERE NAME = ? AND AGE = ?

Then, in an InTouch script, after connecting to the database (SQLConnect), I used the SQLLoadStatement() script function to read the SQL statement from the text file.

Next, SQLPrepareStatement() was used followed by SQLSetParam...() script functions to put actual values into the parameters of the SQL statement (e.g. to change the above example to SELECT * FROM MYTABLE WHERE NAME = TARO AND AGE = 43).

Finally, SQLExecute() was used to access the database with the prepared statement.

I hope this makes some sense. Anyway, have a read through the "InTouch Reference Guide" for a proper explanation of the syntax of the above script functions.

Once you have got a simple SQL statement working, you will soon see how easy it is to make more complex statements.

Best Regards
 

Similar Topics

Hi all! I have a controller (L38-ERM) where I had a one dimensional array of strings with 1028 elements in it. I expanded this to 2048 because I...
Replies
23
Views
7,495
I'm trying to write a data in Arduino using MODWR function block .I used the code I got from online for both PLC and Arduino. I made the wiring...
Replies
4
Views
148
I have one GE Fanuc IC200PNS002-AC Versamax Network Interface Module and the fault red light is blinking and i have checked in manual it is...
Replies
9
Views
229
Square-D Symax SFI-324 I have used the SFI-510 card for many projects, but I came across a SFI-324. Does anyone have ant tech info on it?
Replies
0
Views
85
Hi, I am looking for some help with a GE Fanuc Versa Max Micro Controller model IC200UDR001-BF connected to a Quickpanel mini display...
Replies
3
Views
163
Back
Top Bottom