HomeActive Query BuilderProblem retrieving by Javascript, a SQL generated in an Applet: necessary whitespaces were lost

Problem retrieving by Javascript, a SQL generated in an Applet: necessary whitespaces were lost


Hello,
I used latest Query Builder (1.1.0.1013) in an Applet, then I used Javascript to read the sql statement created by query builder like this, and I found that no longer was there any spaces before "From" and "Where" keywords, when I read the query in Javascript.


Applet: getSQL(){
return sql = plainTextSQLBuilder1.getSQL();
}



JS:
function saveSQLByAjax(){
document.myApplet.getSQL();
alert(document.myApplet.getSQL());
//"myApplet" is the <applet> element in my web page.
//at this step I could no longer find any white space before "From" and "Where" even in my message dialogbox

//send the query
}

In my aler() I got a query like this:
"Select a As aa

b As bb

From mytable

Where c like 'v%'" where no space was created between "bb" and "From", between "mytable" and "Where".

So why did I loose these necessary spaces, and what should I do to maintain them?

Thanks.
Rosière | email
July 3 2009, 04:51 AM
Dear Rosière,

There are new line markers in that positions. Possibly they were cropped by Javascript. If you need to get SQL text for its execution, you may get it without formatting from the QueryBuilder.SQL property.
Sergey Smagin | email
3 days, 23 hours since original post
This topic is closed