Austin
Austin

Reputation: 1255

How to create/drop a table in Progress OpenEdge using ABL?

I am just wondering if there is a way to create and drop a table (NOT a temp-table) using ABL code. I know to create/drop tables via Data Dictionary tool. Also, I found that there is a way to create a table (by loading a .df file) using prodict/load_df.p. But I am looking for statements like "CREATE TABLE" and "DROP TABLE" in ABL.

Upvotes: 0

Views: 3308

Answers (4)

Andrew
Andrew

Reputation: 11

If you are creating and deleting tables in a single session then, maybe, you should be using temp-tables.

Upvotes: 1

I would create a df file, then load it using

RUN prodict/load_df.p(INPUT DfFile).

Thus you can alter you schema. Nevertheless I did not test it and do not know if this would work with served databases (versus single user connection).

Upvotes: 0

TheMadDBA
TheMadDBA

Reputation: 436

Like Tom says there is no way to do this from the ABL/4GL. You can always use code to generate the DF file for the adds/drops.

Keep in mind that you are not going to be able to do most of the schema changes with users connected to the database. Progress doesn't treat schema changes the same way as Oracle,DB2,etc.

There is a different storage pool and rules for ABL/4GL created tables and SQL created tables.

Upvotes: 0

Tom Bascom
Tom Bascom

Reputation: 14020

There are no such statements.

In theory you could simply use CREATE _FILE and the ilk but the details are undocumented and if you mess it up you would be in a world of hurt.

The supported method is to call the data dictionary APIs (load a .df file as you've already found).

Upvotes: 1

Related Questions