<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265007</link>
    <title>MATLAB Central Newsreader - Fastinsert error</title>
    <description>Feed for thread: Fastinsert error</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 04 Nov 2009 19:20:19 -0500</pubDate>
      <title>Fastinsert error</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265007#692163</link>
      <author>Sally </author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I am using fastinsert() of the Database Toolbox to insert new records into a table.&lt;br&gt;
&lt;br&gt;
The function works fine with data in the form of matrices and single row cell arrays, e.g., a cell array of the form:&lt;br&gt;
data= {1x1 cell} [1x1 double]&lt;br&gt;
&lt;br&gt;
But it returns an error for cell arrays with more than 1 row, e.g.:&lt;br&gt;
data= {2x1 cell}  [2x1 double]&lt;br&gt;
&lt;br&gt;
Error message:&lt;br&gt;
??? No constructor java.lang.String with matching signature found&lt;br&gt;
Error in ==&amp;gt; database.fastinsert at 155&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StatementObject.setString(j,java.lang.String(tmp))  %CHAR, LONGVARCHAR, VARCHAR&lt;br&gt;
&lt;br&gt;
Does anyone know if the cell array needs to be in a particular format, or if this is a bug?&lt;br&gt;
&lt;br&gt;
Thanks in advance,&lt;br&gt;
Sally</description>
    </item>
    <item>
      <pubDate>Thu, 05 Nov 2009 16:19:04 -0500</pubDate>
      <title>Re: Fastinsert error</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265007#692446</link>
      <author>Sally </author>
      <description>&quot;Sally &quot; &amp;lt;sd2383@columbia.edu&amp;gt; wrote in message &amp;lt;hcsk5j$qkn$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am using fastinsert() of the Database Toolbox to insert new records into a table.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The function works fine with data in the form of matrices and single row cell arrays, e.g., a cell array of the form:&lt;br&gt;
&amp;gt; data= {1x1 cell} [1x1 double]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; But it returns an error for cell arrays with more than 1 row, e.g.:&lt;br&gt;
&amp;gt; data= {2x1 cell}  [2x1 double]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Error message:&lt;br&gt;
&amp;gt; ??? No constructor java.lang.String with matching signature found&lt;br&gt;
&amp;gt; Error in ==&amp;gt; database.fastinsert at 155&lt;br&gt;
&amp;gt;             StatementObject.setString(j,java.lang.String(tmp))  %CHAR, LONGVARCHAR, VARCHAR&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Does anyone know if the cell array needs to be in a particular format, or if this is a bug?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance,&lt;br&gt;
&amp;gt; Sally&lt;br&gt;
&lt;br&gt;
I figured this out - for anyone else interested, the cell array needs to look like:&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{1x1 cell}    [double]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{1x1 cell}    [double]&lt;br&gt;
&lt;br&gt;
See:&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/support/solutions/en/data/1-98WCCG/?solution=1-98WCCG&quot;&gt;http://www.mathworks.com/support/solutions/en/data/1-98WCCG/?solution=1-98WCCG&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 11 Nov 2009 18:57:01 -0500</pubDate>
      <title>Re: Fastinsert error</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265007#693968</link>
      <author>Jesper Lauridsen</author>
      <description>&quot;Sally &quot; &amp;lt;sd2383@columbia.edu&amp;gt; wrote in message &amp;lt;hcutto$e9e$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Sally &quot; &amp;lt;sd2383@columbia.edu&amp;gt; wrote in message &amp;lt;hcsk5j$qkn$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I am using fastinsert() of the Database Toolbox to insert new records into a table.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The function works fine with data in the form of matrices and single row cell arrays, e.g., a cell array of the form:&lt;br&gt;
&amp;gt; &amp;gt; data= {1x1 cell} [1x1 double]&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; But it returns an error for cell arrays with more than 1 row, e.g.:&lt;br&gt;
&amp;gt; &amp;gt; data= {2x1 cell}  [2x1 double]&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Error message:&lt;br&gt;
&amp;gt; &amp;gt; ??? No constructor java.lang.String with matching signature found&lt;br&gt;
&amp;gt; &amp;gt; Error in ==&amp;gt; database.fastinsert at 155&lt;br&gt;
&amp;gt; &amp;gt;             StatementObject.setString(j,java.lang.String(tmp))  %CHAR, LONGVARCHAR, VARCHAR&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Hey Sally do you have any experience with access database? I need some help with the insert and update functions. My problem is&lt;br&gt;
&lt;br&gt;
I investigate the possibility to use Access as a database. Therefore I tried to export data from matlab to Access.&lt;br&gt;
&lt;br&gt;
I used the function:&lt;br&gt;
&lt;br&gt;
colname={'Nike'};&lt;br&gt;
&lt;br&gt;
exdata=[1;2;3];&lt;br&gt;
&lt;br&gt;
insert(conn, 'New_Price', colname, exdata)&lt;br&gt;
&lt;br&gt;
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?&lt;br&gt;
&amp;gt; &amp;gt; Does anyone know if the cell array needs to be in a particular format, or if this is a bug?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks in advance,&lt;br&gt;
&amp;gt; &amp;gt; Sally&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I figured this out - for anyone else interested, the cell array needs to look like:&lt;br&gt;
&amp;gt;     {1x1 cell}    [double]&lt;br&gt;
&amp;gt;     {1x1 cell}    [double]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; See:&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/support/solutions/en/data/1-98WCCG/?solution=1-98WCCG&quot;&gt;http://www.mathworks.com/support/solutions/en/data/1-98WCCG/?solution=1-98WCCG&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 11 Jan 2011 17:05:20 -0500</pubDate>
      <title>Re: Fastinsert error</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265007#811509</link>
      <author>Iqbal Nouyed</author>
      <description>Hi Sally,&lt;br&gt;
