×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I'm trying to write a wrapper to run the python module dbtoxlsx ( which
I've modified to format Dates / Times / Timestamps )
It's working ok but I notice that after I have executed the program, any
attempt to run STRSQL results in error:
Message ID . . . . . . : SQL6141 Severity . . . . . . . : 30
Message type . . . . . : Information
Date sent . . . . . . : 30/08/18 Time sent . . . . . . : 09:11:51
Message . . . . : Cannot use interactive SQL now.
Cause . . . . . : Interactive SQL cannot be used now, for one of the
following reasons:
-- The library, QRECOVERY, which is used by interactive SQL for saving
and either recovering or resuming the session, does not exist on your
system.
-- The job is in SQL server mode, which is not allowed for interactive
SQL.
My assumption is that I'm falling foul of the latter ( Job is in SQL server
mode ) and that this has occurred because the python module dbtoxlsx.py has
used the ibm_db_dbi module to connect to the database. ( Like, I said -
this is an assumption, based on the fact that that module uses SQL and my
quick test running a python program which didn't connect to the database
did not cause the issue )
I believe from the documentation that it's not possible to switch out of
SQL server mode:
- *Within a single job, CLI allows for a one time switch from non-server
mode to server mode. As discussed earlier, it does not allow an application
to switch from running in server mode to non-server mode.*
I am running the python via a call to QP2Shell, which I understand runs a
PASE program directly in the current job.
In another small application I used a python module from RPG to pretty
print some JSON and I did this from RPGLE by using the 'system' api to run
the QSH command to run the python, which seems a bit convoluted but worked
fine and I can run STRSQL in that job afterwards.
I believe that QSH spawns a child job.
So, this leaves me wondering what the best way is to wrapper the
dbtoxlsx.py call so that it can be invoked from CL and/or RPG programs. I
don't want to render the current job unable to use STRSQL once dbtoxlsx has
been invoked.
Any thoughts / suggestions gratefully accepted
best regards,
Craig
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.