ibm-midrange

Using dynamic table name in db2

依然范特西╮ 提交于 2019-12-12 03:26:22
问题 Currently in my project development need of generating the record count based on certain criteria where the table names are stored in separate table.For instance say xx table stores the table name under the column name is tableInfo. I've written the stored procedure in such a way that DECLARE FGCURSOR CURSOR FOR SELECT tableInfo FROM xx WHERE col1='PO'; OPEN FGCURSOR; FETCH FROM FGCURSOR INTO FILEGROUPMEM; WHILE SQLCODE <> 100 DO SET COUNTVal = 'SELECT COUNT(*) FROM ' || FILEGROUPMEM || '

UDTF returning a Table on DB2 V5R4 with Dynamic SQL

懵懂的女人 提交于 2019-12-12 03:22:45
问题 I must to write a UDF returning a Table. I’ve done it with Static SQL. I’ve created Procedures preparing a Dynamic and Complex SQL sentence and returning a cursor. But now I must to create a UDF with Dynamic SQL and return a table to be used with an IN clause inside other select. It is possible on DB2 v5R4? Do you have an example? Thanks in advance... 回答1: I don't have V5R4, but I have i 6.1 and V5R3. I have a 6.1 example, and I poked around in V5R3 to find how to make the same example work

How to get PSF Settings in an AS400 Server using Java

拈花ヽ惹草 提交于 2019-12-12 03:03:23
问题 I am a newbie in this site but I know anyone here can help me on this problem that I have now. I used to program Java using JDK7 and now I am facing this JTOpen API for AS400-Java interface but my problem now is how to get all the PSF Setting of my Device Description of a certain Writer? Thanks in advance guys.... Please help..... 回答1: Check out the print API's at http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/print1a.htm If you can find an API that provides the information

JT400 Read File From IFS with user without password

落爺英雄遲暮 提交于 2019-12-12 02:27:27
问题 our problem is the following: We have to connect to an ISeries with the JT400 and read a file in the IFS. One requirement is the job is running in the QBatch with a user without password. Our code is the following: //This wy we connect to the Iseries with the job credentials in this case //user withou password AS400 as400 = new AS400(); IFSFile file = new IFSFile(system, path); //This line throws the AS400SecurityException IFSFileInputStream fis = new IFSFileInputStream(file

DB2 update and insert trigger, references a lot of fields can I use * to shorten them (in iSeries but might not matter)

♀尐吖头ヾ 提交于 2019-12-12 01:06:52
问题 DB2 on iSeries is a little different then DB2 than other platforms but like I said it might not matter. Here are my following triggers (which work) (One difference is the use of '/' vs '.' depending on what tool is used to create the query) create trigger utbachInsert after insert on CO99PR/UTBACH referencing new as n for each row mode db2sql begin atomic insert into CO99PRH/UTBACH values( n.BCGRP, n.BCID,n.BCSTAT,n.BCDESC,n.YYRGDT, n.MMRGDT,n.DDRGDT,n.YY1EDT,n.MM1EDT,n.DD1EDT, n.YYBLDT,n

How can I convert the standard AS400 CYMD date format to MDY in PHP?

百般思念 提交于 2019-12-12 01:06:12
问题 I am doing quite a few queries within PHP. I am displaying information from these queries but I would like to change the date format to something that people other than programmers can easily read. Currently I have been able to get by by using this: $compdt = str_split($fin47['COMPDT']); $compdt = "$compdt[3]$compdt[4]/$compdt[5]$compdt[6]/$compdt[1]$compdt[2]" The above works great. For example, from the database, I return this for the date: 1090225 After I do my array and string arrangement

IBM Data Studio (Admin client) version 3.1.1

风格不统一 提交于 2019-12-11 20:24:57
问题 Simple question that I can't find an answer to. I am validating Data Studio (admin version) for use at our site. Most of it looks OK apart from trying to use the wizard to build row value SQL expressions such as Update cmf a set (cftlvl,cfplvl) = (select cftlvl,cfplvl from fixes b where a.cffac=b.cffac and a.cfcset=b.cfcset and a.cfcbkt=b.cfcbkt and a.cfprod=b.cfprod) where (a.cffac,a.cfcset,a.cfcbkt,a.cfprod) in (select cffac,cfcset,cfcbkt,cfprod from fixes) The code runs fine but the wizard

How to Get IBM i Job details Using Job Number - Java ( JT400 )

心已入冬 提交于 2019-12-11 19:17:12
问题 I want to get IBM i job details using that job number. i get all job list. but i want to get job details using it's job no. Please help me friends. Edit : I believe the question is 'How can I get job details given a fully qualified job name?' try { AS400 system = new AS400 ("SERVER","USER", "PASS"); JobList jobList = new JobList(system); Enumeration list = jobList.getJobs(); while (list.hasMoreElements()) { Job j= (Job) list.nextElement(); String GCPU = Integer.toString(j.getCPUUsed());

DB2 JPA entities from table

你说的曾经没有我的故事 提交于 2019-12-11 18:52:52
问题 I'm trying to generate JPA entities from table through the Eclipse Wizard. The database is AS400-DB2. I've set the properties in this way: database: ACG_COMTST URL: jdbc:as400://192.168.3.54 username: username password: password ACG_COMTST is the AS400 library. When I press test connection I get success. But I can't see any table to select in the wizard 回答1: Dali, the Eclipse plug-in that supplies the entity generation wizard you are using, relies on another Eclipse plug-in, DTP, to provide

Zend PDF trying to print Russian language

纵然是瞬间 提交于 2019-12-11 18:49:35
问题 I am using Zend PDF, trying to print Russian words. My code is $unicodeString = "это фигня"; $page->drawText($unicodeString, 72, 720, 'UTF-8'); but the result is ѕто фигнѕ So, it is printing something weird. I read that the issue might have to do with fonts and Unicode, so I am planning to fix it by doing this: $font = Zend_Pdf_Font::fontWithPath('/Library/Fonts/Times New Roman Bold.ttf'); How can i find the path to this font in on an IBM i / AS/400 machine? One more very basic