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.
look up any number in a text field
I have a column that has plain text data. I am looking to find any name that is followed by an integer 'Sam 123', Sam 597" etc.
I have tried
but it returns alphanumeric data.
DB2: How to filter based on the result obtained from CASE condition
I am trying to filter the data based on the results obtained from previous CASE condition in
Below is the initial query to filter the data:
What I tried to filter the results:
but not getting the results instead getting errors:
Any help in, how to filter the data and get the below result:
DATEDIFF in DB2 query
I have a query from mysql that has been running on a table I recently migrated to DB2.
The query now fails on DB2 due to the line below, saying that DATEDIFF cannot be found. I'm assuming only because this isn't a valid function on db2.
Is there an equivalent to this on DB2 that will maintain performance as well as function?
Query in sql on db2 database
I'm using this query:
I need to add 2 hours to Date field, in other words I need to add the number 2 to substr("Message_Time",8,2).
The date has the format 1181020164532000 where:
first number is centurythen following two numbers are the yearsthen following two numbers are the monthsthen following two numbers are the daysthen following two numbers are the hoursthen following two numbers are the minutesand last three numbers are milliseconds
Cannot connect to fresh installed DB2 on WINDOWS 10
I just installed a DB2 on my Windows 10 laptop.
Installation looks ok.
If I run db2level I get this answer:
When I run db2licm -l I get this:
DB2 is started, I can issue db2stop and db2start command without any issue.
And now the PROLBLEM: I cannot find a way to CONNECT to the DB2 instance.In fact when I run CONNECT command CLPPlus window freezes this way:
while RAM usage start rising:
I googled IBM sites without finding any suitable solution.
Has anyone experienced the same problem?
Thanks a lot
How to calculate days between two date columns in db2?? how do i correct the difference of days in this query?
my query :
The difference of days is incorrect in first 5 rows.
also,i am not sure how to find difference of days with the converted columns so instead i chose CTD-OTD !
and there is no time column for OTD, so cant use TIMESTAMPDIFF .
note : i randomly selected the rows with wrong difference of days to show the resuly=ts here.
Event Monitor in DB2 log the details of query run from VPN on the same server where events are created?
Events has been created on my database. If anybody take the VPN of my DB and do some tasks. These activities logged or not.If not then how we can do that.
Adding IBM Db2 as a datasource
Has anyone had any luck or found documentation on how to add IBM Db2 as a datasource for their dashboard on Apache Superset? I don't see any information in the Db2 service credentials about the driver or dialect.
SQL0443 error when executing a Select with a Trigger on DB2 for iSeries
I've some problem querying a db2/as400 table, let's call it TAB1. Since it was added a trigger on this table when I perform a normal SELECT (using the TAB1-key) I get the following error. Never had a problem before the trigger was created.
It's a query performed in a batch-application (Java 1.6) using Modern Batch and Spring Batch 2.1.8. No chance to update the libraries, since the program is quite old and the customers won't agree.
Anyway,I would say it's a trigger problem ( as the sql codes say) but different applications perform different SELECTs on TAB1 and they never get any similar problem.The batch perform more or less 40000 select like this, and just 300 fail with this error.
Any idea, tip, suggestion?
create/remove row permission in IBM i (as400) SQL
In Db2 for IBM i, I can create row permission like this.
If I Deactivate row access control, rules seem to go away, but if I ACTIVATE old rules come back.