ibm-midrange

SQL query of multi-member file on AS400

烂漫一生 提交于 2019-12-18 11:22:40
问题 On AS400 in interactive SQL in a 5250 session, select * from myfile returns rows from one member only when myfile has more than one member. How can I get rows from a specific member? Important: in the end I'd like to do this over JDBC with jt400 so really I want a solution that'll work there. Thanks. 回答1: You can create an alias using the create alias command: CREATE ALIAS myLibrary/myAlias FOR memberLibrary/memberFile(memberName) This will allow you to run sql against that member using the

AS400 SQL query with Parameter

梦想的初衷 提交于 2019-12-18 09:13:22
问题 I am testing a simple query to get data from an AS400 database. I am not sure if the way I am using the SQL query is correct. I get an error: "The parameter is incorrect." Select FIELD1, FIELD2 From Mylibrary.MyTable WHERE FIELD1 = @Field1 I don't get an error when I run the following query: Select FIELD1, FIELD2 From Mylibrary.MyTable WHERE FIELD1 = 'myvalue' I am using ADODB, VBScript to test. Set Param1 = cmd.CreateParameter("@Field1", 129, 1, 9, "myvalue") ' 129 String cmd.Parameters

AS400 SQL query with Parameter

放肆的年华 提交于 2019-12-18 09:13:02
问题 I am testing a simple query to get data from an AS400 database. I am not sure if the way I am using the SQL query is correct. I get an error: "The parameter is incorrect." Select FIELD1, FIELD2 From Mylibrary.MyTable WHERE FIELD1 = @Field1 I don't get an error when I run the following query: Select FIELD1, FIELD2 From Mylibrary.MyTable WHERE FIELD1 = 'myvalue' I am using ADODB, VBScript to test. Set Param1 = cmd.CreateParameter("@Field1", 129, 1, 9, "myvalue") ' 129 String cmd.Parameters

Connecting to an IBM AS/400 DB2 Database

最后都变了- 提交于 2019-12-18 04:26:30
问题 I'm trying to connect to a client's IBM AS/400 DB2 Database from an Ubuntu Server using PHP's ODBC Driver . I have the unixODBC installed as well. My odbcinst.ini looks like this: [IBM DB2 ODBC DRIVER] Description = ODBC 5.1 Driver for Database Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so FileUsage = 1 And my odbc.ini looks like this: [IBM DB2 ODBC DRIVER] Driver = IBM DB2 ODBC DRIVER Description = ODBC 5.1 Driver DSN Now, my code to connect is: $server = '12.345.678.90' //IP $port =

Accessing RPG on iSeries from Java

早过忘川 提交于 2019-12-18 04:22:00
问题 Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramCallBeans (either through PCML or xPCML), talking to the DataQueues (for asynchronous comms), or even JNI. I'm looking for something that's robust, performant, quick to develop,

PHP/Linux to AS/400-db2

对着背影说爱祢 提交于 2019-12-17 19:09:37
问题 I am trying to get php on Linux Centos server access as/400 (iSeries) db2 database. I am using this IBM guide as much as possible, (though we could not get GUI configuration utility working.) http://www-03.ibm.com/systems/i/soft...ide/index.html I downloaded and successfully installed iSeriesAccess drivers and pre-requisites. rpm -i iSeriesAccess-5.4.0-1.6.i386.rpm I have configured these files to define drivers/DNS: /etc/odbc.ini and /etc/odbcinst.ini [iSeries Access ODBC Driver] Description

Select one row per index value with max column value

自闭症网瘾萝莉.ら 提交于 2019-12-17 14:55:06
问题 With a table setup with the following fields: SKU, EVENTSTARTDATE, EVENTENDDATE, PRICE, (...etc...) and housing thousands of rows here is example data (dates are YYMMDD, century code excluded): 1111111, 101224, 101231, 10.99 1111111, 110208, 110220, 9.99 1111111, 110301, 110331, 8.99 2222222, 101112, 101128, 15.99 2222222, 101201, 110102, 14.99 etc I'd like to have a SELECT statement return one row per SKU with the maximum EVENTSTARTDATE without having a WHERE clause isolating a specific SKU

Error SQL7008 while updating a DB2 for iSeries table

白昼怎懂夜的黑 提交于 2019-12-14 03:54:23
问题 I have a Java Web application using Hibernate and DB2 for iSeries and during update of a table I get he following error:- Error SQL7008 while updating a DB2 for iSeries table 回答1: From doing some googling on this error message I noticed that it happens when you are running an insert/update in a non-transactional mode. The explanation is given here. This occurs because the table you are trying to update is not being journalled, and your update is being run within a transaction. Generally, you

automate iseries navigator generate sql command

寵の児 提交于 2019-12-14 02:33:56
问题 I occasionally use iseries navigators "generate sql" to convert out DDS objects into sql code. Is there a way to automate this? or perhaps a green screen equivalent command? what I'm really after is a way to translate a keyed logical file into a set of sql indexes. 回答1: You want to use the Generate Data Definition Language (QSQGNDDL) API... http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/apis/qsqgnddl.htm There's at least two published utilities that use this API. http://www

On DB2 for i, Search for Column, return table names in list form

ⅰ亾dé卋堺 提交于 2019-12-14 01:22:20
问题 I'm still a bit of a noob, so pardon if this question is a bit obvious. I did search for an answer but either couldn't understand how the answers I found applied, or simply couldn't find an answer. I have a massive database housed on a DB2 for i server which I'm accessing using SQL through SQLExplorer (based on Squirrel SQL). The tables are very poorly documented and the first order of business is figuring out how to find my way around. I want to write a simple query that does this: 1) Allows