<?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>topic Re: Create table dynamically in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200945#M3242</link>
    <description>Hello
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;I wrote a routine to do the task. But I have question. How can execute this routine in a job. Which Component should I use to call the routine as a part of a job.&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;You can call the routine on tJava/tJavaRow/tMap or any text filed. For example, there is a routine called: TalendDate, supplied by Talend, then you call it on tJava like this:
&lt;BR /&gt;Date date=TalendDate.getCurrentDate();
&lt;BR /&gt;In your case, you can only create the tables dynamically with the same schema, but different table name, as the schema should be created on the design time, not the run time.
&lt;BR /&gt;Best regards
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
    <pubDate>Thu, 12 Jun 2008 06:39:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-06-12T06:39:36Z</dc:date>
    <item>
      <title>Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200940#M3237</link>
      <description>Hello,&lt;BR /&gt;I need to create table dynamically by reading a txt file(Tab delimited). The first line of the text file will have the column names and all datatypes are Char.&lt;BR /&gt;Database: MySQL&lt;BR /&gt;example:&lt;BR /&gt;File name:test.txt&lt;BR /&gt;Organization Name         IP                   Domain&lt;BR /&gt;xxxxxxxxxxxxxxx          xxxxxxxxx      xxxxxxxxx&lt;BR /&gt;Table sturcture should be&lt;BR /&gt;Name: test&lt;BR /&gt;Column Name            Datatype&lt;BR /&gt;Organization Name     varchar&lt;BR /&gt;IP                             varchar&lt;BR /&gt;Domain                     varchar   &lt;BR /&gt;&lt;BR /&gt;Is there any way to do this?&lt;BR /&gt;Thanks,&lt;BR /&gt;Sangi</description>
      <pubDate>Sat, 16 Nov 2024 14:20:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200940#M3237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200941#M3238</link>
      <description>Hello Sangi,
&lt;BR /&gt;What do you mean by "dynamically" ?
&lt;BR /&gt;When you read an input file, the number of column is never fixed ? Names of field aren't the same ?</description>
      <pubDate>Wed, 11 Jun 2008 08:34:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200941#M3238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-11T08:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200942#M3239</link>
      <description>Number of the columns and name of the columns are not fixed.
&lt;BR /&gt;Any solution?</description>
      <pubDate>Wed, 11 Jun 2008 09:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200942#M3239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-11T09:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200943#M3240</link>
      <description>I think you have to develop a routine to perform this task.&lt;BR /&gt;Create a method reading the input file:&lt;BR /&gt;- When you read the first line (the header line), open a DB connection. &lt;BR /&gt;   Then  write a "create table" query. The SQL field description corresponds to your header columns in your file.&lt;BR /&gt;- Then fetch the file to insert data in your new table (SQL insert query).</description>
      <pubDate>Wed, 11 Jun 2008 10:36:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200943#M3240</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-11T10:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200944#M3241</link>
      <description>as you said,&lt;BR /&gt;I wrote a routine to do the task. But I have question. How can execute this routine in a job. Which Component should I use to call the routine as a part of a job.&lt;BR /&gt;Thanks,&lt;BR /&gt;sangi</description>
      <pubDate>Thu, 12 Jun 2008 05:45:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200944#M3241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-12T05:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200945#M3242</link>
      <description>Hello
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;I wrote a routine to do the task. But I have question. How can execute this routine in a job. Which Component should I use to call the routine as a part of a job.&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;You can call the routine on tJava/tJavaRow/tMap or any text filed. For example, there is a routine called: TalendDate, supplied by Talend, then you call it on tJava like this:
&lt;BR /&gt;Date date=TalendDate.getCurrentDate();
&lt;BR /&gt;In your case, you can only create the tables dynamically with the same schema, but different table name, as the schema should be created on the design time, not the run time.
&lt;BR /&gt;Best regards
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Thu, 12 Jun 2008 06:39:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200945#M3242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-12T06:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200946#M3243</link>
      <description>import java.io.BufferedReader; 
