db2

DB2/Cursor program working in cobol

一个人想着一个人 提交于 2019-12-13 04:33:33
问题 My requirement is to delete data from db2 table which contains duplicate phone num(invalid phone num, set of 16 phone numbers which is hardcoded).And one phone num should be retained , that depends on sequence number(minimum value). consider main table has following data : PHONE_TAB Client_Id Phone_num Seq_num 1234 45678 15 --- delete 4444 55555 45 1234 45678 10 ---should be retained 5555 22222 25 1234 45678 20 --- delete 1234 45678 11 --- delete Note : also i have to move the rows which will

What is wrong with this stored procedure

房东的猫 提交于 2019-12-13 04:27:30
问题 What is wrong with this stored procedure. CREATE PROCEDURE PROC_RESULT_SET () LANGUAGE SQL RESULT SETS 1 BEGIN DECLARE MYCUR CURSOR WITH RETURN FOR SELECT USERNAME , NAME FROM SLPG.USER ORDER BY ID; OPEN MYCUR; END; I get error like DB2 for Linux, UNIX, and Windows: "END" was expected to form a complete scope. -- near BEGIN statement DB2 for Linux, UNIX, and Windows: "" was expected to form a complete scope. -- near DECLARE statement DB2 for Linux, UNIX, and Windows: " JOIN " was expected to

Optimizing large tablespace

谁说我不能喝 提交于 2019-12-13 04:24:35
问题 We have a very large table LARGEHISTORY table which is having millions of records. Currently the table is using 50GB of table space and maximum allowed table space is 65GB in DB2 (DB2 v9.5.301.436). The table is growing very fast and we need to do something very fast to overcome the problem. Database: DB2 v9.5.301.436 Solutions which we already though of: Increase the table space size, which can be achieved using below two options: Alter table space of LARGEHISTORY from 65GB to 2 TB Advantage

SQL Server datatype for DB2 column “Char() for BIT Data”

时间秒杀一切 提交于 2019-12-13 04:17:21
问题 I googled but failed to find an answer for the following question. I have a DB2 database column of datatype “Char(100) for BIT Data“. It stores encrypted value of employee ID. I need to store this data in SQL Server . What should be the datatype for this column in SQL Server? Is there any formatting needed before inserting into SQL Server? 回答1: The column in your DB2 table is an ordinary character string, except that the for BIT Data part tells DB2 to treat that string as arbitrary binary

How do I compile ibm_db2 tar for PHP 7 on Windows?

被刻印的时光 ゝ 提交于 2019-12-13 03:47:24
问题 I am running PHP 7 in XAMP on Windows 7 and need to use the IBM DB2 driver for PHP https://pecl.php.net/package/ibm_db2 The DLL drivers only work for PHP 5 so according to php_ibm_db2.dll extension for PHP7 on Windows? I need to compile the tar file to create my own driver. Question is: how do I do that? 回答1: IBM distributed in August-2017 a pre-built ibm_db for Windows 32-bit, requiring a 32-bit PHP, and a 32-bit Db2-client on Windows - which was not my target. If you have a 32-bit

How to get a count from all table containing a specific column?

半城伤御伤魂 提交于 2019-12-13 03:42:44
问题 I have a IBM Content Manager with a DB2 database. In ICMADMIN, I have a bunch of tables, and some of them contain a specific column (let's call it ID_CLIENT), which is an ID linking to one table (CLIENT). How can I get the number of rows for each CLIENT from every table containing the ID_CLIENT column? I know how to retrieve names of every table containing ID_CLIENT, but not how to join CLIENT on them dynamically. select tabname from syscat.columns where colname='ID_CLIENT' (let's call this

different results out of crontab and manual run

℡╲_俬逩灬. 提交于 2019-12-13 03:37:18
问题 I am running a python script to load some data into db2 database. Yet, I came up with the following module-loading error: Traceback (most recent call last): File "myscript.py", line 22, in ? import DB2 File "/opt/freeware/lib/python2.3/site-packages/DB2.py", line 12, in ? import _db2 ImportError: Could not load module /opt/freeware/lib/python2.3/site-packages/_db2.so. Dependent module libdb2.a(shr.o) could not be loaded. Could not load module libdb2.a(shr.o). System error: No such file or

Db2 convert rows to columns

﹥>﹥吖頭↗ 提交于 2019-12-13 03:24:30
问题 I need the below results .. Table : Order postcode qnty 123 2234 1 Expected result: Order 123 Postcode 2234 Qnty 1 SQL server: Select pvt.element_name ,pvt.element_value(select order.postcode from table name)up unpivot (element_value for element_name in(order,postcode) as Pvt How to achieve this in db2? 回答1: Db2 for IBM i doesn't have a built-in unpviot function.. AFAIK, it's not available on any Db2 platofrm...unless it's been added recently. The straight forward method select 'ORDER' as key

IBM DB2 Core: Connection string for ASP.NET Core 2.1 and Microsoft Enterprise Libraries

守給你的承諾、 提交于 2019-12-13 03:21:02
问题 I'm using this Microsoft.EnterpriseLibrary port for .Net Core. It requires a configuration file app.config with the connection string specified in it. I tried using the same connection string I use in another working project, but it doesn't work here. How can I specify a DB2 connection string for ASP.NET Core 2.1? I this is what I have tried: <connectionStrings> <add name="Development" connectionString="server=MY.SERVER.COM:446;database=DBXX;user id=USERXX;password=PASSWORDXX;" providerName=

DB2 LUW 10.5 - How to force DB2 Stored procedures to use latest stats for most optimized plan

久未见 提交于 2019-12-13 03:07:19
问题 We see an issue occasionally. Stored procedure running a SQL runs very slow. Same SQL when run from command line runs very fast. It seems stored procedure uses a different path. The workaround for us is to drop and recreate the procedure, after which it picks up the right plan. Is there a way to execute a stored procedure with an instruction to regenerate execution plan at run time, so as to get the best plan every time. 回答1: You probably don't want to recompile plans every time you call your