<?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: Automating INPUT INTO in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/automating-input-into/qaa-p/13833260#M4864103</link>
    <description>&lt;P&gt;The INPUT statement is a dbisql[c] statement and cannot be used within the database server.&lt;/P&gt;
&lt;P&gt;But there are lots of ways of getting data into the database from a procedure or event: use &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/load-table-statement.html*d5e60024"&gt;LOAD TABLE ... FROM FILE&lt;/A&gt;, &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/xp-read-file-system-procedure.html*d5e89773"&gt;xp_read_file&lt;/A&gt;, &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/openxml-system-procedure.html*d5e1334"&gt;openxml( from file ... )&lt;/A&gt;, or even using &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbusage/accessrd-s-5562974.html*d5e40622"&gt;proxy 'directory' tables&lt;/A&gt;.  The exact method that you use will be dependent on the type of data that you want to import into the database.  If you were using INPUT from the client then I'd recommend that you start by looking at &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/load-table-statement.html*d5e60024"&gt;LOAD TABLE&lt;/A&gt; since it is the most similar to INPUT.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jan 2014 20:42:09 GMT</pubDate>
    <dc:creator>MarkCulp</dc:creator>
    <dc:date>2014-01-28T20:42:09Z</dc:date>
    <item>
      <title>Automating INPUT INTO</title>
      <link>https://community.sap.com/t5/technology-q-a/automating-input-into/qaq-p/13833259</link>
      <description>&lt;P&gt;SQL Anywhere 12.0.1 &lt;/P&gt;
&lt;P&gt;Is it possible to import data from file by using a scheduled Stored Procedure or Event?  I read in the manual that there are certain SQL statements that are not allowed in Procedures and Events, with INPUT being one of them.  But there must be some way to trigger the INPUT. &lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 19:51:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automating-input-into/qaq-p/13833259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-01-28T19:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Automating INPUT INTO</title>
      <link>https://community.sap.com/t5/technology-q-a/automating-input-into/qaa-p/13833260#M4864103</link>
      <description>&lt;P&gt;The INPUT statement is a dbisql[c] statement and cannot be used within the database server.&lt;/P&gt;
&lt;P&gt;But there are lots of ways of getting data into the database from a procedure or event: use &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/load-table-statement.html*d5e60024"&gt;LOAD TABLE ... FROM FILE&lt;/A&gt;, &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/xp-read-file-system-procedure.html*d5e89773"&gt;xp_read_file&lt;/A&gt;, &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/openxml-system-procedure.html*d5e1334"&gt;openxml( from file ... )&lt;/A&gt;, or even using &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbusage/accessrd-s-5562974.html*d5e40622"&gt;proxy 'directory' tables&lt;/A&gt;.  The exact method that you use will be dependent on the type of data that you want to import into the database.  If you were using INPUT from the client then I'd recommend that you start by looking at &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/load-table-statement.html*d5e60024"&gt;LOAD TABLE&lt;/A&gt; since it is the most similar to INPUT.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2014 20:42:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automating-input-into/qaa-p/13833260#M4864103</guid>
      <dc:creator>MarkCulp</dc:creator>
      <dc:date>2014-01-28T20:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Automating INPUT INTO</title>
      <link>https://community.sap.com/t5/technology-q-a/automating-input-into/qaa-p/13833261#M4864104</link>
      <description>&lt;P&gt;LOAD TABLE worked well from the procedure.  New problem is that in the table I am loading into I have created an autoinc pk field that is not in the source file I am loading from.  When I load the file in my pk field doesn't apply the autoinc sequence.  I turned off the autoinc to see what it was trying to populate and that field is getting a '0' for each row.  Below is the script. &lt;/P&gt;
&lt;P&gt;create table Data_Incoming
    (
     PK     bigint not null default autoincrement,
     a      long varchar,
     b      long varchar,
     c      long varchar,
     d      long varchar,
     e      double,
     f      long varchar,
     g      long varchar,
     constraint PK_IMPORT primary key (PK)
    );&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;GRANT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ALL&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ON&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Data_Incoming&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;dba&lt;/SPAN&gt; &lt;SPAN class="n"&gt;WITH&lt;/SPAN&gt; &lt;SPAN class="n"&gt;GRANT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;OPTION&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;COMMIT&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="n"&gt;LOAD&lt;/SPAN&gt; &lt;SPAN class="n"&gt;TABLE&lt;/SPAN&gt; &lt;SPAN class="n"&gt;Data_Incoming&lt;/SPAN&gt; 
&lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="n"&gt;a&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="n"&gt;b&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="n"&gt;c&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="n"&gt;d&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="n"&gt;e&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="n"&gt;g&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;)
    FROM 'C:\\directory\\File.csv' 
    SKIP 1
    FORMAT TEXT
    DELIMITED BY ',';&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 13:43:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automating-input-into/qaa-p/13833261#M4864104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-01-29T13:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Automating INPUT INTO</title>
      <link>https://community.sap.com/t5/technology-q-a/automating-input-into/qaa-p/13833262#M4864105</link>
      <description>&lt;P&gt;Try loading your data into a temporary table and then inserting the data from the temp table into your permanent table. Don't include the autoincrement column when doing the insert. E.g.&lt;/P&gt;
&lt;PRE&gt;create table mytab( i int default autoincrement, s long varchar );

create temporary table temptab( s long varchar );
load table temptab( s ) from 'c:\\somefilename.txt' ...other-options...;

insert into mytab( s ) select s from temptab;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jan 2014 13:48:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automating-input-into/qaa-p/13833262#M4864105</guid>
      <dc:creator>MarkCulp</dc:creator>
      <dc:date>2014-01-29T13:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Automating INPUT INTO</title>
      <link>https://community.sap.com/t5/technology-q-a/automating-input-into/qaa-p/13833263#M4864106</link>
      <description>&lt;P&gt;Worked perfect.  Thanks much&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2014 14:34:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/automating-input-into/qaa-p/13833263#M4864106</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-01-29T14:34:47Z</dc:date>
    </item>
  </channel>
</rss>

