DB2 ‘SQL0901 SQL System Error.’ when trying to SELECT from view containing UNION
I am using a AS400 DB2 Database. In that Database I got 3 Views.
All Views have the exact same Columnnames and Datatypes.
View 1 & 2 each consist of a Select … Read the rest “DB2 ‘SQL0901 SQL System Error.’ when trying to SELECT from view containing UNION”
displaying db2 error codes in SquirrelSQL
When you run a query in db2 commandline tool you get explanations like:
db2 =select * from sysibm.systables where owner = ‘SAM’ and type = ‘T’;
SQL0206N “OWNER” is not valid in the context where it is used.… Read the rest “displaying db2 error codes in SquirrelSQL”
DB2 Online Restore but Without Roll Forward?
I read a lot of documentations for db2 restore but I could not find how to perform online restore from the last database backup but without roll forwarding of logs?
I will appreciate command example.
On example my … Read the rest “DB2 Online Restore but Without Roll Forward?”
Django, Informix, ibm_db and DB2 data server driver
I’m trying to connect to IDS(v11.50) from django(v1.3.1) using IBM DB2 Data Server Driver (ODBC)(v10.1) and ibm_db (https://code.google.com/p/ibm-db/). Simple query like ‘select distinct adm_audit.action from adm_audit’ from django to driver transfers into select distinct “adm_audit”.”action” from “adm_audit” … Read the rest “Django, Informix, ibm_db and DB2 data server driver”
Update iSeries DATE/TIME/TIMESTAMP columns from .Net
I have a .Net application using EF4 and both DB2 LUW and iSeries.
When we run a command on the DB2, we clone the original command into a new iDB2Command, copy the parameters, and run. It all works great, … Read the rest “Update iSeries DATE/TIME/TIMESTAMP columns from .Net”
How can I create connection to DB2 in RESTXpress?
I’m using the RESTXpress engine to create REST services. It works fine with Oracle, but I have an issue with db2 database because db2, besides db2jcc.jar driver, requires license jar file db2jcc_license_c.jar.
… Read the rest “How can I create connection to DB2 in RESTXpress?”
Select: add a column based on sub select
I have the following scenario:
Using SQLDbx – database: DB2
The following SQL
WITH priceanddates AS
FROM FPRICE a
SELECT edate, MAX(idx) maxIdx
GROUP BY edate… Read the rest “Select: add a column based on sub select”
How to show only 1 row given 1 column has the same value in SQL
I have a sample output of this right now: Let’s call it table X and attributes x.name, x.title, x.best x.lowest
NAME TITLE BEST LOWEST
——————– ————————- ————— ——-
Andy Aardverk … Read the rest “How to show only 1 row given 1 column has the same value in SQL”
Inserting string in FOR BIT DATA column in DB2
When i try inserting a string value in a column in DB2, which is defined as CHAR(15) FOR BIT DATA, i notice that it gets converted into some other format, probably hexadecimal.
On retrieving the data, … Read the rest “Inserting string in FOR BIT DATA column in DB2”
PHP Zend_Db_Statement_DB2 returns null for static field
I am building my SQL statement through a PHP API, and then passing it through a module that connects to our database (DB2).
My issue: a static field (sales_type) is returning null when passing the SQL through a … Read the rest “PHP Zend_Db_Statement_DB2 returns null for static field”