Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: connecting to INFORMIX-SE  (Read 9539 times)
Paul M.
Posts: 13


« on: June 01, 2021, 07:55:26 pm »

I am working on utilities for an old INFORMIX-SE databse we have.  I can get the program running through BDL on both LINUX and win2016, but when I try to run it through GAS, the system appears to ignore the fglprofile and says it cannot connect to dbmdefault.

The DB resides on an old Unixware7 box.

my code looks like this.
call FGL_SETENV("FGLSQLDEBUG","2")
  let hbinfdir = FGL_GETENV("INFORMIXDIR")
  if hbinfdir is null then
    call FGL_SETENV("INFORMIXDIR","/Program Files/Informix Client-SDK")
  end if
  call FGL_SETENV("DBPATH","/data/peigms/data")
  call FGL_SETENV("DBTEMP","/tmp")
  call FGL_SETENV("INFORMIXSERVER","pei_data")
  connect to "acis"

my FGLPROFILE has the following:
dbi.database.acis.source = "acis"
dbi.database.acis.driver = "dbmifx"

I compile the code and deploy through an archive with fglgar

I have tried both 32bit and 64 bit 4.10 INFORMIX cSDKs. as well as the dbmifx_9 driver

Any help would be appreciated.
Laurent G.
Four Js
Posts: 110


« Reply #1 on: June 02, 2021, 12:55:09 am »

Paul,

What version of GAS are you using?

Have you made your changes in $FGLDIR/etc/fglprofile or your own custom one set by $FGLPROFILE?

You might need to explicitly add the setting for FGLPROFILE by for example adding an extra resource named 'res.fglprofile' for example.

I would set full logs for GAS and look at the proxy one for the session for the list of environment variables, especially FGLPROFILE
Also, in the vm-* log for your session, what is the exact error message you are getting

Laurent
Paul M.
Posts: 13


« Reply #2 on: June 02, 2021, 05:27:08 pm »

vm- file
SQL: CONNECT TO "acis" USER "aims" USING "***"
 | 4gl source      : multiemails.4gl line=34
 | loading driver  : [C:\4js\fgl\dbdrivers\dbmifx_9]
 | Dynamic linker error: [The specified module could not be found]...
 | loading driver  : [C:\4js\fgl\dbdrivers\dbmifx_9]
 | Dynamic linker error: [The specified module could not be found]...
Program stopped at 'multiemails.4gl', line number 34.
SQL statement error number -6366 (0).
Could not load database driver dbmifx_9. Set FGLSQLDEBUG to get more details.

This is  the FGLPROFILE lines.
dbi.default.driver = "dbmifx_9"
dbi.database.acis.source = "acis"
dbi.database.acis.driver = "dbmifx"

IT is almost as it the system does not recognize dbi.database.acis.source = "acis" as a valid entry or else it should be trying to load dbmifx

I have added all these to the .xcf file
    <ENVIRONMENT_VARIABLE Id="FGLSQLDEBUG">3</ENVIRONMENT_VARIABLE>
    <ENVIRONMENT_VARIABLE Id="LD_LIBRARY_PATH">C:\Program Files\Informix Client-SDK\lib</ENVIRONMENT_VARIABLE>
    <ENVIRONMENT_VARIABLE Id="INFORMIXDIR">C:\Program Files\Informix Client-SDK</ENVIRONMENT_VARIABLE>
    <ENVIRONMENT_VARIABLE Id="FGLPROFILE">C:\4js\fgl\etc\fglprofile</ENVIRONMENT_VARIABLE>
    <ENVIRONMENT_VARIABLE Id="DBPATH">/data/peigms/data</ENVIRONMENT_VARIABLE>
    <ENVIRONMENT_VARIABLE Id="DBTEMP">/tmp</ENVIRONMENT_VARIABLE>
    <ENVIRONMENT_VARIABLE Id="INFORMIXSERVER">pei_data</ENVIRONMENT_VARIABLE>

