ibm-midrange

DB2 SQL Select All With Columns As

荒凉一梦 提交于 2019-12-11 08:39:16
问题 I am working with some SQL queries on DB2. Is it possible to select all the columns in a table and also specify certain conditions using the "as" keyword within that select statement? For example, is this query possible: select *, col1 + col2 as sum1, col3 - col4 as dif1 from table; Whenever I attempt this, I am getting the SQL0104 error and it is saying "Token , was not valid. Valid tokens: FROM INTO". Thank you for your help. EDIT: This query is running inside an SQLRPGLE program on an

Procedure pointers in RPGLE (PROCPTR)

北城余情 提交于 2019-12-11 07:45:55
问题 Can anyone provide any interesting usage examples of these? 回答1: jjujuma, For a trivial example you could use this to implement some Object Oriented style procedure like Draw. You'd call a Circle_Draw procedure for a Circle or a Square_Draw procedure for a Square by assigning the appropriate %PADDR of the Circle_Draw or Square_Draw to your Draw procedure pointer. When calling the Draw procedure pointer you hide which procedure (Circle_Draw or Square_Draw) you're calling. 回答2: For a practical

How do I set the default schema when configuring AS400JDBCXADataSource in Spring or as Tomcat Resource?

笑着哭i 提交于 2019-12-11 07:39:55
问题 Moving from the following Tomcate Resource Definition: <Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource" username="user" password="pwd" driverClassName="com.ibm.as400.access.AS400JDBCDriver" url="JDBC:AS400://1.2.3.4:50000/TEST;prompt=false" /> to JTA (Atomikos), I'm wondering how to set the default schema: <Resource name="jdbc/test" auth="Container" type="com.atomikos.jdbc.AtomikosDataSourceBean" factory="com.atomikos.tomcat.BeanFactory" uniqueResourceName="jdbc/test"

Java IFSFile on Iseries testing over PC

随声附和 提交于 2019-12-11 06:27:10
问题 I'm trying to develop a Java Class that will be used on a RPG program on iSeries. This Class will manage files with IFSFile. The problem is that I don't know how can I test this (if possible) on my PC. My code would be something like: import java.io.BufferedReader; import java.io.IOException; import com.ibm.as400.access.AS400; import com.ibm.as400.access.AS400SecurityException; import com.ibm.as400.access.IFSFile; import com.ibm.as400.access.IFSFileReader; (...) AS400 system = new AS400(

Retrieving values passed by POST method form

不羁的心 提交于 2019-12-11 06:24:21
问题 I am facing some problem with POST method in form . I have a page A with a form with POST method and when i submit form it goes to page b . Now problem is that when i do a refresh it pop ups a alert which i don't want to come . I am using HTML and Javascript. Is there any way to handle this refresh? One way that i can think of is to dynamically create a hidden form on page b with the values populated in fields and for every refresh it just submits that hidden form . Please suggest and let me

How does one see the second line of status messages displayed at the bottom of an interactive job?

人走茶凉 提交于 2019-12-11 06:04:05
问题 Sometimes on the IBM iSeries, either at the command line or inside the SEU editor, one will get error messages that are too long to display on one line of the 5250 screen (line 24 if on the command line, line 27 when inside the SEU editor). I believe this is usually a status message like you would send with SNDPGMMSG or QMHSNDPM . How does one read the rest of this status message? They are not usually (ever?) written to the job log and after certain keystrokes or a refresh, they disappear. If

DB2 Convert Number to Date

旧时模样 提交于 2019-12-11 05:43:02
问题 For some reason (I have no control over this) dates are stored as Integers in an iSeries AS400 DB2 system that I need to query. E.g. today will be stored as: 20,171,221 Being in the UK I need it to be like the below in Date format: 21/12/2017 This is from my query: (OAORDT = date field) Select Date(SUBSTR( CHAR( OAORDT ),7,2) ||'/' || SUBSTR(CHAR ( OAORDT ),5,2) || '/' || SUBSTR(CHAR (OAORDT ),1,4)) AS "Order Date" from some.table However, all I get is Nulls. If I remove the Date function,

PHP / SQL - Convert EBCDIC to ASCII

末鹿安然 提交于 2019-12-11 05:35:45
问题 We have PHP server code, executing SQL statements against our iSeries midrange. Here is a simplified version of the SQL query SELECT 'Regular' "sales_type", sum(sales_type1) "sales" FROM salesTable The query executes just fine, the problem is that when using a static field/value such as 'SomeText' "Title" and the results come back in PHP, they are not in the desired format string(7) "م�����" To connect to the system and retrieve the results db2_connect ( '*LOCAL', 'user', 'pass' ); if (!

Is it possible to generate a unique numeric value for each row in an iSeries table without looping?

邮差的信 提交于 2019-12-11 03:58:03
问题 I have an iSeries table with thousands of rows, and a new numeric/integer column was just added as the table Key. This will basically be a integer id column (1,2,3...). Let's say that I can't make this column an auto-incrementing column. Is there an simple way to assign unique, incremental values to each row without having to loop through each record assigning a value? Perhaps some kind of UPDATE query? 回答1: You can use the RRN scalar function to assign the relative record number: update

Send data to AS400 from VBA (runtime error 249)

有些话、适合烂在心里 提交于 2019-12-11 03:49:23
问题 I hope you can help me solving this problem Every day a friend of mine has to fill the same field in AS400 using data that are stored in excel spreadsheet. I am pretty advanced programmer in VBA so I was wandering if there is a way to make vba and as400 interact any ideas? thank you very much in advance EDIT: in the meanwhile I am doing some digging and I found this http://www.ibm.com/support/knowledgecenter/SSEQ5Y_5.9.0/com.ibm.pcomm.doc/books/html/host_access08.htm Dim autECLConnList as