Toad World® Forums

TOAD formatter

Hello,

How to customize TOAD formatter?

I have this query:

SELECT DECODE (COUNT (‘x’), 0, 1, 0)
INTO o_return
FROM TBL_COMITES_AFIL c
WHERE c.cod_op = i_cod_op
AND c.cod_dni = i_cod_dni
AND c.flg_motivo_op = 1
AND NOT (
(c.cod_op, c.cod_dni) IN (SELECT r.cod_op, r.cod_dni FROM tbl_representantes r WHERE cod_motivo_baja <> ‘01’)
OR (c.cod_op, c.cod_dni) IN (SELECT x.cod_op, x.cod_dni FROM TBL_COMITES_AFIL x WHERE x.cod_op = c.cod_op AND x.cod_dni = c.cod_dni AND x.nro_entrega <> c.nro_entrega AND x.flg_motivo_op <> 1)
OR (c.cod_op, c.cod_dni) IN (SELECT x.cod_op, x.cod_dni FROM TBL_padron_afil x WHERE x.cod_op = c.cod_op AND x.cod_dni = c.cod_dni)
);

As you see, I would like that “OR” statements get in one line.

But formatting with TOAD results in:

SELECT DECODE (COUNT (‘x’), 0, 1, 0)
INTO o_return
FROM TBL_COMITES_AFIL c
WHERE c.cod_op = i_cod_op
AND c.cod_dni = i_cod_dni
AND c.flg_motivo_op = 1
AND NOT ( (c.cod_op, c.cod_dni) IN
(SELECT r.cod_op, r.cod_dni
FROM tbl_representantes r
WHERE cod_motivo_baja <> ‘01’)
OR (c.cod_op, c.cod_dni) IN
(SELECT x.cod_op, x.cod_dni
FROM TBL_COMITES_AFIL x
WHERE x.cod_op = c.cod_op
AND x.cod_dni = c.cod_dni
AND x.nro_entrega <> c.nro_entrega
AND x.flg_motivo_op <> 1)
OR (c.cod_op, c.cod_dni) IN
(SELECT x.cod_op, x.cod_dni
FROM TBL_padron_afil x
WHERE x.cod_op = c.cod_op
AND x.cod_dni = c.cod_dni));

Is it possible to format code in a custom way?

First place rich text formatting to get the point of your need.

To format OR in your way do:

  • View|Toad Options|Formatter
  • Open Operations and Punctations
  • AND-OR
  • Choose Stucked
    For all other … copy your code to popup window (mostly on the left of Options window) and see the result of your actions alive … not too hard …