ibm-midrange

Using SQL with IBM_DB connector in Python

一个人想着一个人 提交于 2019-12-12 16:34:15
问题 Has anyone used the ibm_db package with IBM's Python for PASE to update Db2 files on IBM i (formerly AS/400)? I want to use Python scripts (from QSH) to update the Db2 database. My purpose is to populate values at runtime and update the fields of Db2 files. It works with static (hardcoded) values, but not dynamic ones. Here is what I am trying, but it is not working: import ibm_db c1 = ibm_db.connect('*LOCAL','userid','password') sql = """INSERT INTO TEMPLIB.TEMPPF (TYPE, DRPARTY, CRPARTY,

Oracle: Set Query Timeout

一曲冷凌霜 提交于 2019-12-12 11:54:45
问题 i have a PL/SQL program which do a query to an AS400 database through Transparent Gateway. Sometimes the AS400 not responds to the query (may be network problems )and the PL/SQL program hangs. Is there any method to set a timeout to the Oracle query so that when certain amount of time passes an exception is risen? 回答1: Have you tried setting the HS_FDS_CONNECT_PROPERTIES parameter in the AS400 Transparent Gateway initialisation file? For a timeout of 2 minutes: HS_FDS_CONNECT_PROPERTIES=

Speeding Up Queries with LINQ

梦想与她 提交于 2019-12-12 11:30:24
问题 I am transferring about 350 rows (with some data collection) from a MS SQL Server to the iSeries for processing. I feel the process is too slow which is about a minute or so. I am doing all of the MS SQL stuff in LINQ2SQL. Here is the basics of what I am doing currently: Collect all of the vehicle master data to process one-at-a-time. SUM() Fuel usage by vehicle SUM() Oil usage by vehicle SUM() Parts used by vehicle SUM() Labor by vehicle SUM() Outside Repairs by vehicle SUM() Accident Costs

Using cursor for multiple search conditions

故事扮演 提交于 2019-12-12 10:27:35
问题 To begin with I want to apologise for my bad english and it's possible that I miss some crucial information for you guys. Anyways. I am developing a display file with a subfile to show some records. It works like a charm when showing one select but now i want to develop a search-function for the users. So when the user enters different search-conditions the select will change and the cursor must somehow update with the new select. I am ripping my hair off, I really can't get this to work. I

NHibernate - Why does Delete() call fail to delete but delete through HQL works?

爷,独闯天下 提交于 2019-12-12 09:29:12
问题 Considering the following code blocks, why does call to HQL work but call to delete() not work? As a background, I'm using NHibernate over IBM.Data.DB2.Iseries driver. Come to find out, journaling on the AS400 is turned off so I can't use transactions. I'm not the AS400 admin or know anything about it so I don't know if having journaling turned off (not opening transactions) is causing this problem or not. Do I absolutely need the ability to open transactions if I'm calling Delete() or other

Why aren't connections being reused in my iSeries/ASP.NET MVC 4 app?

为君一笑 提交于 2019-12-12 08:21:31
问题 We are running an MVC 4 web application on a Windows 2008 server farm. We have been trying to upgrade our server farm to Windows 2008 R2 64-bit servers but have run into an issue with connection pooling on an iSeries (running V7R1). We frequently call DB2 java stored procedures and have enabled connection pooling to reduce the time it takes to establish connections. Below is an example of the connection string we’re using. <add name="DB2" connectionString="ConnectionTimeout=45;Pooling=true

SQL - Merge two tables with one common field

…衆ロ難τιáo~ 提交于 2019-12-12 06:45:00
问题 I've searched and searched but can't quite find what I'm looking for. I'm not totally inept when it comes to SQL but this is beyond me. So I have two table with one common field. Table - LName Feild Name Table - Descripion Field Name Field Add Field Job Now, table LName has just the one field and it is populated. Table Description has data in all fields except the 'Name' field. I need to put the data from Field 'Name' in table LName into Field 'Name' in table Description. Either that or merge

How to get IPv4 Connection Status to JAVA (JT400) Application

只愿长相守 提交于 2019-12-12 05:16:57
问题 I want to know how to get IPv4 Connection Status to java application Work with IPv4 Connection Status System: V172172 Type options, press Enter. 3=Enable debug 4=End 5=Display details 6=Disable debug 8=Display jobs Remote Remote Local Opt Address Port Port Idle Time State * * ftp-con > 092:54:32 Listen * * ssh 092:25:07 Listen * * telnet 000:01:20 Listen * * smtp 092:25:36 Listen * * netbios > 092:25:36 Listen * * netbios > 000:00:01 *UDP * * netbios > 000:00:01 *UDP * * netbios > 092:25:32

AS400 RPGLE/free dynamic variables in operations

别说谁变了你拦得住时间么 提交于 2019-12-12 03:49:10
问题 I'm fairly certain after years of searching that this is not possible, but I'll ask anyway. The question is whether it's possible to use a dynamic variable in an operation when you don't know the field name. For example, I have a data structure that contains a few hundred fields. The operator selects one of those fields and the program needs to know what data resides in the field from the data structure passed. So we'll say that there are 100 fields, and field50 is what the operator chose to

DB2 - Argument 02 of function TRANSLATE not valid

走远了吗. 提交于 2019-12-12 03:46:58
问题 I am having some issues converting a string (yyyymmddhhiiss) to a date using TRANSLATE. If I use a string directly then it works perfectly fine, but when i use a field of exactly same datatype, varchar(14), then it throws the error from the title. Here is a basic example of what i am trying to do: WITH test_table AS ( SELECT '20160101123059' AS d FROM SYSIBM.SYSDUMMY1 ) SELECT d , translate('ABCD-EF-GH IJ:KL:MN', d, 'ABCDEFGHIJKLMN') , translate('ABCD-EF-GH IJ:KL:MN', '20160101123059',