db2

Spring data jpa failed to pass named parameters in native subquery for db2

夙愿已清 提交于 2019-12-06 15:47:12
Unable to pass named parameters in @NamedNativeQuery in spring data jpa my repo: @Query(value = "select stat.desc as desc," + " stat.priority as priority," + " (case when sum(activeUser) is null then 0 else sum(activeUser) end) as activeUser," + " (case when sum(totalUser) is null then 0 else sum(totalUser) end) as totalUser" + " from lookup.user stat left outer join" + " (" + " select user.role as role, " + " sum (case when user.STATUS = 'ACTIVE' then 1 else 0 end) as activeUser," + " count(*) as totalUser," + " user.group as group" + " from Ctrl.user user" + " where user.group =:userGroup "

COBOL program, JCL job, or both?

心不动则不痛 提交于 2019-12-06 15:08:13
I have to preform 3 tasks: an insert, a delete, and a write I'm not sure what the best way to do this is. My mainframe program design skills aren't too tight, so I was looking for advice. Could I avoid doing a COBOL program for this? The way I see it, I just need JCL that executes SQL statements. If I design my statements correctly, then they should be able to preform tasks 1 and 2 this way. But I'm thinking I may need to have a COBOL program to write to a file? I'll overview my thought process for the 3 tasks. Each task seems similar, but they query different results, so the SQL statements

Run create/drop DB2 database commands for a specific user other than machine logged-in user

不想你离开。 提交于 2019-12-06 13:42:02
问题 db2 CREATE DATABASE XYZ db2 DROP DATABASE XYZ These db2 commands which doesn't provide support to specify username/password while executing on db2cmd/db2clp for a specific user other than machine logged-in user. Hence result a exception "SQL1092N The requested command or operation failed because the user ID does not have the authority to perform the requested command or operation." And when the same commands run as by choosing 'Run as different user', it works properly. But I need to use same

DB2 Update with join queries

点点圈 提交于 2019-12-06 13:25:35
I am using DB2 for performing the below update operation. update DATA set B_DESC=P_DESC, P_DESC=null where B_DESC= *, P_DESC=* (Select B_DESC,P_DESC from C_DATA) The below is actually possible but since complex joins are involved in that sub query it is not advisable to use like below update DATA set B_DESC=P_DESC, P_DESC=null where B_DESC= (Select B_DESC from C_DATA), P_DESC=(Select P_DESC from C_DATA) I have to update DATA table, but the B_DESC and P_DESC i have to fetch it from C_DATA table and use it in the UPDATE query. Please let me know how to do it. It has to be a single query if

Abend Causing Line

这一生的挚爱 提交于 2019-12-06 13:08:19
Is there any way that we can find the exact line number that causes an abend ( like SO4C) from the Offset(like offset +00007D0A at address 1515CD0A ) given in the spool with the error message.? If your program is compiled with options OFFSET,NOLIST, you will have a list of verbs/line numbers in the output listing which contain the "offset" from the start of the program. The line number on the the listing which has the closest offset, but less than or equal to, the "offset" reported in the abend, is where you want to look. If you use NOOFFSET,LIST, you will get the "generated assembler" in your

How to enable PHP_IBM_DB2 function?

孤街浪徒 提交于 2019-12-06 13:01:40
问题 Here is what I've done so far: 1) I have downloaded php_ibm_db2-1.9.1-5.3-ts-vc9-x86.zip from http://sourceforge.net/projects/db2mc/ 2) Copied php_ibm_db2.dll to c:/wamp/bin/php/php5.3.10/ext 3) edit php.ini and added this script: extension = php_ibm_db2.dll 4) edited httpd.conf and added this script LoadModule php5_module "c:/wamp/bin/php/php5.3.10/php5apache2_2.dll" AddType application/x-httpd-php .php PHPIniDir "c:/wamp/bin/php/php5.3.10/" 5) restart wampserver Result: I still have Call to

SQL - suppressing duplicate *adjacent* records

谁说我不能喝 提交于 2019-12-06 11:43:41
问题 I need to run a Select statement (DB2 SQL) that does not pull adjacent row duplicates based on a certain field. In specific, I am trying to find out when data changes , which is made difficult because it might change back to its original value. That is to say, I have a table that vaguely resembles the below, sorted by Letter and then by Date: A, 5, 2009-01-01 A, 12, 2009-02-01 A, 12, 2009-03-01 A, 12, 2009-04-01 A, 9, 2009-05-01 A, 9, 2009-06-01 A, 5, 2009-07-01 And I want to get the results:

Excel and DB2 connectivity

不想你离开。 提交于 2019-12-06 10:47:40
问题 I have to check whether the connection between Excel and DB2 has been established using CLI/ODBC driver or not. For that I plan to write a batch file where I will be calling the excel sheet which in turn will automatically execute a macro which will bring out some dummy data from the sysibm.sysdummy1 table. I require code with which I can make a connection to my database and check if the connection has been established or not by giving out some success message if the connection was

How do I get ibm_db or PyDB2 python modules to work with DB2 in Mac OS X 10.7 Lion?

♀尐吖头ヾ 提交于 2019-12-06 10:38:43
问题 I used this question/answer to install DB2 in Lion: How do I install IBM DB2 Express-C on Mac OS X 10.7 Lion? After configuring my databases, I am able to use db2 from the command line to execute queries, but the python modules ibm_db and PyDB2 both fail to import with the following error: >>> import ibm_db Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: dlopen(/Library/Python/2.7/site-packages/ibm_db-1.0.4-py2.7-macosx-10.7-intel.egg/ibm_db.so, 2): Symbol

DB2 Stored Procedure: Dynamically Building a Select Statement for cursor

可紊 提交于 2019-12-06 10:33:17
I am fairly new to stored procedures. I naively thought that I could build up a select statement as follows. I cannot, and some of you will grin with what I came up with. How does one do what I am trying to do though? Thanks in advance. CREATE PROCEDURE GET_CUSTOMER_FOR_BORROWER_LETTER ( IN APPLICATION_ID INTEGER, IN GET_GUARANTOR INTEGER, IN GET_PREFERRED_CONTACT INTEGER ) DYNAMIC RESULT SETS 1 READS SQL DATA P1:BEGIN DECLARE selectStmt VARCHAR(800); DECLARE selectStmtPreferred VARCHAR(400); DECLARE selectStmtApplicants VARCHAR(400); DECLARE selectStmtGuarantor VARCHAR(400); DECLARE cursor1