ibm-midrange

Odbc connection string format, not finding files

☆樱花仙子☆ 提交于 2019-12-01 20:41:46
This is kind of a 'double' question that might have a single answer. I'm working with an Odbc Connection with an AS/400, with my connection string as follows: driver={iSeries Access ODBC Driver}; system={0}; uid={1}; pwd={2}; DefaultLibraries=*USRLIBL; I'm able to connect to the system fine. *USRLIBL contains all the necessary libraries from the user (which is of the type 'API only' which has access to all user libraries). However, when I try to access certain ERP libraries, it says they can't be found, while other ones can. So as an extremely basic walkthrough: 1. Open Connection - Query File

AS/400: Using COMPUTE function, inconsistent results with different field definition

こ雲淡風輕ζ 提交于 2019-12-01 20:08:46
I have faced a mysterious problem while using the COMPUTE function in AS/400. The scenario is as follows: 01 WSAA-AMOUNT-A PIC S9(15)V9(02) COMP-3. 01 WSAA-AMOUNT-B-01 PIC S9(16)V9(02) VALUE 0. 01 WSAA-AMOUNT-B-02 PIC S9(13)V9(05) VALUE 0. 01 WSAA-AMOUNT-C PIC S9(16)V9(02) VALUE 0. 01 WSAA-RESULT PIC S9(15)V9(02) VALUE 0. MOVE 2500.87 TO WSAA-AMOUNT-A. MOVE 12285 TO WSAA-AMOUNT-B-01. MOVE 12285 TO WSAA-AMOUNT-B-02. MOVE 4387.5 TO WSAA-AMOUNT-C. COMPUTE WSAA-RESULT ROUNDED = (WSAA-AMOUNT-A / ( WSAA-AMOUNT-B-01 + WSAA-AMOUNT-C) * 100 ). DISPLAY WSAA-RESULT. COMPUTE WSAA-RESULT ROUNDED = (WSAA

AS/400: Using COMPUTE function, inconsistent results with different field definition

北慕城南 提交于 2019-12-01 20:00:53
问题 I have faced a mysterious problem while using the COMPUTE function in AS/400. The scenario is as follows: 01 WSAA-AMOUNT-A PIC S9(15)V9(02) COMP-3. 01 WSAA-AMOUNT-B-01 PIC S9(16)V9(02) VALUE 0. 01 WSAA-AMOUNT-B-02 PIC S9(13)V9(05) VALUE 0. 01 WSAA-AMOUNT-C PIC S9(16)V9(02) VALUE 0. 01 WSAA-RESULT PIC S9(15)V9(02) VALUE 0. MOVE 2500.87 TO WSAA-AMOUNT-A. MOVE 12285 TO WSAA-AMOUNT-B-01. MOVE 12285 TO WSAA-AMOUNT-B-02. MOVE 4387.5 TO WSAA-AMOUNT-C. COMPUTE WSAA-RESULT ROUNDED = (WSAA-AMOUNT-A / (

Is possible to create a cron-job on a as400 system (IBM) in order to update/insert large quantity of data on online server?

不想你离开。 提交于 2019-12-01 15:10:45
I was looking here if is possible to insert/update a large quantity of rows from an as400 system. I have a website stored on another server online and that website must be updated with the new stocks for each article. But this data only exists in the as400 system. I would like to be the as400 system linking the web-server instead of the web-server link to as400 for security reasons. A better system would be to update/insert everytime a change has been made in the as400, but if this is not possible it could be making an update every 3 hours in order to mantain consistency between the 2 servers.

php + unixODBC + DB2 + DESCRIBE = token not valid?

六月ゝ 毕业季﹏ 提交于 2019-12-01 12:21:10
Code I am trying to run: $query = "DESCRIBE TABLE TABLENAME"; $result = odbc_exec($h, $query); The result: PHP Warning: odbc_exec(): SQL error: [unixODBC][IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token TABLENAME was not valid. Valid tokens: INTO., SQL state 37000 in SQLExecDirect in ... There were no other problems with SELECT, INSERT, UPDATE or DELETE queries on the same connection. Is this a syntax error? The iSeries flavor of DB2 does not support the SQL DESCRIBE statement. Instead, you have to query the system table: select * from qsys2.columns where table_schema = 'my_schema'

Database: SUBSTRING upto first occurence of character

寵の児 提交于 2019-12-01 11:56:17
i have string type abc_01, abcd_01 or 02 now i want the substring upto _ ie abc_,abcd_ etc. I am using db2 as400 .Please suggest the processing through RIGHT or LEFT function Use the POSITION built-in function. The format is either: POSITION--(--search-string--IN--source-string--) or POSSTR--(--source-string--,--search-string--) I also suggest using a CASE structure to check for when there is no _ or if it's at the beginning or end. Here is an example. We'll assume, for the sake of the example that the field in question is creatively named FIELD1 and that it does not allow NULL values. SELECT

Concatenate Multiple Row Values into 1 Row, with SQL for iSeries

若如初见. 提交于 2019-12-01 11:00:31
First, I need to thank Kent Milligan and his article at http://www.mcpressonline.com/sql/techtip-combining-multiple-row-values-into-a-single-row-with-sql-in-db2-for-i.html for getting me as far in this problem as I have. But now I need to expand on what he has done here. To avoid you having to go to his article, the problem he addressed was concatenating string data from multiple rows into a single row in the resulting table. For example: Table Cars: Make Model Ford Fusion Chevy Tahoe Honda Odyssey Ford Taurus Ford Focus Chevy Malibu Results: Make Model Chevy Malibu, Tahoe Ford Focus, Taurus,

php + unixODBC + DB2 + DESCRIBE = token not valid?

大憨熊 提交于 2019-12-01 09:41:55
问题 Code I am trying to run: $query = "DESCRIBE TABLE TABLENAME"; $result = odbc_exec($h, $query); The result: PHP Warning: odbc_exec(): SQL error: [unixODBC][IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token TABLENAME was not valid. Valid tokens: INTO., SQL state 37000 in SQLExecDirect in ... There were no other problems with SELECT, INSERT, UPDATE or DELETE queries on the same connection. Is this a syntax error? 回答1: The iSeries flavor of DB2 does not support the SQL DESCRIBE statement.

Turn off Journaling in Sql Server/ T-SQL

为君一笑 提交于 2019-12-01 09:40:47
问题 I need to turn off journaling in Sql Server/T-SQL to write to a file/table in as400. I have found that you can do it in SQLite with Pragma. However, I have discovered that doesn't exist in T-SQL. Any ideas? Thanks! 回答1: You need to disable commitment control on the link. Which provider are you using? .NET DefaultIsolationLevel=Chaos OLEDB (IBMDA400) Extended Properties="Default Isolation Level=NC;Auto Commit Mode=True" ODBC CommitMode=0 来源: https://stackoverflow.com/questions/9040884/turn-off

DB2 for IBM iSeries: IF EXISTS statement syntax

不问归期 提交于 2019-12-01 09:24:24
I am familiar with Sybase which allows queries with format: IF EXISTS () THEN ... ELSE ... END IF (or very close). This a powerful statement that allows: "if exists, then update, else insert". I am writing queries for DB2 on IBM iSeries box. I have seen the CASE keyword, but I cannot make it work. I always receive the error: "Keyword CASE not expected." Sample: IF EXISTS ( SELECT * FROM MYTABLE WHERE KEY = xxx ) THEN UPDATE MYTABLE SET VALUE = zzz WHERE KEY = xxx ELSE INSERT INTO MYTABLE (KEY, VALUE) VALUES (xxx, zzz) END IF Is there a way to do this against DB2 on IBM iSeries? Currently, I