Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9091

sql anywhere 11 input from file problem

$
0
0

I tried following the syntax in the Sybooks online documentation but

Could not execute statement.

Syntax error near 'input' on line 11

SQLCODE=-131, ODBC 3 State="42000"

Line 1, column 1

 

begin

 

create table #T

        ("Currency" VARCHAR(4) NOT NULL,

        "Cnv_dt" DATE NOT NULL,

        "Cnv_Rate" DECIMAL(10,4) NOT NULL,

        "NoonRate" DECIMAL(10,4) NULL

        ,CONSTRAINT  PRIMARY KEY ( "Currency" ASC, "Cnv_dt" ASC )

    );

 

input into #T

--("Currency",       /// also tried with column name

--        "Cnv_dt" ,

--        "Cnv_Rate" ,

--        "NoonRate"

--    )

    delimited by '\t' escapes off format text

    from '%tmp%\BocXchgRate.txt' nostrip  // also tried somehting like form c:\\\users\\me\\appdata\\tmp\\BocXchgRate.txt no strip

    ;

 

select * from #T;

 

end

 

 

what mistake did I make causing ODBC error?

I did not write the ODBC "USING connection-string FROM source-table-name" clause

 

I tried  also

input into #T     by order

    delimited by '    ' escapes off format text

    from C:\\Users\\g2\\AppData\\Local\\Temp\\BocXchgRate.txt nostrip

    ;

I also tried prompt in place of from ...


Viewing all articles
Browse latest Browse all 9091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>