If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Loading Informix from Windows text file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-11, 15:24
tale103108 tale103108 is offline
Registered User
 
Join Date: Apr 2011
Posts: 2
Loading Informix from Windows text file

I need to know the complete syntax for the LOAD command on Informix when used with a Windows file. In particular, I need the full pathname of the data file when used with the LOAD command.

I have

LOAD FROM 'C:\My directory\My data\mytable.unl' INSERT INTO mytable;

but I get a syntax error

[Error Code: -201, SQL State: 42000] A syntax error has occurred.

---- Environment ----
O/S: WindowsXP 32-bit
DB : Informix (IDS) 11.70.TC3DE
JDBC: 3.50.JC9
----

Cheers!

Reply With Quote
  #2 (permalink)  
Old 10-13-11, 15:09
CheeseConQueso CheeseConQueso is offline
Registered User
 
Join Date: Oct 2011
Posts: 1
loading into informix

try it without quotes around the path?

double quotes instead of single quotes around path?

if you can, change file location to somewhere without spaces in path directory - like c:\temp and try again

also, i think the data HAS to be delimited with the pipe char - "|"
Reply With Quote
  #3 (permalink)  
Old 10-14-11, 09:08
mjldba mjldba is offline
Registered User
 
Join Date: Dec 2003
Location: North America
Posts: 139
Piping symbol "|" is the default delimiter but I always state that explicitely in the UNLOAD and LOAD statements just to be sure.

I work in an AIX environment and I don't think quotes, single or otherwise, are required for the LOAD / UNLOAD file name or path but (again) I've always used double quotes out of habit just to be sure.
Reply With Quote
  #4 (permalink)  
Old 10-14-11, 14:13
douglawry douglawry is offline
Registered User
 
Join Date: Feb 2011
Location: London
Posts: 6
LOAD is not a SQL command but is implemented in the client by "dbaccess" and Server Studio, so will not work via JDBC. On Unix/Linux, you can create a stored procedure containing:

SYSTEM 'echo LOAD FROM "filename" INSERT INTO tablename | dbaccess databasename';

You could do something similar with a DOS command or batch file on Windows.

Regards,
Doug Lawry
www.oninitgroup.com
Reply With Quote
Reply

Tags
load informix windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On