0

Hello I'm trying to connect to a Universe DB with ODBC. I have successfully imported some data into access for most of the tables. (I'm using access just to look at the data and get a general idea of everything)

There are a few tables that will not import due to precision errors.

I'm just starting out with this database type so I'm fairly new to all this. Although I do have past AS/400 (DB2) experience back in the day. The dictionary files remind me of that a bit.

Anyways the problem is a with a field with amounts in it. It works fine unless the amount is greater then 999.99 then I get an error about the field being too small. Apparently ODBC is assuming the field is precision of 5 with 2 decimal places. I looked at the dictionary file and as far as I can tell the field is set to 10R with a conversion code of MR2 which seems like it should be adequate.

Where do I set this in Universe so that ODBC knows it is larger then that.

Thanks for any help.

Update::: I was looking at wrong field the output format of the field I need in the dictionary is actually 7R. If that makes any difference.

1 Answers1

0

Try setting attribute 6 in your dictionary entry to DECIMAL then run HS.UPDATE.FILEINFO at TCL:

>ED DICT MYFILE I.PAY
10 lines long.

----: 6
0006:
----: R DECIMAL
0006: DECIMAL
----: FI

Check out Rocket's ODBC documentation (page 75-76) for how to optionally set custom precision and scale in the dictionary entry for the DECIMAL SQL Data Type.

webthaumaturge
  • 1,198
  • 1
  • 11
  • 23
  • 1
    That gives me an error about MR2 conversion not working on an Integer type. I found a document finally that lays out the dictionary file attributes that seems to be helpful. I'm worried removing the conversion code will mess with the program that is using the database? – user2956601 Nov 05 '13 at 19:33
  • I think Basically webthaumaturge is pointing me in the right direction. I'm wary of changing to much because I'm not 100% familar how the software system is accessing these files so I'm afraid a change will break something. They offer a web based reporting tool that seems to work. Although it is a bit clunky. So I will attempt to use that. But I think If I added the SQL type and removed the conversion code it would work. – user2956601 Nov 05 '13 at 21:10
  • 1
    @user2956601, you can copy the dictionary item to a new name and change that one instead if you are worried about breaking existing code. – Dan McGrath Nov 05 '13 at 22:56