Sebastien F.
Four Js
Posts: 509


« Reply #3 on: June 02, 2021, 05:41:36 pm »

This error and FGLSQLDEBUG output indicates that the dbmifx_9 DLL could not be loaded.

This is usually because the Informix env settings are wrong, or because the ODI driver name is misspelled.

I see LD_LIBRARY_PATH in your .xcf settings, which is Unix env var.

Consider using PATH on MS Windows.

For such issues you should rather contact your support center.

Seb
Reuben B.
Four Js
Posts: 1047


« Reply #4 on: June 03, 2021, 01:25:21 am »

Paul,

This type of issue is one we see all too often.  I tried to write an Ask-Reuben article about it https://4js.com/ask-reuben/ig-44/ but I probably tried to say too much in the article.

The issue is you can run something at the command line but you can't from GAS or GST.  GAS or GST doesn't do anything magic, deep down it is running a command from a directory within an environment, and so deep down you will find that an environment variable is not what you think it is, or it is because you are in a different directory, or a different process owner with different permissions.  It is a case of 1) identifying this difference and 2) making the appropriate change in the GAS/GST config

In your case I'd be looking at environment variable so add the equivalent of a RUN "env | sort > /tmp/filename.env" to your code and run your program from the command line where you say it works and then from GAS where it does't work, and identify any differences in the environment by doing a diff on the result .env files.

With GAS normally the culprit is the database environment varibles INFORMIXDIR, INFORMIXSERVER, LD_LIBRARY_PATH (Unix) / PATH (Windows) etc have not been set appropriately in the .xcf http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/t_fgl_odiagifx_006.html.  They are either blank or are the values that happen to be in the environment when the dispatcher/Studio happens to be launched.

If you don't think FGLPROFILE is being read, then the value of FGLPROFILE will be different or if you are not setting it explicitly FGLDIR might be different.  You can also use in your code FGL_GETRESOURCE to see what values are being read from FGLPROFILE http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_BuiltInFunctions_FGL_GETRESOURCE.html

Hope that helps,

Reuben



Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Paul M.
Posts: 13


« Reply #5 on: June 03, 2021, 09:45:34 pm »

Thanks everyone who assisted.  Each answer was a missing piece.  My .xcf file now has:
    <ENVIRONMENT_VARIABLE Id="PATH">C:\Program Files\Informix Client-SDK\bin</ENVIRONMENT_VARIABLE>
    <ENVIRONMENT_VARIABLE Id="INFORMIXSERVER">pei_data</ENVIRONMENT_VARIABLE>
    <ENVIRONMENT_VARIABLE Id="DBPATH">/data</ENVIRONMENT_VARIABLE>
    <ENVIRONMENT_VARIABLE Id="DBTEMP">/tmp</ENVIRONMENT_VARIABLE>

and I can now connect to the INFORMIX-SE database.  Incidentally, I did try and succeed with the dmbodb driver, but it was noticeably slower.
Reuben B.
Four Js
Posts: 1047


« Reply #6 on: June 03, 2021, 11:58:31 pm »

You will probably find you need more in PATH.  How will the O/S know where to find fglrun or anything executed by RUN or base.Channel ?

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Sebastien F.
Four Js
Posts: 509


« Reply #7 on: June 04, 2021, 08:45:10 am »

Paul,

Quote
Incidentally, I did try and succeed with the dmbodb driver, but it was noticeably slower.

I guess you mean the dbmodc (Generic ODBC driver)

This ODI driver is provided to access database brands for which we don't have a specific ODI driver.
It can be used for very basic SELECT/INSERT/UPDATE/DELETE SQL, but does not have all features of other ODI drivers.
It supports only a few FGL/SQL data types and as zero Informix SQL emulations.

Always use specific ODI drivers for the database brands supported by Genero.
These use the native client API directly (no intermediate software like unixODBC), and are optimized for the target DB engine.
Informix dbmifx ODI driver is based on ESQL/C.

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_Connections_009.html

Seb
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines