-1

I'm trying to use the openedge jdbc connector to pull data from an existing progress db but im having column width issues.

As I know already about dBtool option to fix the width. I need to call this dBtool by the 4gl script.

All the input values must be defined in the script.

Is it possible to do? If it is yes, Please provide me a sample script to do this

Maha
  • 19
  • 1
  • 10

1 Answers1

1

Here's an example from the official knowledge base (see link below for complete description).

========== PROGRAM LISTING FOLLOWS ==============

FOR EACH _file NO-LOCK WHERE _Tbl-Type = "T":
    OUTPUT TO Value("input.txt").
    /* SQL Width Scan wFix Option. */
        PUT UNFORMATTED "9~n2~n1~n20~n" + STRING (_file-number) + "~n0".
    OUTPUT CLOSE.
    OS-COMMAND SILENT VALUE ("dbtool Sports2000 < input.txt").
    OS-RENAME VALUE ("dbtool.out") value ("dbtool_" + _file-name).
END.

========= example of the input file created by the above script  =======
9
2
1
20
20
0

========= example output for a single table ===========

Total records read: 0
SQLWidth errors found: 0, Date errors found: 0
SQLWidth errors fixed: 0

See complete example and better description in the Progress Knowledgebase

Jensd
  • 7,886
  • 2
  • 28
  • 37
  • -1, link only answer. At minimum quote the most important information that actually answers the question in your answer. – Mark Rotteveel Feb 28 '14 at 07:24
  • This script works. I'm not quite sure that where it is outputting to.I checked the C:/ Temp and Pro path. And also, I searched it by the dbtool keyword. I could find any file. Please advise. – Maha Mar 02 '14 at 22:54
  • Search your file system for input.txt but it should be in some kind of working directory. – Jensd Mar 03 '14 at 07:40
  • I tried it this script. it is kind of work. It exported the parameter file input.txt but it did not export out the dbtool.out files. Please advise – Maha Mar 05 '14 at 00:39
  • This row OS-RENAME VALUE ("dbtool.out") value ("dbtool_" + _file-name) renames the file from dbtool.out to dbtoo_file-name where _file-name is the name of your table. – Jensd Mar 05 '14 at 07:10