# Add attribute by scripting (updated and simplified question)

**URL:** <https://forum.inductiveautomation.com/t/add-attribute-by-scripting-updated-and-simplified-question/12068>\
**Category:** Ignition\
**Created:** [August 25, 2016, 9:22pm UTC](https://forum.inductiveautomation.com/t/add-attribute-by-scripting-updated-and-simplified-question/12068 "2016-08-25T21:22:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jhahn](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@Jhahn](https://forum.inductiveautomation.com/u/Jhahn)\
**Post date:** [August 25, 2016, 9:22pm UTC](https://forum.inductiveautomation.com/t/add-attribute-by-scripting-updated-and-simplified-question/12068/1 "2016-08-25T21:22:58Z")

</div>

Hello. I am trying to add a sample def attribute by scripting.  
I can successfully add a definition, as well as a location.

where is the information for definition attributes stored?  
I know that it goes in to the  
qual\_def table  
sample\_defattr table

I am using these insert statements

insert into qual\_defattr(defuuid,attrname,description,enabled,datatype,meascount,timestamp,format) values(‘82f0ad23-e2e6-4b5c-afe6-ea78cc023fa5’,‘OD’,‘OD’,‘1’,‘3’,‘48’,current\_timestamp,’##.###’)

insert into SampleDefAttr (sampledefid,Name,description,required,enabled,datatype,format,timestamp,“order”) values(‘600’,‘OD’,‘OD’,‘0’,‘1’,‘3’,’##.###’,current\_timestamp,‘1’)

\*\* when I compare my inserted rows to ones made by the Def Management system,. they look the same.

when I attempt to load the sample form I get this error message:

File “event:actionPerformed”, line 7, in

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

java.lang.IndexOutOfBoundsException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

```
caused by IndexOutOfBoundsException: Index: 0, Size: 0
```
