<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: phoenix wide table, insert 1 row with 100 columns in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-wide-table-insert-1-row-with-100-columns/m-p/233126#M64134</link>
    <description>&lt;P&gt;No, if you need to store 100 columns per row, you need to set the values on the prepared statement for each row.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jul 2017 22:26:27 GMT</pubDate>
    <dc:creator>elserj</dc:creator>
    <dc:date>2017-07-05T22:26:27Z</dc:date>
    <item>
      <title>phoenix wide table, insert 1 row with 100 columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-wide-table-insert-1-row-with-100-columns/m-p/233125#M64133</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using spring boot jdbc template connecting to a phoenix hbase database.&lt;/P&gt;&lt;P&gt;However, i have a table with 100 columns. so, everytime when i insert a row should contain 100 values&lt;/P&gt;&lt;P&gt;For example insert:&lt;/P&gt;&lt;PRE&gt;	public void insert(Ttsnihl m){
		Object[] params = new Object[]{
				m.getPATIENT_ID(), 
                m.getRECORD_DATE(),
                m.getSTART_TIME(),
                m.getEND_TIME(),
                .....// 100 object array
               };
		jdbcTemplate.update(insertSql, params);
	}
&lt;/PRE&gt;&lt;P&gt;And:&lt;/P&gt;&lt;PRE&gt;	public void insertBatch(final List&amp;lt;Ttsnihl&amp;gt; ts){
		
		BatchPreparedStatementSetter bpss = new BatchPreparedStatementSetter() {
			@Override
			public void setValues(PreparedStatement ps, int i) throws SQLException {
				Ttsnihl t=ts.get(i);
				ps.setString(1,  t.getPATIENT_ID());
				ps.setTimestamp(2,  t.getRECORD_DATE());
				ps.setTimestamp(3, t.getSTART_TIME());
				ps.setTimestamp(4, t.getEND_TIME());
                                ..... // 100 ps.set()functions
                                
			}
			@Override
		    public int getBatchSize() {
		        return ts.size();
		    }
		  };
		  
		jdbcTemplate.batchUpdate(insertSql, bpss);
	}
&lt;/PRE&gt;&lt;P&gt;I want to ask, is there any smart way to do this?&lt;/P&gt;&lt;P&gt;Many thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 17:35:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-wide-table-insert-1-row-with-100-columns/m-p/233125#M64133</guid>
      <dc:creator>yebinianhi</dc:creator>
      <dc:date>2017-07-01T17:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: phoenix wide table, insert 1 row with 100 columns</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-wide-table-insert-1-row-with-100-columns/m-p/233126#M64134</link>
      <description>&lt;P&gt;No, if you need to store 100 columns per row, you need to set the values on the prepared statement for each row.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 22:26:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/phoenix-wide-table-insert-1-row-with-100-columns/m-p/233126#M64134</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2017-07-05T22:26:27Z</dc:date>
    </item>
  </channel>
</rss>

