SQL Query Length Limit for local server?

Post Reply
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

SQL Query Length Limit for local server?

Post by macsir »

Hi, All

I am testing some SQL query on local server and everything is fine. Data can be loaded into cube via this process. However, after saving everything and restart local server, the query has been truncated for some reason. It happens every time after I corrected sql and save, reboot. I am wondering if there is some version limitation (not allow sql query more than xxx characters?) for local server when using ODBC?

PS, my DB is mysql.

:?
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: SQL Query Length Limit for local server?

Post by macsir »

Okay, got answer by myself. It is not relevant to any TM1 version. It is just how mysql workbench produce SQL in its editor.
How mysql workbench add invisible char into the end of each line (only LF, which is Unix way)
1.PNG
1.PNG (2.64 KiB) Viewed 4225 times
After copying same sql into notepad++, how notepad++ display the end of each line (CR+LF, which is windows way)
2.PNG
2.PNG (2.72 KiB) Viewed 4225 times
And the sql window in TI only recognize the common window way of displaying end of each line, which is CR+LF. If you copy sql directly from workbench into TI window, at first, you won't see any problem and that sql will be only displayed into one line, (That is where I found the difference from and trace out the root cause) but once you reboot your server, TI would automatically truncate the whole sql at the first place of LF. That caused the failure.

For anyone who is not familiar with CR or LF. read this,
CR an LF are control characters, respectively coded 0x0D (13 decimal) and 0x0A (10 decimal).

They are used to mark a line break in text file. A you indicated, Windows uses two characters the CR LF sequence; Unix only uses LF and MacIntosh CR.

An apocryphal historical perspective
As indicated by Peter, CR = Carriage Return and LF = Line Feed, two expressions which have their roots in the old typewriters / TTY. LF moved the paper up (but kept the horizontal position identical) and CR brought back the "carriage" so that the next character typed would be at the leftmost position on the paper (but on the same line). CR+LF was doing both, i.e. preparing to type a new line. As time went by the physical semantics of the codes were not applicable, and as memory and floppy disk space was at a premium, some OS designers decided to only use one of the characters, they just didn't communicate very well with one another ;-)

Most modern text editors and text-oriented application offer options/settings etc. that allow the automatic detection of the file's end-of-line convention and to display it accordingly.
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: SQL Query Length Limit for local server?

Post by BariAbdul »

Thanks for the update. :)
"You Never Fail Until You Stop Trying......"
Post Reply