Thread Subject: Fastinsert error

Subject: Fastinsert error

From: Sally

Date: 4 Nov, 2009 19:20:19

Message: 1 of 3

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

Does anyone know if the cell array needs to be in a particular format, or if this is a bug?

Thanks in advance,
Sally

Subject: Fastinsert error

From: Sally

Date: 5 Nov, 2009 16:19:04

Message: 2 of 3

"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
>
> 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

Subject: Fastinsert error

From: Jesper Lauridsen

Date: 11 Nov, 2009 18:57:01

Message: 3 of 3

"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

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
database Sally 4 Nov, 2009 14:24:03
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com