generatesqldlg SQL statements incomplete
- Lazarus/FPC Version: 2.2.4/3.2.2
- Operating System: Linux
- CPU / Bitness: 64
What happens
The dialog "Edit/Generates SQL statments" which can be called in the IDE by right clicking on a SQL query and selecting "Edit all SQL statements" returns incomplete SQL statements. For example, if you select the employee table in the employee database and press the "generate sql" button, the update SQL code:
set
DEPT_NO = :DEPT_NO, EMP_NO = :EMP_NO, FIRST_NAME = :FIRST_NAME, FULL_NAME = :FULL_NAME,
HIRE_DATE = :HIRE_DATE, JOB_CODE = :JOB_CODE, JOB_COUNTRY = :JOB_COUNTRY,
JOB_GRADE = :JOB_GRADE, LAST_NAME = :LAST_NAME, PHONE_EXT = :PHONE_EXT,
where
(EMP_NO = :OLD_EMP_NO)
is generated.
What did you expect
Correct would be:
update EMPLOYEE
set
DEPT_NO = :DEPT_NO, EMP_NO = :EMP_NO, FIRST_NAME = :FIRST_NAME, FULL_NAME = :FULL_NAME,
HIRE_DATE = :HIRE_DATE, JOB_CODE = :JOB_CODE, JOB_COUNTRY = :JOB_COUNTRY,
JOB_GRADE = :JOB_GRADE, LAST_NAME = :LAST_NAME, PHONE_EXT = :PHONE_EXT,
SALARY = :SALARY
where
(EMP_NO = :OLD_EMP_NO)
Steps to reproduce
My suggestion is to change the lines
if CBOneFieldPerLine.Checked or ((Length(L)>MaxLen) and IsNotLast) then
to
if CBOneFieldPerLine.Checked or (Length(L)>MaxLen) or not IsNotLast then
.
Edited by Werner Pamler