How to read a csv file in Pervasive?
How to read a csv file in Pervasive?
(OP)
Hello,
I have a project where we have a csv with two columns of data. This will be run from a task so I don't want to have to manually import the data each time it runs. I need to read the file, update a column in a table (with the first column value in the csv) based on the value in column 2 of the csv. I thought maybe I could just read the file in pervasive SQL but I think it would have to load into a temp table or a table I create for this purpose. The problem is, idk how to read in the file. I thought the sql command below would work based on the MYSQL documentation but I can't actually find documentation for LOAD DATA for PSQL. Is this not possible in PSQL?
Queries I've tried:
LOAD DATA INFILE 'file_path.csv'
LOAD DATA LOCAL INFILE 'file_path.csv'
The error I get is SQL ENGINE SYnatx Error: LOAD <<???>>> DATA
EDIT:
I found the bdu utility but that hasn't helped yet. I get an error 3392: Cannot open DBNAMES.CFG file
EDIT 2:
I found that you have to run BDU from the server not the client so I was able to import from csv. Is there another way or is this the only way other than the import wizard?
I have a project where we have a csv with two columns of data. This will be run from a task so I don't want to have to manually import the data each time it runs. I need to read the file, update a column in a table (with the first column value in the csv) based on the value in column 2 of the csv. I thought maybe I could just read the file in pervasive SQL but I think it would have to load into a temp table or a table I create for this purpose. The problem is, idk how to read in the file. I thought the sql command below would work based on the MYSQL documentation but I can't actually find documentation for LOAD DATA for PSQL. Is this not possible in PSQL?
Queries I've tried:
LOAD DATA INFILE 'file_path.csv'
LOAD DATA LOCAL INFILE 'file_path.csv'
The error I get is SQL ENGINE SYnatx Error: LOAD <<???>>> DATA
EDIT:
I found the bdu utility but that hasn't helped yet. I get an error 3392: Cannot open DBNAMES.CFG file
EDIT 2:
I found that you have to run BDU from the server not the client so I was able to import from csv. Is there another way or is this the only way other than the import wizard?
RE: How to read a csv file in Pervasive?
What is the command line you are using for the BDU. BDU must be run where the Pervasive engine is running. If you are running it on the client, you will get the "error 3392: Cannot open DBNAMES.CFG file" message.
An example command for BDU would be:
CODE
The documentation for BDU in Zen v15 is at https://docs.actian.com/zen/v15/#page/uguide/uguid....
Mirtheil
http://www.mirtheil.com