Formatter - JOIN ON

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Formatter - JOIN ON

ss052111
Does anyone know if the Formatter options may be set to keep the ON keyword on the same line as the JOIN clause? I've been looking, but have had no luck. Here's an example of what I'm trying to do:

SELECT pty.party_id
      ,pty.last_name
      ,pty.first_name
      ,pa.street_address
      ,pa.city_name
      ,pa.state_code
      ,pa.zip_code
      ,pe.email_address
  FROM party pty
       INNER JOIN party_address pa ON pa.party_id = pty.party_id
                                  AND pa.address_type_id = 1
       INNER JOIN party_email pe ON pe.party_id = pty.party_id

Of course, if this is not currently possible, I would like to formally lobby for an enhancement. :)

Regards,
Sean


Reply | Threaded
Open this post in threaded view
|

Re: Formatter - JOIN ON

ss052111-2
Let me try that again:
SELECT pty.party_id      ,pty.last_name
       ,pty.first_name
       ,pa.street_address
       ,pa.city_name
       ,pa.state_code
       ,pa.zip_code
       ,pe.email_address
   FROM party pty
        INNER JOIN party_address pa ON pa.party_id = pty.party_id
                                   AND pa.address_type_id = 1
        INNER JOIN party_email pe ON pe.party_id = pty.party_id
--- In [hidden email], "ss052111" <sean.sexton@...> wrote:
>
> Does anyone know if the Formatter options may be set to keep the ON
keyword on the same line as the JOIN clause? I've been looking, but have
had no luck. Here's an example of what I'm trying to do:

>
> SELECT pty.party_id
>       ,pty.last_name
>       ,pty.first_name
>       ,pa.street_address
>       ,pa.city_name
>       ,pa.state_code
>       ,pa.zip_code
>       ,pe.email_address
>   FROM party pty
>        INNER JOIN party_address pa ON pa.party_id = pty.party_id
>                                   AND pa.address_type_id = 1
>        INNER JOIN party_email pe ON pe.party_id = pty.party_id
>
> Of course, if this is not currently possible, I would like to formally
lobby for an enhancement. :)
>
> Regards,
> Sean
>

Reply | Threaded
Open this post in threaded view
|

RE: Re: Formatter - JOIN ON

Andre Vergison
Currently there is no option to do what I think you wish to obtain.

Let’s analyze for a moment how we can fold the join.

If the right hand margin is very large then no folding occurs after “INNER JOIN” :

  FROM party pty
       INNER JOIN party_address pa ON pa.party_id = pty.party_id AND pa.address_type_id = 1

When narrowing the right hand margin then currently it initially folds like this:

  FROM party pty
       INNER JOIN party_address pa
          ON pa.party_id = pty.party_id AND pa.address_type_id = 1

When narrowing futher then we get (2nd folding mode):

  FROM party pty
       INNER JOIN
       party_address pa
          ON     pa.party_id = pty.party_id
             AND pa.address_type_id = 1

In contrast, the following is the first folding mode which I understand you wish to see:

  FROM party pty
       INNER JOIN party_address pa ON pa.party_id = pty.party_id
                                  AND pa.address_type_id = 1

Okay, but how should it get folded further whenever the right hand margin is exceeded?  Would the 2nd folding mode as above be okay?

Thanks,
Andre
________________________________
From: [hidden email] [mailto:[hidden email]] On Behalf Of ss052111
Sent: maandag 29 oktober 2012 19:00
To: [hidden email]
Subject: [toad] Re: Formatter - JOIN ON


Let me try that again:

SELECT pty.party_id
      ,pty.last_name
      ,pty.first_name
      ,pa.street_address
      ,pa.city_name
      ,pa.state_code
      ,pa.zip_code
      ,pe.email_address
  FROM party pty
       INNER JOIN party_address pa ON pa.party_id = pty.party_id
                                  AND pa.address_type_id = 1
       INNER JOIN party_email pe ON pe.party_id = pty.party_id

