Skip to content Skip to sidebar Skip to footer
Showing posts with the label Db2

How To Put A Constraint On Two Combined Fields?

I'd like to put a constraint, a check or a foreign key, on two combined fields from table1 to a… Read more How To Put A Constraint On Two Combined Fields?

Db2 Equivalent Of Sql Server's Trigger_nestlevel()?

I'm trying to get control of a recursive trigger over DB2 (v9.7), unfortunately IBM documentati… Read more Db2 Equivalent Of Sql Server's Trigger_nestlevel()?

Db2 Luw 10.5 - How To Force Db2 Stored Procedures To Use Latest Stats For Most Optimized Plan

We see an issue occasionally. Stored procedure running a SQL runs very slow. Same SQL when run fro… Read more Db2 Luw 10.5 - How To Force Db2 Stored Procedures To Use Latest Stats For Most Optimized Plan

Calculating How Many Days Are Between Two Dates In Db2?

I need to get the difference in days between two dates in DB2. I tried a couple of different querie… Read more Calculating How Many Days Are Between Two Dates In Db2?

Is There Any Better Way To Write This Query

I designed below query for my delete operation. I am new to SQL and just wanted to check with exper… Read more Is There Any Better Way To Write This Query

Db2 Coalesce Function Is Returning Nulls

I am using DB2 for IBM i V6R1, and I am trying to convert a string value which sometimes has a vali… Read more Db2 Coalesce Function Is Returning Nulls

Decimal Formatting In Sql Query

I have a query as below: Select price from myTable; This returns value '22.50' However, I … Read more Decimal Formatting In Sql Query

Why Does My Query Generate An "undefined Name" Error With Sqlcode -204?

This is a SQL Server query select Letter, COUNT(*) from #Letters LEFT JOIN Emp ON Name LIKE Letter … Read more Why Does My Query Generate An "undefined Name" Error With Sqlcode -204?