db2

db2 stored procedure. locking / releasing table

I use a stored procedure to read/update/return certain fields in a journaled as400 table. I want to lock the table first and then release it after the record is updated. I tried tons of stuff, but releasing table is a problem. SP defines and opens cursor, selects record into variables and updates the record. I tried 'begin atomic', th...

DB2 Print analog

What's the DB2 Version of TSQL Print? I've tried Print 'TableName:X' And Select 'X' As 'TableName' ...

DB2 SQL code to extract stored procedures

My colleagues and I have several hundred SQL stored procedures sitting on a hosted DB2/z database (version 8.1). We have no administrator rights and our access to the database is via QMF screens. Downloads are done through the 3270 terminal session with the TSO FT command. Is there a simple/efficient way to extract the definitions/text ...

Using LINQ to Entity Framework with DB2

Is there an IBM Driver so we can use Linq to Entity framework to connect to DB2 and generate the DB2 entities on the desinger edmx file? Any links would be greatly appreciated ...

Free Access to DB2 via ODBC

Is there a free option to connect to DB2 via ODBC on within my .NET app? I believe the most common ways require a license: Data Direct $$$$ IBM Client Access Host Integration Server I just want to install an ODBC driver that I could access from a C# app. ...

I have to unload a table which contains field with ROWID datatype. I could not unload the table through QMF as it is not supporting this data typr. Is there any other way to unload the table?

I have to unload a table which contains field with ROWID datatype. I could not unload the table through QMF as it is not supporting this data typr. Is there any other way to unload the table? ...

If we have a view over another view and we drop th eparent view what happens to the other vie

If we have a view over another view and we drop th eparent view what happens to the other view and if we recreate teh base view wil the second view be active again ...

In DB2, is it possible to have just a single trigger for both update and insert?

I have to create the trigger(s) which will keep the audit of my table. The trigger is supposed to execute on both insert and update. currently i am having two triggers One for Insert: CREATE TRIGGER SCH.TRG_TBL1_AFT_I AFTER INSERT ON SCH.TBL1 REFERENCING NEW AS n FOR EACH ROW MODE DB2SQL INSERT INTO SCH.TBL1_AUDIT VALUES(...

update a table in db2 row by row from .net...

I perform some actions on a table retrieved from a db2 database row by row in a C# project. but when I try to update it using cursors row by row to the database using the following statement selectCommand.CommandText = "DECLARE crsr1 CURSOR FOR select * from " + tableName+" ;" , an exception is generated. From my understanding of this...

SQL (DB2) Return multiple conditional counts in a single query

I am trying select multiple conditional summaries into a single table result on a DB2 based database. Example: SELECT COUNT(FOO) FROM T1 WHERE T1.A=1 AS A_COUNT, SELECT COUNT(FOO) FROM T1 WHERE T1.B=2 AS B_COUNT Ext... Any help is appreciated. ...

Is JDBC capable of handling huge database?

I am working on a project, which is having huge database. [ around 32gb data in one week ]. We are using DB2, and spring-framework + jdbc. I just wanted to know is JDBC capable of handling this much of data? Or should i use something else? Or if JDBC is capable of doing this then should i use some specific technique for this thing. ...

DB2 Auto generated Column / GENERATED ALWAYS pros and cons over sequence

Earlier we were using 'GENERATED ALWAYS' for generating the values for a primary key. But now it is suggested that we should, instead of using 'GENERATED ALWAYS' , use sequence for populating the value of primary key. What do you think can be the reason of this change? It this just a matter of choice? Earlier Code: CREATE TABLE SCH.TAB...

Problem with preparedStatement

Excerpt from code PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM sch.tab1 where col1 like lower ( 'ABZ' ) "); preparedStatement.executeQuery(); The above code executes successfully. But when i try to execute this PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM sch....

Can a query from an Oracle to a DB2 through a dblink block the DB2 table?

I have a middle size query with 500.000 registers from an Oracle to an DB2 system through a DBLink. Can this query block the DB2 table so that it can be updated until i close the DBLink or until i finish the job whith the query (an insert-select into an Oracle table) ...

Datatype conversion in IBM DB2

I'm writing a query to do some stuff. But its not working the way I want it to: select CORR_ID from TABLE1 where CORR_ID not in (select id from TABLE2) The problem is, TABLE2.id is a long, while TABLE1.CORR_ID is a string. So how can I make it work? PS: I'm using IBM UDB. ...

Is Pylons enterprise-ready?

I am a developer who is looking for an Enterprise-ready web application framework for Python. My main concern is long-term support, extensive feature set and reliability. I have been experimenting with Pylons and after my horrendous experience with Ruby on Rails on Windows where I even had to compile my own Postgres driver, Pylons and P...

getting row count in db2 using system tables ?

howdy! I can get row count from system table in db2 using select tabname,card from syscat.tables where tabname='?' but this will give static row count,If I need to get dynamic one I need to run runstats on the table. is there any other way apart from using count(*) ? Cheers, Prateek ...

DB2 web OLAP Viewer

Does anybody know of a web based something that would allow end users to interact (change selection) for an OLAP cube on DB2 ...

Exporting result of select statement to CSV format in DB2

Is there any way by which we can export the result of a select statment to CSV file, just like in MySQL. MySQL Command; SELECT col1,col2,coln into OUTFILE 'result.csv' FIELDS TERMINATED BY ',' FROM testtable t; ...

How do I create control tables in DB2 UDB for setting up new replication

How do I create control tables in DB2 UDB for setting up new replication ...