&lt;br&gt;
I don't understand your solution, please help me out here, I have a cell-array variable containing, 1x64 cells, where each containing 1x256 array of integer values. &lt;br&gt;
I have a mysql database table of the following schema,&lt;br&gt;
&lt;br&gt;
CREATE TABLE IF NOT EXISTS `feresys`.`faces` (&lt;br&gt;
&amp;nbsp;&amp;nbsp;`face_id` INT(11) NOT NULL AUTO_INCREMENT ,&lt;br&gt;
&amp;nbsp;&amp;nbsp;`local_hist` INT(11) NULL DEFAULT NULL ,&lt;br&gt;
&amp;nbsp;&amp;nbsp;`user_id` VARCHAR(45) NOT NULL ,&lt;br&gt;
&amp;nbsp;&amp;nbsp;PRIMARY KEY (`face_id`) ,&lt;br&gt;
&amp;nbsp;&amp;nbsp;UNIQUE INDEX `user_id_UNIQUE` (`user_id` ASC) )&lt;br&gt;
ENGINE = InnoDB&lt;br&gt;
DEFAULT CHARACTER SET = latin1;&lt;br&gt;
&lt;br&gt;
I want to insert the following data into the table&lt;br&gt;
&lt;br&gt;
id size 1x4 ( eg. '1001')&lt;br&gt;
local_hist size 1x64x256 which is a cell array containing gray_scale histogram of 64 regions of an image, which are all integers 0-255.&lt;br&gt;
&lt;br&gt;
I've used the following lines to perform the insertion:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;conn = database('dbname', '', '', 'com.mysql.jdbc.Driver', 'jdbc:mysql://localhost:3306/dbname');&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;extdata = {LH, id};&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;colnames = {'local_hist', 'user_id'};&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tblname = 'tbname';&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fastinsert(conn, tblname, colnames, extdata);&lt;br&gt;
&lt;br&gt;
But i get the following error message:&lt;br&gt;
?? No method 'setInt' with matching signature found for class&lt;br&gt;
'com.mysql.jdbc.JDBC4PreparedStatement'.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; database.fastinsert at 181&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StatementObject.setInt(j,tmp) %INTEGER&lt;br&gt;
&lt;br&gt;
Can you please help me how to solve this problem?&lt;br&gt;
&lt;br&gt;
Thanks in advance&lt;br&gt;
&lt;br&gt;
&quot;Sally&quot; wrote in message &amp;lt;hcutto$e9e$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Sally &quot; &amp;lt;sd2383@columbia.edu&amp;gt; wrote in message &amp;lt;hcsk5j$qkn$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I am using fastinsert() of the Database Toolbox to insert new records into a table.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The function works fine with data in the form of matrices and single row cell arrays, e.g., a cell array of the form:&lt;br&gt;
&amp;gt; &amp;gt; data= {1x1 cell} [1x1 double]&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; But it returns an error for cell arrays with more than 1 row, e.g.:&lt;br&gt;
&amp;gt; &amp;gt; data= {2x1 cell}  [2x1 double]&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Error message:&lt;br&gt;
&amp;gt; &amp;gt; ??? No constructor java.lang.String with matching signature found&lt;br&gt;
&amp;gt; &amp;gt; Error in ==&amp;gt; database.fastinsert at 155&lt;br&gt;
&amp;gt; &amp;gt;             StatementObject.setString(j,java.lang.String(tmp))  %CHAR, LONGVARCHAR, VARCHAR&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Does anyone know if the cell array needs to be in a particular format, or if this is a bug?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks in advance,&lt;br&gt;
&amp;gt; &amp;gt; Sally&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I figured this out - for anyone else interested, the cell array needs to look like:&lt;br&gt;
&amp;gt;     {1x1 cell}    [double]&lt;br&gt;
&amp;gt;     {1x1 cell}    [double]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; See:&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/support/solutions/en/data/1-98WCCG/?solution=1-98WCCG&quot;&gt;http://www.mathworks.com/support/solutions/en/data/1-98WCCG/?solution=1-98WCCG&lt;/a&gt;</description>
    </item>
  </channel>
</rss>

