# NCLOB in Alarm Journal - not in DB tables (Oracle)

**URL:** <https://forum.inductiveautomation.com/t/nclob-in-alarm-journal-not-in-db-tables-oracle/77711>\
**Category:** Ignition\
**Created:** [August 10, 2023, 6:00pm UTC](https://forum.inductiveautomation.com/t/nclob-in-alarm-journal-not-in-db-tables-oracle/77711 "2023-08-10T18:00:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![AIO](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/aio/32/87549_2.png) [@AIO](https://forum.inductiveautomation.com/u/AIO)\
**Post date:** [August 10, 2023, 8:02pm UTC](https://forum.inductiveautomation.com/t/nclob-in-alarm-journal-not-in-db-tables-oracle/77711/2 "2023-08-10T20:02:32Z")

</div>

Ran this series of commands to change it from CLOB to VARCHAR. Picked a length of 500 to leave room for longer descriptions (my longest was 293).

```auto
--create new column
alter table ALARM_EVENT_DATA add ("strvalue2" varchar2(500));
--copy clob to varchar
update ALARM_EVENT_DATA set "strvalues" = dbms_lob.substr("strvalue",500,1);
--rename clob, then rename new column
alter table ALARM_EVENT_DATA rename column "strvalue" to "strvalueClob";
alter table ALARM_EVENT_DATA rename column "strvalue2" to "strvalue";

```

I was hesitant to drop the CLOB just yet, but it will happen once I'm content this is working.

Since this is a system created table, perhaps the folks at IA can make these changes for future releases?

Cheers!

Edit:  
Used this command to get the max clob length for determining my new VARCHAR size.

> SELECT max(dbms\_lob.getlength("strvalue")) FROM ALARM\_EVENT\_DATA

---

_[View the full topic](https://forum.inductiveautomation.com/t/nclob-in-alarm-journal-not-in-db-tables-oracle/77711)._