--- In [hidden email], "ss052111" <sean.sexton@...> wrote:

>
> Does anyone know if the Formatter options may be set to keep the ON keyword on the same line as the JOIN clause? I've been looking, but have had no luck. Here's an example of what I'm trying to do:
>
> SELECT pty.party_id
> ,pty.last_name
> ,pty.first_name
> ,pa.street_address
> ,pa.city_name
> ,pa.state_code
> ,pa.zip_code
> ,pe.email_address
> FROM party pty
> INNER JOIN party_address pa ON pa.party_id = pty.party_id
> AND pa.address_type_id = 1
> INNER JOIN party_email pe ON pe.party_id = pty.party_id
>
> Of course, if this is not currently possible, I would like to formally lobby for an enhancement. :)
>
> Regards,
> Sean
>

Reply | Threaded
Open this post in threaded view
|

Re: Formatter - JOIN ON

ss052111-2
Hi, Andre. I suppose I didn't really consider the margin, as I have it set pretty wide for my wide screen monitor. That being said, I think the 2nd folding method would be fine when the margin is exceeded. Thanks.

Sean

--- In [hidden email], Andre Vergison <andre.vergison@...> wrote:

>
> Currently there is no option to do what I think you wish to obtain.
>
> Let’s analyze for a moment how we can fold the join.
>
> If the right hand margin is very large then no folding occurs after “INNER JOIN” :
>
>   FROM party pty
>        INNER JOIN party_address pa ON pa.party_id = pty.party_id AND pa.address_type_id = 1
>
> When narrowing the right hand margin then currently it initially folds like this:
>
>   FROM party pty
>        INNER JOIN party_address pa
>           ON pa.party_id = pty.party_id AND pa.address_type_id = 1
>
> When narrowing futher then we get (2nd folding mode):
>
>   FROM party pty
>        INNER JOIN
>        party_address pa
>           ON     pa.party_id = pty.party_id
>              AND pa.address_type_id = 1
>
> In contrast, the following is the first folding mode which I understand you wish to see:
>
>   FROM party pty
>        INNER JOIN party_address pa ON pa.party_id = pty.party_id
>                                   AND pa.address_type_id = 1
>
> Okay, but how should it get folded further whenever the right hand margin is exceeded?  Would the 2nd folding mode as above be okay?
>
> Thanks,
> Andre
> ________________________________
> From: [hidden email] [mailto:[hidden email]] On Behalf Of ss052111
> Sent: maandag 29 oktober 2012 19:00
> To: [hidden email]
> Subject: [toad] Re: Formatter - JOIN ON
>
>
> Let me try that again:
>
> SELECT pty.party_id
>       ,pty.last_name
>       ,pty.first_name
>       ,pa.street_address
>       ,pa.city_name
>       ,pa.state_code
>       ,pa.zip_code
>       ,pe.email_address
>   FROM party pty
>        INNER JOIN party_address pa ON pa.party_id = pty.party_id
>                                   AND pa.address_type_id = 1
>        INNER JOIN party_email pe ON pe.party_id = pty.party_id
>
> --- In [hidden email], "ss052111" <sean.sexton@> wrote:
> >
> > Does anyone know if the Formatter options may be set to keep the ON keyword on the same line as the JOIN clause? I've been looking, but have had no luck. Here's an example of what I'm trying to do:
> >
> > SELECT pty.party_id
> > ,pty.last_name
> > ,pty.first_name
> > ,pa.street_address
> > ,pa.city_name
> > ,pa.state_code
> > ,pa.zip_code
> > ,pe.email_address
> > FROM party pty
> > INNER JOIN party_address pa ON pa.party_id = pty.party_id
> > AND pa.address_type_id = 1
> > INNER JOIN party_email pe ON pe.party_id = pty.party_id
> >
> > Of course, if this is not currently possible, I would like to formally lobby for an enhancement. :)
> >
> > Regards,
> > Sean
> >
>