Displaying + sign in column header for a pivoted script

Greetings - My query works as intended except for the displaying of + sign in the column header. as you will notice from script below, I want to display ‘B+’ as B+, ‘C+’ as C+, and ‘D+’ as D+ but I can’t. I instead spelled it. Is there a way I can display B+ instead of Bplus, C+ instead of Cplus, and D+ instead of Dplus?

pivot (
max (PIDM)
for GR in (‘A’ as A, ‘B+’ as Bplus, ‘B’ as B, ‘C+’ as Cplus, ‘C’ as C, ‘D+’ as Dplus, ‘D’ as D, ‘F’ as F, ‘FA’ as FA, ‘GR’ as GR, ‘W’ as W, ‘WF’ as WF, ‘I’ as I)
)

The different options I have tried and the error I get are as follows:

  1. ‘B+’ as B+ (ORA-00917: missing comma. When I add a comma (‘B+’ as B,+), I get (ORA-00936: missing expression) error message.

  2. ‘B+’ as B||+ (ORA-00917: missing comma)

  3. ‘B+’ as B||’+’ (ORA-00917: missing comma)

Try

‘B+’ as ‘B’||chr(43)

Ravinder Bahadur

HCL Singapore Pte Ltd

Hp: +65 94740082

Planned Leave: None

From: jollydoe [mailto:bounce-jollydoe@toadworld.com]

Sent: Thursday, June 23, 2016 4:34 PM

To: toadoracle@toadworld.com

Subject: [Toad for Oracle - Discussion Forum] Displaying + sign in column header for a pivoted script

Displaying + sign in column header for a pivoted script

Thread created by jollydoe

Greetings - My query works as intended except for the displaying of + sign in the column header. as yo will notice from below script, I want to display ‘B+’ as B+, ‘C+’ as C+, and ‘D+’ as D+ but I can’t. I instead spelled it. Is there a way I can display B+ instead of Bplus, C+ instead of Cplus, and D+ instead of Dplus?

pivot (

       max (PIDM)

       for GR in ('A' as A, 'B+' as Bplus, 'B' as B, 'C+' as Cplus, 'C' as C, 'D+' as Dplus, 'D' as D, 'F' as F, 'FA' as FA, 'GR' as GR, 'W' as W, 'WF' as WF, 'I' as I)

      )

The different options I have tried and the error I get are as follows:

  1. ‘B+’ as B+ (ORA-00917: missing comma. When I add a comma (‘B+’ as B,+), I get (ORA-00936: missing expression) error message.

  2. ‘B+’ as B||+ (ORA-00917: missing comma)

  3. ‘B+’ as B||’+’ (ORA-00917: missing comma)

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for Oracle - General Forum
notifications altogether.

Toad for Oracle - Discussion Forum

Flag
this post as spam/abuse.

::DISCLAIMER::

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.


Sorry that should be select ‘B+’ as “B+” from dual;

Ravinder Bahadur

HCL Singapore Pte Ltd

Hp: +65 94740082

Planned Leave: None

From: Ravinder Bahadur, HCL Singapore

Sent: Thursday, June 23, 2016 5:01 PM

To: toadoracle@toadworld.com

Subject: RE: [Toad for Oracle - Discussion Forum] Displaying + sign in column header for a pivoted script

Try

‘B+’ as ‘B’||chr(43)

Ravinder Bahadur

HCL Singapore Pte Ltd

Hp: +65 94740082

Planned Leave: None

From: jollydoe [mailto:bounce-jollydoe@toadworld.com]

Sent: Thursday, June 23, 2016 4:34 PM

To: toadoracle@toadworld.com

Subject: [Toad for Oracle - Discussion Forum] Displaying + sign in column header for a pivoted script

Displaying + sign in column header for a pivoted script

Thread created by jollydoe

Greetings - My query works as intended except for the displaying of + sign in the column header. as yo will notice from below script, I want to display ‘B+’ as B+, ‘C+’ as C+, and ‘D+’ as D+ but I can’t. I instead spelled it. Is there a way I can display B+ instead of Bplus, C+ instead of Cplus, and D+ instead of Dplus?

pivot (

       max (PIDM)

       for GR in ('A' as A, 'B+' as Bplus, 'B' as B, 'C+' as Cplus, 'C' as C, 'D+' as Dplus, 'D' as D, 'F' as F, 'FA' as FA, 'GR' as GR, 'W' as W, 'WF' as WF, 'I' as I)

      )

The different options I have tried and the error I get are as follows:

  1. ‘B+’ as B+ (ORA-00917: missing comma. When I add a comma (‘B+’ as B,+), I get (ORA-00936: missing expression) error message.

  2. ‘B+’ as B||+ (ORA-00917: missing comma)

  3. ‘B+’ as B||’+’ (ORA-00917: missing comma)

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for Oracle - General Forum
notifications altogether.

Toad for Oracle - Discussion Forum

Flag
this post as spam/abuse.

::DISCLAIMER::

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.


Hi Ravinder - Thank you for responding promptly. Trying your suggestino gives me “ORA-00931: missing identifier” error. So I tried it without the single quotes i.e. ‘B+’ as B||chr(43). That gives me “ORA-00917: missing comma” error. Than I put the single quotes around the second part i.e ‘B+’ as B||‘char(43)’. That gives me “ORA-00917: missing comma” error.

Your second suggestion worked. Thanks again Ravinder!