cancel
Showing results for 
Search instead for 
Did you mean: 

LOAD TABLE syntax

robert_kratschmann
Participant
0 Kudos
137

SQL Anywhere 17.0.11.7908 on Windows 11.
Loading local data into a local database. Data (u.txt) contains:

1;AAAAA
2;BBBBB
3;CCCCC
1;DDDDD
4;EEEEE

Using ALLOW ALL ERRORS works fine (four loaded rows with c1=1,2,3,4):

create table t1 (c1 int primary key,c2 varchar(20));
load table t1 (c1,c2) using file 'd:\\u.txt' allow all errors delimited by ';';

Trying the ROW LOG or MESSAGE LOG clause (or both clauses) allways leads into a syntax error:

load table t1 (c1,c2) using file 'd:\\u.txt' allow all errors row log 'd:\\r.lg' delimited by ';';
Syntax error near 'd:\r.lg' on line 1
SQLCODE=-131, ODBC 3-Status="42000"
load table t1 (c1,c2) using file 'd:\\u.txt' allow all errors message log 'd:\\m.lg' delimited by ';'
Syntax error near 'd:\m.lg' on line 1
SQLCODE=-131, ODBC 3-Status="42000"

What I'm doing wrong?

Thanks

Robert

Accepted Solutions (1)

Accepted Solutions (1)

chris_keating
Product and Topic Expert
Product and Topic Expert

The syntax for ROW LOG is 

| ROW LOG log-target
log-target : {
FILE server-filename
| CLIENT FILE client-filename
| VARIABLE variable-name
}

You are missing FILE or CLIENT FILE ( or VARIABLE) in your statement.  See line 4 below:

load table t1 (c1,c2) 
    using file 'd:\\u.txt' 
    allow all errors 
    row log file 'd:\\r.lg' 
    delimited by ';'

 

robert_kratschmann
Participant
0 Kudos
Thanks, I see ....
robert_kratschmann
Participant
0 Kudos

The SAP Help page for the LOAD TABLE statement shows a lot of empty space.
I have a large monitor, but I always overlook the "log-target" documentation.
Thanks,
Robert

chris_keating
Product and Topic Expert
Product and Topic Expert
0 Kudos
You can provide feedback on documentation directly on SAP Help when logged in. I will pass your comment on to the UX team. I note that the white space appears consistent on the page but certainly it is easy to miss this option given the amount of content (include whitespace) from the ROW LOG to the log-target information. An example might also be helpful.

Answers (0)