StackOverflow is a collaborative programming Q&A community venture
Note: The content of this blog is the opinion and thoughts of the blogger and does not necessarily represent the opinions of IDUG.
I need help to reporting from db2 [on hold]
I have a table that include all data about a ticket history like assigned, inprog, datareq, who is owner etc.. I want to report information of owner group changes,the first owner group and the last owner group. how can I do that ? (ı know that it is a specific situation :( )
Zero not returning in DB2 when select query yields no result
I am running the below select query in SSIS which is using DB2 connection.
When this query yields no result, I am getting the below error in SSIS.
So I am trying to return
But everything returning no result.
How can I return 0 in DB2 ?
Can Nifi load data from DB2 to Cassandra?
I am exploring options to load data from DB2 to Cassandra using open source tools. I read through some of the blogs and articles and found Nifi is one of the recommended tool. Need some inputs on whether Nifi could perform this job or any other better tool? Any other suggestions to load data? Like any native connector to pull data from DB2?? Many thanks in advance for help.
Cannot set CURRENT OPTIMIZATION HINT special register via db2dsdriver.cfg <specialregisters> section
I was trying to provide a default value for the CURRENT OPTIMIZATION HINT special register for my DB2 client application.
I tried db2dsdriver.cfg file and it's section and JDBC specialRegisters Uri parameter. Both lead to the same result:
or with JDBC Uri:
I get an exception saying I have a problem with the SET instruction:
Here is the exempt from the java trace:
or with JDBC Uri:
The result is that the special registed is set to some faulty value:
returns a string:
Here is my environment info:
For DDF DB2 access I am using:
How to cast hex data string to a string db2 sql
How would you decode a hex string to get the value in text format by using a select statement?
For example my data in hex is:
I want to decode it to get the string value using a select statement.The value of the above is "ONLY FOR BACK-UP ON LEVEL ONE FOR CRANES"
what I have tried is :
The above sql returns the exact same hex string and not the decoded text string of "ONLY FOR BACK-UP ON LEVEL ONE FOR CRANES" what I expected.
Is it possible to do this with a cast? If it is what will the syntax be?
My problem that I have is a system stores text data in a blob field and I want to use a select statement to see what the text data is in the blob field.
Db : Db2 on Ibm
I have managed to covert the string to the hex value by using :
This gives me the string in hex :
Now somehow I need to do the inverse and get the value.
Using the answer from Daniel Lema, I tried using the unhex function but my result that I got was :
Is this something to do with a CSSID? Or how should I convet the above to a readable string?
This is the table field definition if it will help the field with my data in is GDTXFT a BLOB :
<column name> is not valid in the context where it is used.
I've been at this Create Trigger for a while...
I'm using IBM Data Studio 4.1.3 while making this Trigger. At first I had problems with ending statements with ';' but on the IBM website it says to use 'x' and it works.
My main problem, however, wondering why I get this message:
This also applies to all the others: o.itemid, o.quantity, and n.quantity. I found this out when switching/swapping the names around each other.
The editor is telling me that it has no errors in the statement but when executing, problems arise.
DB2 - how to call a stored procedure that returns a result set in another user defined table function
I have a db2 stored procedure that takes in some parameters, gets some data from somewhere and then returns a result set through a cursor.
Now I want to write a table function in db2, that will call this stored procedure, read from the result set and return the data in the result set as a table (eventually I want to use this table function in a join).
I would like to know if this is permitted in db2 (we're using DB2 v10.5), i.e. execute a stored procedure in a table function and fetch and read from the result set from the stored procedure. If so, what is the right syntax for calling the stored procedure and reading the result set inside a table function in db2? Thanks!
How to use dynamic AND or OR operator in where clause in DB2?
A procedure contains this cursor and the cursor have
So that the cursor return resultset on the basis of either
Thanks in advance!
DB2 sql: How to generate unique ids of a certain length
I'm trying to use python to generate a list of unique ids that can be used as indexes in a table on our DB2 database. My starting input is a list of ids come from a seperate table. I need to take this list of ids and generate a list of other ids (place inside the formlist variable here) These other ids must be unique and must not already exist on the target database table (table name is below shown as FORM_RPT
So far what I have tried is the following:
This code is generating just fine, but to my confusion, a small portion of the generated ids are still showing as existing in the target database. The generated ids need to be 4 digits ints.
Here is an example of how it would work:
Currently I'm getting a returned list, but the new list sometimes will have ids that exist in my formList variable.
SQL update from one Table to another based on a ID match IN db2
The Query below is suited in SQL sErver. But in DB2 it does not give results:
Can someone please clarify the differences b/w DB2 and SQL queries.