← Back to team overview

dhis2-devs team mailing list archive

Re: Exception when importing metadata dataelements

 

Pooben,

I see that you csv file is actually correct in the sense that all the
fields except the last two (Option set and Comment option set) are
included. There's been some recent changes to the csv import of option set,
but as far as I know that did not include making the option set UID here
compulsory.

Looks like a bug, then

Regards
Calle

On 31 March 2015 at 21:33, Calle Hedberg <calle.hedberg@xxxxxxxxx> wrote:

> Pooben,
>
> There is NO field called "Active" in the data element meta-data CSV import
> - see table 1.11 in the developer manual (below)
>
> There used to be a field called "Active" in the Organisationunit table,
> but that was dropped in from version 2.17 or 2.18 onwards. There's never
> been any "active" field in the data element or indicator tables - not even
> in version 1.x
>
> The only issue to be aware of is that the "name" column, which in the
> description below is defined as Unique, actually is NOT unique. Only the
> UID and Code columns are unique - if you import a data element with a name
> that already exists in your DHIS2 instance (but where the UID is
> different), it will import it and create a duplicate with no warning.
>
> Regards
> Calle
>
> *Table 1.11. Data Element CSV Format*
> ColumnRequiredValue (default first)DescriptionNameYes Name. Max 230 char.
> Unique.UIDNoUIDStable identifier. Max 11 char. Will be generated by
> system if not specified.CodeNo Stable code. Max 50 char.Short nameNo50
> first char of nameWill fall back to first 50 characters of name if
> unspecified. Max 50 char. Unique.DescriptionNo Free text description.Form
> nameNo Max 230 char.Domain typeNoaggregate | trackerDomain type for data
> element, can be aggregate or tracker. Max 16 char.Value typeNoint |
> string | bool | trueOnly | date | unitIntervalValue type. Max 16 char.Number
> typeNoint | posInt | negInt | number | zeroPositiveIntOnly relevant if
> type is int. Max 16 char.Text typeNotext | longTextOnly relevant if type
> is string. Max 16 char.Aggregation operatorNosum | average | count |
> stddev | varianceOperator indicating how to aggregate data in the time
> dimension. Max 16 char.Category combination UIDNoUIDUID of category
> combination. Will default to default category combination if not specified.
> UrlNo URL to data element resource. Max 255 char.Zero is significantNofalse
> | trueIndicates whether zero values will be stored for this data element.Option
> setNoUIDUID of option set to use for data.Comment option setNoUIDUID of
> option set to use for comments.
>
>
> On 31 March 2015 at 20:26, Pooben Dass <pooben@xxxxxxxx> wrote:
>
>> Hi Devs
>>
>>
>>
>> I am receiving this exception:-
>>
>>
>>
>> Caused by: org.postgresql.util.PSQLException: ERROR: null value in column
>> "active" violates not-null constraint
>>
>>   Detail: Failing row contains (10248, X9TfdT6JLNJ, null, 2015-03-31
>> 19:43:09.306, 2015-03-31 19:43:12.352, Sub-dermal implant inserted,
>> Sub-dermal implant insert, Sub-dermal contraceptive implant inserted just
>> under the skin of..., null, null, int, number, null, AGGREGATE, sum, 14,
>> null, null, t, null, --------, null, null, null).
>>
>>         at
>> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
>>
>>         at
>> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
>>
>>         at
>> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
>>
>>         at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
>>
>>         at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:419)
>>
>>         at
>> org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:365)
>>
>>         at
>> com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
>>
>>         at
>> org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:133)
>>
>>         ... 31 more
>>
>>
>>
>> What position in the csv file must the active field be in or is this a
>> bug?
>>
>> Attached is my csv file.
>>
>>
>>
>> Regards
>>
>> Pooben
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
>
> *******************************************
>
> Calle Hedberg
>
> 46D Alma Road, 7700 Rosebank, SOUTH AFRICA
>
> Tel/fax (home): +27-21-685-6472
>
> Cell: +27-82-853-5352
>
> Iridium SatPhone: +8816-315-19274
>
> Email: calle.hedberg@xxxxxxxxx
>
> Skype: calle_hedberg
>
> *******************************************
>
>


-- 

*******************************************

Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19274

Email: calle.hedberg@xxxxxxxxx

Skype: calle_hedberg

*******************************************

Follow ups

References