Multi-line SQL sentences lost when editing

VictorUlloa, Mon Jun 07 2021, 11:37AM

DBQuery SQL sentences works ok as long as they are single line.  But when I enter a multiple-line sentence, run the app and then try to edit the sentence again, all lines but the first one are lost.

Environment:
PHsPeed 1.3.0 B7 - X64, PHP 7.4.5, MariaDB 10.4.11 (out of the Box PHsPeed)

Steps to reproduce:
- Create an empty project, with the samples connections.
- Put a Grid, a Datasource, and a DBQuery in any form, link them and set the DBQuery SQL property to

select dept_no, dept_name, mydate, yourdate from departments order by dept_name

- Open and set the fields in the DBQuery and Grid component.
- Run the form

- Go back to the Project tab and edit the SQL Sentence to make it multi-line, like:

select dept_no,
dept_name,
mydate,
yourdate from
departments order by dept_name

- Run again the form
- Go back to edit the SQL Sentence: you will find ONLY the first line:
select dept_no,

Re: Multi-line SQL sentences lost when editing
administrator, Mon Jun 07 2021, 12:51PM

Although not easy recognizable it is the same issue as https://www.phspeed.com/bt/index.php?do=details&task_id=327

CrLf is not allowed in properties. It is currently (as of 1.3.0 build 8 ) fixed by replacing these by spaces. But that will reformat the statement to one single string.

For html templates there is a function to convert these chars to br /. For this there are two buttons, 'make template' and 'undo template'.
This is not usable for sql though as br/ pairs leads to syntax errors. We are working on a similar formatting button so that it will create a better readable sql from string.

Re: Multi-line SQL sentences lost when editing
administrator, Mon Jun 07 2021, 01:42PM

We have made some changes that will be available in build 8

See: link