&lt;BR /&gt;import java.io.FileReader; 
&lt;BR /&gt;import java.io.IOException; 
&lt;BR /&gt;public class BuildQuery { 
&lt;BR /&gt; public static String test_query() throws IOException { 
&lt;BR /&gt; BufferedReader in = new BufferedReader(new FileReader("D:\\TOS-All-r12707-V2.3.2\\workspace\\File\\test.tsv")); 
&lt;BR /&gt; String str; 
&lt;BR /&gt; while ((str = in.readLine()) != null) { 
&lt;BR /&gt; System.out.println("FirstLine : " + str); 
&lt;BR /&gt; break; 
&lt;BR /&gt; } 
&lt;BR /&gt; String Col[]=str.split("\\t"); 
&lt;BR /&gt; 
&lt;BR /&gt; StringBuilder sb = new StringBuilder("create table demo("); 
&lt;BR /&gt; for(int i = 0 ; i&amp;lt; Col.length ; i++){ 
&lt;BR /&gt; sb.append(Col 
&lt;I&gt;);&lt;BR /&gt; sb.append(" ");&lt;BR /&gt; sb.append("varchar(100)");&lt;BR /&gt; sb.append(",");&lt;BR /&gt; }&lt;BR /&gt; sb.delete(sb.lastIndexOf(","),sb.lastIndexOf(",")+1 );&lt;BR /&gt; sb.append("); ");&lt;BR /&gt; return sb.toString() ;&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; public static String main(String[] args) throws IOException {&lt;BR /&gt; return test_query();&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;This is my routine.&lt;BR /&gt;and uploading the image. I tried calling the method as you said. but giving following error.&lt;BR /&gt;String str=BuildQuery.main();&lt;BR /&gt;Exception in thread "main" java.lang.Error: Unresolved compilation problem: &lt;BR /&gt; BuildQuery cannot be resolved&lt;BR /&gt; at test.test.test.tJava_1Process(test.java:127)&lt;BR /&gt; at test.test.test.runJobInTOS(test.java:257)&lt;BR /&gt; at test.test.test.main(test.java:176)&lt;BR /&gt;I am not a professional java guy. &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;&lt;BR /&gt;and I am sure about mapping. I am using only one tJava component in the mapping. which calls a routine and the routine returns a String (Query). I need to capture the Query and pass it to the MySQL database to create the table.&lt;BR /&gt;What will be the probable mapping?&lt;BR /&gt;&lt;BR /&gt;Please help me!!!&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCTa.bmp"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156922iF304B47F10C712CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCTa.bmp" alt="0683p000009MCTa.bmp" /&gt;&lt;/span&gt;&lt;/I&gt;</description>
      <pubDate>Thu, 12 Jun 2008 08:07:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200946#M3243</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-12T08:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200947#M3244</link>
      <description>Hello
&lt;BR /&gt;add the package name:
&lt;BR /&gt;package routines;
&lt;BR /&gt;import java.io.BufferedReader;
&lt;BR /&gt;import java.io.FileReader;
&lt;BR /&gt;import java.io.IOException;
&lt;BR /&gt;Best regards 
&lt;BR /&gt; shong</description>
      <pubDate>Thu, 12 Jun 2008 08:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200947#M3244</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-12T08:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200948#M3245</link>
      <description>Hello Shong,
&lt;BR /&gt;Its working fine. The routine is now giving the SQL Query (Create table) as a return. How can I use this query to create a table? Which component should I use?
&lt;BR /&gt;Thanks,
&lt;BR /&gt;sangi</description>
      <pubDate>Thu, 12 Jun 2008 10:22:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200948#M3245</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-12T10:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200949#M3246</link>
      <description>Hello
&lt;BR /&gt;With the tDBxxxRow(like tMysqlRow), you can execute the standard SQL statement.
&lt;BR /&gt;Best regards
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Thu, 12 Jun 2008 10:33:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200949#M3246</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-12T10:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200950#M3247</link>
      <description>Thank you!!! I am storing the query into a file. Now, this query has to go to tMysqlRow!!! how is this possible?</description>
      <pubDate>Thu, 12 Jun 2008 11:14:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200950#M3247</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-12T11:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200951#M3248</link>
      <description>Hello Sangi, 
&lt;BR /&gt;See the attachment. 
&lt;BR /&gt; 
&lt;BR /&gt;More details : 
&lt;BR /&gt;In the input file, I create a column named "query", corresponding to the create table statement in your file. 
&lt;BR /&gt;Then Link your input file containing your query to the tMysqlRow component. 
&lt;BR /&gt;By default, the link called row1. 
&lt;BR /&gt;In tMysqlRow settings: 
&lt;BR /&gt;call the statement in query textbox : "linkName"."inputColumnName" 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCTf.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139177iCF7E0A3137FF990E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCTf.jpg" alt="0683p000009MCTf.jpg" /&gt;&lt;/span&gt;</description>
      <pubDate>Thu, 12 Jun 2008 12:53:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200951#M3248</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-12T12:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200952#M3249</link>
      <description>Hi catounz, 
&lt;BR /&gt;Thank you so much!!! 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; Job is done!!!</description>
      <pubDate>Fri, 13 Jun 2008 06:54:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200952#M3249</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-13T06:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200953#M3250</link>
      <description>Thanks to one and all... 
&lt;BR /&gt;I am almost done with the job. 
&lt;BR /&gt;Now job is reading the file, building the query and creating the table with the same name. 
&lt;BR /&gt;I need to improve the job to one level above, so that, it picks the file and runs the process as and when a tsv file creates in the folder. For this, I am using the tWaitForFile component, but its not picking the file from the specified folder. 
&lt;BR /&gt;Could you please tell me the tWaitForFile use, how can I use this component. 
&lt;BR /&gt;I will be having more than one file at a time, in that case the job should pick all the files and need to create the respective table. 
&lt;BR /&gt;How can I achieve this? 
&lt;BR /&gt;Many Thanks, 
&lt;BR /&gt;sangi 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCSd.bmp"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135826i3B140409F7631534/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCSd.bmp" alt="0683p000009MCSd.bmp" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCTk.bmp"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153556iD7D6DF340937165E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCTk.bmp" alt="0683p000009MCTk.bmp" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCTp.bmp"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137690iD418C253E6A5909A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCTp.bmp" alt="0683p000009MCTp.bmp" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCKe.bmp"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132044iF2135A3543ACE9BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCKe.bmp" alt="0683p000009MCKe.bmp" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 13 Jun 2008 08:00:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200953#M3250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-13T08:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200954#M3251</link>
      <description>Hello sangi 
&lt;BR /&gt;The tWaitForFile is used to scan one folder, if there is a new file created or delete a exist file in the folder, it will trigger one event. I have created two jobs: myJob1 and myJob2. In myJob1 job, I use the tFileList to iterate all the files in the folder if there are more than one new file created at a time. In myJob2 job, there is only one tJava component, it call the routines. You must run the myJob1 job first, then run the myJob2 Job. 
&lt;BR /&gt;Please see the screenshot. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; 
&lt;BR /&gt; shong 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCBn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157351iE0DC512E78B34543/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCBn.png" alt="0683p000009MCBn.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCTu.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157178i469E72D138FA8C51/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCTu.png" alt="0683p000009MCTu.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCTz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142480iBC5AF1640595BD32/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCTz.png" alt="0683p000009MCTz.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCJW.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133965i6C4511647FCB9AEE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCJW.png" alt="0683p000009MCJW.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 13 Jun 2008 08:51:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200954#M3251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-13T08:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create table dynamically</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200955#M3252</link>
      <description>Hey shong, 
&lt;BR /&gt;Thanks for everything!!! 
&lt;BR /&gt;The task to be done in one go!!! 
&lt;BR /&gt;1. We will get the tsv file. 
&lt;BR /&gt;2. We need to create a query for every tsv file. 
&lt;BR /&gt;3. Execute each query to create a table in the database. 
&lt;BR /&gt;for this I created a single job!!! 
&lt;BR /&gt;I added tWaitForFile and tFileList to existing job and changed the code in tJava. Rest are same!!! 
&lt;BR /&gt;Please find the attachments. 
&lt;BR /&gt;Here is my final Java routine: 
&lt;BR /&gt;package routines; 
&lt;BR /&gt;import java.io.BufferedReader; 
&lt;BR /&gt;import java.io.BufferedWriter; 
&lt;BR /&gt;import java.io.FileReader; 
&lt;BR /&gt;import java.io.FileWriter; 
&lt;BR /&gt;import java.io.IOException; 
&lt;BR /&gt;public class BuildQuery { 
&lt;BR /&gt; public static String test_query(String fn) throws IOException { 
&lt;BR /&gt; String filePath=new String("D:\\TOS-All-r12707-V2.3.2\\workspace\\File\\"+fn); 
&lt;BR /&gt; BufferedReader in = new BufferedReader(new FileReader(filePath)); 
&lt;BR /&gt; String str; 
&lt;BR /&gt; String fileName=filePath.substring((filePath.lastIndexOf('\\')+1), filePath.lastIndexOf('.')); 
&lt;BR /&gt; 
&lt;BR /&gt; while ((str = in.readLine()) != null) { 
&lt;BR /&gt; break; 
&lt;BR /&gt; } 
&lt;BR /&gt; String Col[]=str.split("\\t"); 
&lt;BR /&gt; 
&lt;BR /&gt; StringBuilder sb = new StringBuilder("create table "+ fileName+"("); 
&lt;BR /&gt; for(int i = 0 ; i&amp;lt; Col.length ; i++){ 
&lt;BR /&gt; sb.append(Col 
&lt;I&gt;);&lt;BR /&gt; sb.append(" ");&lt;BR /&gt; sb.append("varchar(100)");&lt;BR /&gt; sb.append(",");&lt;BR /&gt; }&lt;BR /&gt; sb.delete(sb.lastIndexOf(","),sb.lastIndexOf(",")+1 );&lt;BR /&gt; sb.append("); ");&lt;BR /&gt; &lt;BR /&gt; BufferedWriter out = new BufferedWriter(new FileWriter("D:\\TOS-All-r12707-V2.3.2\\workspace\\File\\query.txt"));&lt;BR /&gt; out.write(sb.toString());&lt;BR /&gt; out.close();&lt;BR /&gt; &lt;BR /&gt; return sb.toString() ;&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; public static void main(String[] args) throws IOException {&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Hey shong and catounz once again thanks!!!&lt;BR /&gt;Today I will sleep happily!!! &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;bye&lt;BR /&gt;sangi&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154871i745D12675D304005/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCAL.png" alt="0683p000009MCAL.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MCSn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139974iEFC79CF01ED38184/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MCSn.png" alt="0683p000009MCSn.png" /&gt;&lt;/span&gt;&lt;/I&gt;</description>
      <pubDate>Fri, 13 Jun 2008 11:32:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Create-table-dynamically/m-p/2200955#M3252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-06-13T11:32:50Z</dc:date>
    </item>
  </channel>
</rss>

