Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Fastinsert error
Date: Wed, 11 Nov 2009 18:57:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 43
Message-ID: <hdf1dt$qiu$1@fred.mathworks.com>
References: <hcsk5j$qkn$1@fred.mathworks.com> <hcutto$e9e$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257965821 27230 172.30.248.38 (11 Nov 2009 18:57:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 11 Nov 2009 18:57:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1893295
Xref: news.mathworks.com comp.soft-sys.matlab:584310


"Sally " <sd2383@columbia.edu> wrote in message <hcutto$e9e$1@fred.mathworks.com>...
> "Sally " <sd2383@columbia.edu> wrote in message <hcsk5j$qkn$1@fred.mathworks.com>...
> > Hi,
> > 
> > I am using fastinsert() of the Database Toolbox to insert new records into a table.
> > 
> > The function works fine with data in the form of matrices and single row cell arrays, e.g., a cell array of the form:
> > data= {1x1 cell} [1x1 double]
> > 
> > But it returns an error for cell arrays with more than 1 row, e.g.:
> > data= {2x1 cell}  [2x1 double]
> > 
> > Error message:
> > ??? No constructor java.lang.String with matching signature found
> > Error in ==> database.fastinsert at 155
> >             StatementObject.setString(j,java.lang.String(tmp))  %CHAR, LONGVARCHAR, VARCHAR
> > 


Hey Sally do you have any experience with access database? I need some help with the insert and update functions. My problem is

I investigate the possibility to use Access as a database. Therefore I tried to export data from matlab to Access.

I used the function:

colname={'Nike'};

exdata=[1;2;3];

insert(conn, 'New_Price', colname, exdata)

where 'New Price' is the name of the table and colname is the name of the column where the exdata is exported to. When I try to export exdata it all work fine. The only problem is that the exdata is allways copied to the end of the column Nike. My question is how can I control what row in the column Nike the exdata is exported to?
> > Does anyone know if the cell array needs to be in a particular format, or if this is a bug?
> > 
> > Thanks in advance,
> > Sally
> 
> I figured this out - for anyone else interested, the cell array needs to look like:
>     {1x1 cell}    [double]
>     {1x1 cell}    [double]
> 
> See:
> http://www.mathworks.com/support/solutions/en/data/1-98WCCG/?solution=1-98WCCG