Export database to txt

Wilchard

New Member
hello there,

First i'm a complete noob when it comes to Progress. I've search the internet and find several solutions but for some reason i can't get it to work.

The problem is that we run several progress databases (9.1) and i need to extract the data to text.

When i ran this code;

OUTPUT TO c:\dump\prbjgz.txt.
FOR EACH kind NO-LOCK:
EXPORT kind.
END.
OUTPUT CLOSE.

i get an error saying that it is an unknown or non-unique tabelname. tried everything, but nothing worked. Is it the location of the .p file?

Any help would be appreciated.

Thanks in advance
 

tamhas

ProgressTalk.com Sponsor
That message suggests that there is no table in your database with the name "kind" or that there is more than one table whose first four letters are those.

Did you try the dictionary dump? That's text. It has a special trailer on it, also text, but you can always delete that.
 

Wilchard

New Member
Thanks for the response tamhas,

The database is called prbttx, the owner pub (i think that's the owner) and there is only one table named kind.

Is there a commandline to run the procedure? I mean how is the right table from the right database extracted? In the mentioned procedure there is no databasename.

Thanks in advance.
 

tamhas

ProgressTalk.com Sponsor
Database name is irrelevant unless you are connected to more than one.

Owner is a SQL concept and is irrelevant to an ABL procedure.

Since you are trying to compile a program, presumably you have some kind of development license. Go to data administration either from a shortcut or from Tools in the editor and look at what you see there for tables. There is a dump tool there which will allow you to just point to it, no code. The dump will have a special trailer, which you can delete or ignore, but will otherwise be comma-separated values with quoted strings.
 

D.Cook

Member
Sounds like your Procedure Editor session is not connected to a database.
To connect to the database, either create a shortcut to Progress with the relevant database connection parameters (-db) or click Tools>Data Administration then Database>Connect and use the following dialog box.
From here you can use the data dump tool (Admin>Dump Data and Definitions>Table Contents as Tamhas suggested, or close the Data Administration window and run your procedure.
 

Wilchard

New Member
Thanks,

The thing is i want to dump the database to text every week to import it in SQLServer (with odbc i often get errors about fields that have been filled with more characters then the fieldlength is). So i need a procedure i can schedule. The mentioned code is simple (i like that), but i believe it needs a startup parameter to connect to the right db.
 

tamhas

ProgressTalk.com Sponsor
Your ODBC problem is easily fixed with dbtool, which has an option to scan the database and adjust the SQL Width to correspond to the data actually in the fields.

If you don't have documentation, go to PSDN and read it there.
 

Wilchard

New Member
Don't want to use odbc. I have to create users, create a dedicated broker etc. I don't have the expertise to do this.

I just want to dump several tables to txt once a week. So the only thing i need is a commandline to do this which i can schedule. Is this possible in progress?
 

tamhas

ProgressTalk.com Sponsor
Sure. I think you have been given the direction you need. Have you tried any of it?
 
Top