datajoint/datajoint-matlab

error when inserting strings of type `string`

Closed this issue · 0 comments

The new string data type causes problems for string data types.

As reported by a user:

>> session_date

session_date = 

  23×1 string array

    "2016-03-01"
    "2016-03-01"
    "2016-03-01"

>> tuple.session_date = session_date; % should be in string format "2017-05-12"
>> insert(preprocess.EyeROI, dj.struct.fromFields(tuple))
Error using dj.Relvar/insert (line 236)
The field session_date must be a character string
 
236                         assert(ischar(v), ...
>> clear
>> PupilLoop

contents = 

  23×1 struct array with fields:

    name
    folder
    date
    bytes
    isdir
    datenum

Data not collected and skip to next iteration Index exceeds matrix dimensions.
Elapsed time is 3.655716 seconds.
Error using mym
String placeholders only accept CHAR 1-by-M arrays or M-by-1!

Error in dj.Connection/query (line 174)
                mym(self.connId, queryStr, v{:});

Error in dj.Relvar/insert (line 272)
            self.schema.conn.query(command, blobs{:});

Error in PupilLoop (line 297)
insert(preprocess.EyeROI, dj.struct.fromFields(tuple))
 
174                 mym(self.connId, queryStr, v{:});