How to fix [3932] Only an ET or null statement is legal after a DDL Statement?

Database
Enthusiast

How to fix [3932] Only an ET or null statement is legal after a DDL Statement?

Hi guys!

What can I do to fix this error when I perform this query:
SELECT
TBLA.AL
,TBLA.DSC
,TBLA.LIG
,TBLR.IND
,TBLR.NIV
,TBLR.SENT_NIV
,TBLA.CDRO
,TBLCR.NM_RO
,TBLCR.PC1
,TBLCR.PC2
,TBLA.CDCS
,TBLCS.NM
FROM
TBLA
INNER JOIN
TBLR
ON TBLA.AL = TBLR.AL
INNER JOIN TBLCR
ON TBLA.CDRO = TBLCR.CDRO
INNER JOIN TBLCS
ON TBLCS.CSP = TBLA.CDCS
WHERE
TBLA.CDRO IS NOT NULL
AND TBLA.CDCS IS NOT NULL
AND TBLA.LIG >= 0
ORDER BY TBLA.AL;


I have got this error:
[3932] Only an ET or null statement is legal after a DDL Statement.


Thanks for help,
Anderson
2 REPLIES
Enthusiast

Re: How to fix [3932] Only an ET or null statement is legal after a DDL Statement?

Do a COMMIT before submitting the SELECT.
Enthusiast

Re: How to fix [3932] Only an ET or null statement is legal after a DDL Statement?

If you have started a BT session, after executing DDL statement, you cannot run update/delete or other statements with in that transaction session.
Instead you skip all statements after DDL and put them after ET. This will resolve the issue.