# Error ORA-00972

**URL:** <https://forums.toadworld.com/t/error-ora-00972/10810>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [October 20, 2011, 5:52am UTC](https://forums.toadworld.com/t/error-ora-00972/10810 "2011-10-20T05:52:16Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mari](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mari](https://forums.toadworld.com/u/mari)\
**Post date:** [October 20, 2011, 5:52am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/1 "2011-10-20T05:52:16Z")

</div>

Hi,

this is my query:

select  
anno\_elab as “anno”,  
1 as “contatore”,  
cartella.n\_cartella as “cartella”,  
substr(trim(cartella.cognome)||’ ‘||trim(cartella.nome),1,40) as “cognome\_nome”,  
cartella.data\_nasc as “data\_nascita”,  
anno\_elab - to\_number(to\_char(cartella.data\_nasc,‘YYYY’),‘9999’) as “eta”,  
cartella.sesso,  
cartella.cod\_com\_nasc as “cod\_comune\_nascita”,  
trim(comuni.descrizione) as “comune\_nascita”,  
cartella.cittadinanza as “cod\_cittadinanza”,  
trim(cittadin.des\_cittadin) as “cittadinanza”,  
substr(cittadin.flag\_cittadin,1,1) as “ue\_extraue”,  
cartella.cod\_reg as "codice\_sanitario,  
cartella.cod\_fisc as “codice\_fiscale”,  
cartella.cod\_usl as “codice\_usl”,  
cartella.data\_apertura,  
cartella.data\_chiusura,  
trim(tab\_voci.tab\_descrizione) as “motivo\_chiusura”,  
anagra\_c.citta as “cod\_comune\_res”,  
trim(comuni\_res.descrizione) as “comune\_res”,  
anagra\_c.indirizzo as “indirizzo\_res”,  
trim(areadis\_res.descrizione) as “areadis\_res”,  
anagra\_c.dom\_citta as “cod\_comune\_dom”,  
trim(comuni\_dom.descrizione)as “comune\_dom”,  
anagra\_c.dom\_indiriz as “indirizzo\_dom”,  
trim(areadis\_dom.descrizione) as “areadis\_dom”,  
trim(zone.descrizione\_zona) as “zona”,  
trim(distretti.des\_distr) as “distretto”,  
anagra\_c.cod\_med as “cod\_mmg”,  
substr(trim(medici.mecogn)||’ ‘||medici.menome,1,40) as “mmg”,  
medici.mefisc as “cod\_fisc\_mmg”,  
region.region as “regione”,  
tabusl.desusl as “usl\_residenza”,  
ass\_anagrafica.cod\_operatore as “pi\_cod\_operatore”,  
substr(trim(op\_pi.cognome)||’ ‘||trim(op\_pi.nome),1,40) as “pi\_operatore\_pi”,  
ass\_anagrafica.cod\_presidio as “pi\_cod\_presidio”,  
trim(presidi\_pi.despres) as “pi\_presidio”,  
presidi\_pi.coddistr as “pi\_cod\_distretto”,  
trim(distretti\_pi.des\_distr) as “pi\_distretto”,  
trim(zone\_pi.descrizione\_zona) as “pi\_zona”,  
ass\_anagrafica.progressivo as “pi\_num\_scheda”,  
ass\_anagrafica.data\_reg as “pi\_data\_reg”,  
puauvm.pr\_data\_richiesta as “pua\_data\_richiesta”,  
puauvm.pr\_data\_avvio as “pua\_data\_avvio”,  
puauvm.pr\_data\_puac as “pua\_data\_puac”,  
puauvm.pr\_protoc\_domanda as “pua\_protoc\_domanda”,  
puauvm.pr\_mmg\_data\_richiesta as “pua\_mmg\_data\_richiesta”,  
puauvm.pr\_mmg\_data\_sollecito as “pua\_mmg\_data\_sollecito”,  
puauvm.pr\_mmg\_risposta\_neg as “pua\_mmg\_risposta\_neg”,  
puauvm.pr\_scheda\_1 as “pua\_scheda\_1”,  
puauvm.pr\_scheda\_data\_1 as “pua\_scheda\_data\_1”,  
puauvm.pr\_soc\_data\_visita as “pua\_soc\_data\_visita”,  
puauvm.pr\_soc\_effettuata as “pua\_soc\_effettuata”,  
puauvm.pr\_soc\_codice as “pua\_soc\_codice”,  
substr(trim(op\_soc.cognome)||’ ‘||trim(op\_soc.nome),1,40) as “pua\_soc\_operatore”,  
puauvm.pr\_inf\_data\_visita as “pua\_inf\_data\_visita”,  
puauvm.pr\_inf\_effettuata as “pua\_inf\_effettuata”,  
puauvm.pr\_inf\_codice as “pua\_inf\_codice”,  
substr(trim(op\_inf.cognome)||’ '||trim(op\_inf.nome),1,40) as “pua\_inf\_operatore”,  
puauvm.pr\_stato\_convoc as “pua\_stato\_convoc”,  
puauvm.pr\_data\_seduta as “pua\_data\_seduta”,  
puauvm.pr\_data\_verbale\_uvm as “pua\_data\_verbale\_uvm”,  
puauvm.pr\_num\_verbale as “pua\_num\_verbale”,  
puauvm.pr\_sede as “pua\_sede”,  
trim(distretti\_sede.des\_distr) as “pua\_distretto”,  
puauvm.pr\_centro\_soc as “pua\_centro\_soc”,  
trim(presidi\_sede.despres) as “pua\_presidio”,  
trim(zone\_sede.descrizione\_zona) as “pua\_zona”,  
puauvm.pr\_autosuff as “pua\_autosuff”,  
puauvm.pr\_revisione as “pua\_revisione”,  
puauvm.pr\_data\_revisione as “pua\_data\_revisione”,  
puauvm.pr\_flag\_urgente as “pua\_flag\_urgente”,  
puauvm.pr\_data\_chiusura as “pua\_data\_chiusura”,  
trim(tab\_voci1.tab\_descrizione) as “pua\_motivo\_chiusura”,  
trim(tab\_pap.descrizione) as “pua\_pianoint”,  
puauvm.pr\_pianoint\_ini as “pua\_pianoint\_ini”,  
puauvm.pr\_pianoint\_fin as “pua\_pianoint\_fin”,  
puauvm.pr\_pianoint\_spesa as “pua\_pianoint\_spesa”,  
0 as “pua\_tempo\_t”,  
0 as “pua\_liv\_isogravita”

from sinsnt\_test.cartella,  
sinsnt\_test.comuni,  
sinsnt\_test.comuni comuni\_res,  
sinsnt\_test.comuni comuni\_dom,  
sinsnt\_test.cittadin,  
sinsnt\_test.tab\_voci,  
sinsnt\_test.tab\_voci tab\_voci1,  
sinsnt\_test.anagra\_c,  
sinsnt\_test.areadis areadis\_res,  
sinsnt\_test.areadis areadis\_dom,  
sinsnt\_test.medici,  
sinsnt\_test.region,  
sinsnt\_test.tabusl,  
sinsnt\_test.zone,  
sinsnt\_test.zone zone\_pi,  
sinsnt\_test.zone zone\_sede,  
sinsnt\_test.distretti,  
sinsnt\_test.distretti distretti\_pi,  
sinsnt\_test.distretti distretti\_sede,  
sinsnt\_test.operatori op\_pi,  
sinsnt\_test.operatori op\_soc,  
sinsnt\_test.operatori op\_inf,  
sinsnt\_test.presidi presidi\_sede,  
sinsnt\_test.presidi presidi\_pi,  
sinsnt\_test.ass\_anagrafica,  
sinsnt\_test.puauvm,  
sinsnt\_test.tab\_pap,  
sinsnt\_test.anno\_elab  
where puauvm.pr\_data\_puac

and (puauvm.pr\_data\_chiusura  
\>= to\_date(‘01-01-’||to\_char(anno\_elab), ‘DD-MM-YYYY’)  
or puauvm.pr\_data\_chiusura is null)  
and puauvm.n\_cartella = cartella.n\_cartella  
and cartella.n\_cartella = anagra\_c.n\_cartella  
and anagra\_c.data\_variazione =  
(select max(data\_variazione) from sinsnt\_test.anagra\_c  
where cartella.n\_cartella = anagra\_c.n\_cartella)  
and cod\_com\_nasc = comuni.codice  
and cartella.cittadinanza = cittadin.cd\_cittadin  
and (‘MOTCHI’= tab\_voci.tab\_cod  
and cartella.motivo\_chiusura=tab\_voci.tab\_val)  
and anagra\_c.citta = comuni\_res.codice  
and anagra\_c.dom\_citta = comuni\_dom.codice  
and anagra\_c.areadis = areadis\_res.codice  
and anagra\_c.dom\_areadis = areadis\_dom.codice  
and anagra\_c.cod\_med = medici.mecodi  
and anagra\_c.regione = region.cd\_reg  
and (anagra\_c.regione||anagra\_c.usl) = tabusl.cd\_usl  
and areadis\_dom.cod\_distretto = distretti.cod\_distr  
and distretti.cod\_zona = zone.codice\_zona  
and puauvm.pr\_sede = presidi\_sede.codpres  
and presidi\_sede.coddistr = distretti\_sede.cod\_distr  
and distretti\_sede.cod\_zona = zone\_sede.codice\_zona  
and puauvm.pr\_soc\_codice = op\_soc.codice  
and puauvm.pr\_inf\_codice = op\_inf.codice  
and puauvm.pr\_pianoint = tab\_pap.codice  
and (‘VALPCMCH’= tab\_voci1.tab\_cod  
and puauvm.pr\_motivo\_chiusura=tab\_voci1.tab\_val)  
and (puauvm.n\_cartella = ass\_anagrafica.n\_cartella  
and puauvm.pr\_data = ass\_anagrafica.pr\_data  
and puauvm.pr\_progr = ass\_anagrafica.pr\_progr)  
and ass\_anagrafica.cod\_operatore = op\_pi.codice  
and ass\_anagrafica.cod\_presidio = presidi\_pi.codpres  
and presidi\_pi.coddistr = distretti\_pi.cod\_distr  
and distretti\_pi.cod\_zona = zone\_pi.codice\_zona

why I’ve the error: ORA-00972: identifier is too long’

Thanks  
Mariarita

---

<div class="post-metadata">

**Author:** ![wbray](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@wbray](https://forums.toadworld.com/u/wbray)\
**Post date:** [October 20, 2011, 6:39am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/2 "2011-10-20T06:39:21Z")

</div>

Bringing this question into the Toad realm …

Copy and paste the query into the editor window and the highlighting reveals a missing double-quote (’"’) at the end of ‘cartella.cod\_reg as "codice\_sanitario’. Thanks Toad.

---

<div class="post-metadata">

**Author:** ![flyfishpanfish](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/flyfishpanfish/32/141_2.png) [@flyfishpanfish](https://forums.toadworld.com/u/flyfishpanfish)\
**Post date:** [October 20, 2011, 7:22am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/3 "2011-10-20T07:22:32Z")

</div>

codice\_sanitario is missing closing double-quote (“)

---

<div class="post-metadata">

**Author:** ![mari](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mari](https://forums.toadworld.com/u/mari)\
**Post date:** [October 20, 2011, 8:29am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/4 "2011-10-20T08:29:36Z")

</div>

Thanks,

the same error there is in this query:

SELECT  
anno\_elab as “anno”,  
1 as “numero”,  
cartella.n\_cartella as “cartella”,  
SUBSTR(TRIM (cartella.cognome) || ’ ’ || TRIM (cartella.nome), 1,40) as “cognome\_nome”,  
cartella.data\_nasc as “data\_nascita”,  
anno\_elab - to\_number (to\_char (cartella.data\_nasc, ‘yyyy’), ‘9999’) as “eta”,  
cartella.sesso,  
cartella.cod\_com\_nasc as “cod\_comune\_nascita”,  
TRIM (comuni1.descrizione) as “comune\_nascita”,  
cartella.cittadinanza as “cod\_cittadinanza”,  
TRIM (cittadin.des\_cittadin) as “cittadinanza”,  
cartella.cod\_reg as “codice\_sanitario”,  
cartella.cod\_fisc as “codice\_fiscale”,  
cartella.cod\_usl as “codice\_usl”,  
cartella.data\_apertura,  
cartella.data\_chiusura,  
DECODE (cartella.motivo\_chiusura,‘1’, ‘Trasferimento’,‘2’, ‘Decesso’) as “motivo\_chiusura”,  
anagra\_c.citta as “cod\_comune\_res”,  
TRIM (comuni2.descrizione) as “comune\_resid”,  
TRIM (anagra\_c.indirizzo) as “ind\_resid”,  
TRIM (areadis1.descrizione) as “areadist\_resid”,  
anagra\_c.dom\_citta as “cod\_comune\_domic”,  
TRIM (comuni3.descrizione) as “comune\_domic”,  
TRIM (anagra\_c.dom\_indiriz) as “ind\_domic”,  
TRIM (areadis2.descrizione) as “areadist\_domic”,  
anagra\_c.cod\_med as “cod\_mmg”,  
SUBSTR (TRIM (medici.mecogn) || ’ ’ || TRIM (medici.menome), 1, 40) as “cognome\_nome\_mmg”,  
medici.mefisc as “cod\_fisc\_mmg”,  
region.region as “regione”,  
tabusl.desusl as “usl\_resid”,  
skinf.n\_contatto,  
skinf.ski\_data\_apertura,  
skinf.ski\_data\_uscita as “ski\_data\_chiusura”,  
skinf.ski\_les\_dec,  
skidecubito\_t.skdt\_data,  
DECODE (skidecubito\_t.skdt\_dolore,  
‘1’, ‘NO’,  
‘2’, ‘SI,DA VALUTARE’,  
‘3’, ‘SI,VALUTATO’  
),  
skidecubito\_t.skdt\_note,  
skidecubito\_t.skdt\_trattamento,  
skidecubito\_d.skdd\_prog,  
DECODE (skidecubito\_d.skdd\_sede,  
‘1’, ‘OCCIPITE’,  
‘2’, ‘PADIGLIONE AURICOLARE DX’,  
‘3’, ‘PADIGLIONE AURICOLARE SN’,  
‘4’, ‘RACHIDE’,  
‘5’, ‘SACRO-COCCIGEO’,  
‘6’, ‘TRONCATERE DX’,  
‘7’, ‘TRONCATERE SN’,  
‘8’, ‘TALLONE DX’,  
‘9’, ‘TALLONE SN’,  
‘10’, ‘MALLEOLO INT. DX’,  
‘11’, ‘MALLEOLO INT. SN’,  
‘12’, ‘MALLEOLO EST. DX’,  
‘13’, ‘MALLEOLO EST. SN’,  
‘14’, ‘ALTRA SEDE’  
),  
DECODE (skidecubito\_d.skdd\_stadio,  
‘0’, ‘GUARIGIONE’,  
‘1’, ‘STADIO I’,  
‘2’, ‘STADIO I-N’,  
‘3’, ‘STADIO II’,  
‘4’, ‘STADIO II-N’,  
‘5’, ‘STADIO III’,  
‘6’, ‘STADIO III-N’,  
‘7’, ‘STADIO IV’,  
‘8’, ‘STADIO IV-N’  
),  
DECODE (skidecubito\_d.skdd\_diametro,  
‘1’, ‘MINORE DI 5’,  
‘2’, ‘TRA 5 E 10’,  
‘3’, ‘MAGGIORE DI 10’  
),  
skidecubito\_d.skdd\_data\_val,  
skidecubito\_d.skdd\_data\_guarigione

FROM sinsnt\_test.cartella,  
sinsnt\_test.anno\_elab,  
sinsnt\_test.comuni comuni1,  
sinsnt\_test.comuni comuni2,  
sinsnt\_test.comuni comuni3,  
sinsnt\_test.cittadin,  
sinsnt\_test.anagra\_c,  
sinsnt\_test.areadis areadis1,  
sinsnt\_test.areadis areadis2,  
sinsnt\_test.medici,  
sinsnt\_test.region,  
sinsnt\_test.tabusl,  
sinsnt\_test.skinf,  
sinsnt\_test.skidecubito\_t,  
sinsnt\_test.skidecubito\_d

WHERE skinf.n\_cartella = cartella.n\_cartella  
AND skinf.n\_cartella = anagra\_c.n\_cartella  
AND anagra\_c.data\_variazione =  
(SELECT MAX (data\_variazione)  
FROM sinsnt\_test.anagra\_c  
WHERE cartella.n\_cartella = anagra\_c.n\_cartella)  
and skinf.n\_contatto =  
(select max(n\_contatto) from sinsnt\_test.skinf  
where cartella.n\_cartella = skinf.n\_cartella  
and ski\_data\_apertura

```
  and (ski_data_uscita
      >= to_date('01-01-'||to_char(anno_elab), 'DD-MM-YYYY')
                                  or ski_data_uscita is null))
  AND cartella.cod_com_nasc = comuni1.codice
  AND anagra_c.citta = comuni2.codice
  AND anagra_c.dom_citta = comuni3.codice
  AND anagra_c.areadis = areadis1.codice
  AND anagra_c.dom_areadis = areadis2.codice
  AND anagra_c.cod_med = medici.mecodi
  AND cartella.cittadinanza = cittadin.cd_cittadin
  AND anagra_c.regione = region.cd_reg
  AND anagra_c.usl = tabusl.cd_usl
  AND skinf.n_cartella = skidecubito_t.n_cartella
  AND skinf.n_cartella = skidecubito_d.n_cartella
  AND skinf.n_contatto = skidecubito_t.n_contatto
  AND skinf.n_contatto = skidecubito_d.n_contatto

```

but with other tools can not find the error.

☹

---

<div class="post-metadata">

**Author:** ![NormTeamT](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/normteamt/32/53_2.png) [@NormTeamT](https://forums.toadworld.com/u/NormTeamT)\
**Post date:** [October 20, 2011, 8:29am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/5 "2011-10-20T08:29:36Z")

</div>

Afternoon Mari,

$ oerr ora 972

00972, 00000, “identifier is too long”  
// \*Cause: An identifier with more than 30 characters was specified.  
// \*Action: Specify at most 30 characters.

Unfortunately, I don’t see where it could be in your SELECT statement. ☹

Cheers,  
Norm. [TeamT]

Norman Dunbar  
Contract Senior Oracle DBA  
Capgemini Database Build Team  
Internal : 7 28 2051  
External : 0113 231 2051

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.  
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at [www.environment-agency.gov.uk](http://www.environment-agency.gov.uk)

---

<div class="post-metadata">

**Author:** ![flyfishpanfish](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/flyfishpanfish/32/141_2.png) [@flyfishpanfish](https://forums.toadworld.com/u/flyfishpanfish)\
**Post date:** [October 20, 2011, 8:58am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/6 "2011-10-20T08:58:31Z")

</div>

Check your CASE statements, looks like they need a name/alias.

See Toad “snippets” for decode: DECODE( expr , value1 [ , return1 ,  
value2 , return2 …, ] default )

So replace….

DECODE ( skidecubito\_t . skdt\_dolore ,

‘1’ , ‘NO’ ,

‘2’ , ‘SI,DA VALUTARE’ ,

‘3’ , ‘SI,VALUTATO’ ) ,

With….

DECODE ( skidecubito\_t . skdt\_dolore ,

‘1’ , ‘NO’ ,

‘2’ , ‘SI,DA VALUTARE’ ,

‘3’ , ‘SI,VALUTATO’ )

S\_DOLARE ,

---

<div class="post-metadata">

**Author:** ![NormTeamT](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/normteamt/32/53_2.png) [@NormTeamT](https://forums.toadworld.com/u/NormTeamT)\
**Post date:** [October 20, 2011, 9:09am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/7 "2011-10-20T09:09:33Z")

</div>

> > Check your CASE statements, looks like they need a name/alias.  
> > Nice catch Deb!

Cheers,  
Norm. [TeamT]

Norman Dunbar  
Contract Senior Oracle DBA  
Capgemini Database Build Team  
Internal : 7 28 2051  
External : 0113 231 2051

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.  
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at [www.environment-agency.gov.uk](http://www.environment-agency.gov.uk)

---

<div class="post-metadata">

**Author:** ![flyfishpanfish](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/flyfishpanfish/32/141_2.png) [@flyfishpanfish](https://forums.toadworld.com/u/flyfishpanfish)\
**Post date:** [October 20, 2011, 9:28am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/8 "2011-10-20T09:28:46Z")

</div>

Thanks – comes with years of writing and reading bad SQL J …and Toad  
formatting helps lots too.

---

<div class="post-metadata">

**Author:** ![NormTeamT](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/normteamt/32/53_2.png) [@NormTeamT](https://forums.toadworld.com/u/NormTeamT)\
**Post date:** [October 20, 2011, 9:31am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/9 "2011-10-20T09:31:06Z")

</div>

On 20/10/11 15:28, Flad Deborah M. (DSCYF) wrote:

> Thanks – comes with years of writing and reading bad SQL J..and Toad  
> formatting helps lots too.  
> Funny thing is, I tried a huge DECODE in Toad, and got an extremely wide  
> column header and a result. No error. ☹

--  
Cheers,  
Norm. [TeamT]

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [October 20, 2011, 9:34am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/10 "2011-10-20T09:34:53Z")

</div>

I don’t think the alias is actually required no matter how long the expression for the column. But if you do specify an alias, it needs to be 30 characters or less.

---

<div class="post-metadata">

**Author:** ![mari](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mari](https://forums.toadworld.com/u/mari)\
**Post date:** [October 20, 2011, 10:10am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/11 "2011-10-20T10:10:18Z")

</div>

Thanks very much, I’ve solved with alias

---

<div class="post-metadata">

**Author:** ![Guest](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@Guest](https://forums.toadworld.com/u/Guest)\
**Post date:** [October 20, 2011, 11:00am UTC](https://forums.toadworld.com/t/error-ora-00972/10810/12 "2011-10-20T11:00:36Z")

</div>

> > I don't think the alias is actually required

Correct. But the longer you have your expression, the nicer an alias becomes  
just to keep your column size down… speaking from sqlpplus of course 😉

I haven’t actually reviewed the sql fully, but I think Deb got the primary  
issue with the closing double quotes for that one column. The error message  
would have arisen because the double quotes altered the parsing on the rest of  
the query.

As a side observation: Its good practice to have defaults on the decode though  
so the developer is in total control of what the value that emerges is.

Roger S.
