db2-400

DB2 .Net Connector error : AESEncryptADONet

人盡茶涼 提交于 2021-02-17 05:33:06
问题 I have a very simple .Net Core app trying to create and open a connection to a DB2 database (on AS/400). I have this error when I try to create the DBConnection object, with the message: ERROR 58005 SQL0902 There are no context policies. Function: AESEncryptADONet . There are no more details, unfortunately. 回答1: We meet the same error and solved it by setting Path of environment variables on Windows / Linux ( LD_LIBRARY_PATH ) / MacOS ( DYLD_LIBRARY_PATH ). For example: Our environment: ASP

db2 for i : passing a varchar containing comma separated string in an sql procedure in in clause

北城以北 提交于 2021-02-08 10:28:15
问题 i have a string containing comma separated strings in java.. which i m passing to a sql procedure being called in java ... here is example of java string: String codeString = "'232/232','34fd/34//'"; code in sql db2 for i: create procedure history (in id varchar (3), in code varchar (2000)) ...... ...... begin insert into table1 select date_from, date_to, code from table2 where table2.serial= id and table2.status not in (code); end this sql procedure is inserting same string in table1.code

iSeries Access ODBC Driver with unixodbc on Debian - Invalid UTF-8 characters being returned from iSeries

只谈情不闲聊 提交于 2021-01-29 19:38:36
问题 Using ODBC driver, ibm-iaccess-1.1.0.10-1.0.amd64, on Debian Linux. When I perform a php sql query and validate the response, I see some of the data returned is not valid utf-8. mb_check_encoding returns 'false' and the character on screen in a chrome browser is the diamond question mark character. This happens on a few CHAR field types. if(!mb_check_encoding($row["field"])) { ... exit with utf-8 error } I can work around this by converting from UTF-8 to UTF-8: mb_convert_encoding($row["field

Regex to extract nth token of a string separated by pipes

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-03 13:03:23
问题 I'm new in Regex I need to count and extract tokens from the below sample text: AA||CCCCCCCC|||FFFFFFFFFFF Requesting 4th token I must get a empty '' string, requesting 6th I must get 'FFFFFFFFFFF' Would it be possible to have such regex? Thanks in Advance! PS: For token counting I've used '\|' adding +1 to the result is the string is not empty, surely there another more efficient way to do that using just a regex... 回答1: For DB2 please try this to get the 6th element in the list. This works

What is a good substitute for DSPF with physical files that contain nulls?

泄露秘密 提交于 2020-06-18 16:49:29
问题 I have found that the command DSPF (Display Physical file) does not correctly display records that contain a null. If I define a physical file in DDS with the ALWNULL keyword on a field, then fill the file with data, DSPF will correctly display the data for records without nulls, but all records that contain at least one null will display only blanks in both the null and the non-null fields. This can be misleading. For example in the screenshot below, the seemingly blank records have data in

What is a good substitute for DSPF with physical files that contain nulls?

戏子无情 提交于 2020-06-18 16:49:06
问题 I have found that the command DSPF (Display Physical file) does not correctly display records that contain a null. If I define a physical file in DDS with the ALWNULL keyword on a field, then fill the file with data, DSPF will correctly display the data for records without nulls, but all records that contain at least one null will display only blanks in both the null and the non-null fields. This can be misleading. For example in the screenshot below, the seemingly blank records have data in

Put date conversion in where clause db2 sql

不打扰是莪最后的温柔 提交于 2020-03-25 19:19:22
问题 I have the following query. And I am calculating on MYDATE column which is a DECIMAL(8, 0) data type which stores datea in numeric form in YYYYMMDD format like this 20191107. SELECT DECIMAL((TO_CHAR(TO_DATE(CAST(CAST(MYDATE AS INT) AS VARCHAR(8)), 'yyyymmdd') - 3 MONTHS, 'yyyymmdd')), 8, 0) FROM PDF_TABLE; It works fine. However, when I use the above conversion in a WHERE clause like below, query does not return anything. SELECT * FROM PDF_TABLE WHERE MYDATE = DECIMAL((TO_CHAR(TO_DATE(CAST

Sql Cleanup script, delete from one table that's not in the other

半腔热情 提交于 2020-01-17 14:05:11
问题 We wrote a cleanup script in SQL(DB2) as400 to do cleanup of tables. ps we are fixing the processes that is causing the data issues. The SQL : DELETE FROM p6prodpf A WHERE (0 = (SELECT COUNT(*) FROM P6OPIPF B WHERE B.OPIID = A.OPIID)) Its simple code to check if theres a record in p6prodpf that has no record in P6OPIPF then delete the record in p6prodpf . My problem that I am facing is that there's instances where the p6prodpf is being deleted even if theres a record in P6OPIPF . Is there a

Need SQL command that will insert a row after specific row

*爱你&永不变心* 提交于 2020-01-14 06:19:05
问题 I need SQL command that will insert a row after specific row. Example:- Before table Id. Name. 1. Xyz. 2. Xyz 3. Xyz Want result need to add 'Abc' data after each 'xyz' having same id like:- Id. Name. 1. Xyz. 1. Abc 2. Xyz 2. Abc 3. Xyz 3. Abc 回答1: You need UNION ALL : SELECT t.* FROM (SELECT id, Name FROM table t UNION ALL SELECT ID, 'Abc' FROM table t ) t ORDER BY ID, NAME; This will not insert row, it just provide you run time view. If you want only insert then you need to truncate your