I would suggest you to visit DB2 Migration Portal.
http://www-01.ibm.com/support/docview.wss?rs= 71&uid=swg21200 005
User Profile
Collapse
-
# SET V_TABLE = 'concat(''FL_TI ME_DIM'',(selec t Value from table ))'
You cannot have any SQL like SELECT * FROM contact('a', 'b').
Instead, you can have these values concated before the SELECT itself and try.Leave a comment:
-
-
are you sure that you are getting 440 code from this PREPARE only??
As far as my knowledge is concerned, it should not happen at precompile time atleast. Are you getting this error at run time or compile time??Leave a comment:
-
Oh I am sorry, you can truncate the table conditionally.
I would suggest you to use DB2 partitioning features like Range partitioning, MDC etc. This will boost your performance drastically. Just in fractions of seconds, you can actually delete huge data.
Let me know if you need more details regarding this. I would be more than happy to share.
Regards
-- SanjayLeave a comment:
-
You can truncate the table. By the way, which DB2 are you running?
As such, there is no command like truncate in DB2. But I am sure you would like to know how it can be done in DB2. For that, I would suggest you to refer to the sample: sqllib/samples/admin_scripts/truncate.db2 script.
This will surely solve your problem.
Regards
-- SanjayLeave a comment:
-
It would be helpful if you can provide some additional information like what is the problem that you are facing.
1. Use 'db2level' command to get the database version.
2. You can also refer to some of the samples that are shipped with DB2. You can find them at SQLLIB/samples directory.
(I am sure I didn't answered ur question....... .. :( )
Regards
-- SanjayLeave a comment:
-
sakumar9 replied to Need example for accessing Resultsets from COBOL DB2 Stored procedures from Javain DB2I would strongly recomment you to visit SQLLIB/samples/ directory. Many samples in various languages are shipped with DB2. You will find samples for IBM cobol as well as mf cobol along with other languages.
Let me know if you have any difficulties in accessing them.
Regards
-- SanjayLeave a comment:
-
By the way, you can run db2look on a set of schemas as well. Maybe you can try excluding SYSCAT schema of possible.
Complete syntax might help.
http://publib.boulder. ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw .admin.cmd.doc/doc/r0002051.htmlLeave a comment:
-
You can call EXPORT command from a shell script, EXPORT will write the table data into files.Leave a comment:
-
You can use FETCH FIRST n ROWS ONLY clause.
Code:SELECT EMPNAME, SALARY FROM EMPLOYEE ORDER BY SALARY DESC FETCH FIRST 100 ROWS ONLY
Regards
-- SanjayLeave a comment:
-
Checkout this link, it will help you a lot.... (not sure if you already have it)
http://www.ibm.com/developerworks/ondemand/migrate/db.html#sybase
Regards
-- SanjayLeave a comment:
-
1. If you want to make this new database as the standby for another server, then I am not sure if you can do this. The requirement for standby server is: it should have same configuration as well as the directory structure as primary.
2. You can try "db2move" utility.
Regards
-- SanjayLeave a comment:
-
You need to catalog the ZOS db on your windows machine. You can refer to the following commands:
Code:db2 catalog tcpip node <name> remote <ip address> server <service> ostype mvs db2 catalog dcs database <dbname> as <dbname> db2 catalog database<dbname> as <dbname> at node <node-name> authentication DCS
Leave a comment:
-
The first thing that you have to do is to start the database manager. The error says: Database manager was not started. Use "db2start" command to start the database. Then use "CREATE DATABASE TEST" to create the database.
If you want to play around with sample tables and sample data, then you can use "db2sampl" command. This will create a database with name "SAMPLE" and will create many tables...Leave a comment:
-
You can follow these steps:
1. If your stored procedure is in any external language like C, Java, cobol etc, then compile it and paste the object file in sqllib/functions directory.
Recommended method: Go to sqllib/samples directory. Then go to the directory corresponding to the language in which you have written stored procedure. And give following command:
bldrtn <filename> --- Filename should be without...Leave a comment:
-
Yes, it is possible to have table/column names as variables. In that case, you will have to use dynamic statements to execute the commands. For example:
...Code:CREATE PROCEDURE test (IN tabname CHAR(6)) LANGUAGE SQL BEGIN DECLARE stmt VARCHAR(1000); SET stmt = 'INSERT INTO '|| tabname || 'values (1)'; PREPARE s1 FROM stmt; EXECUTE s1;Leave a comment:
-
Prior to DB2 9.1, we needed XML extenders to deal with XML documents. It was an add-on product. Not with DB2 9.1, we don't need any extender. DB2 9.1 has powerful hybrid engine which is capable to handle XML and non-XML documents very efficiently.
Regards
-- SanjayLeave a comment:
-
To set the default instance, you need to change the value of DB2INSTANCE variable.
If you don't want to change it always, then you can go in System Properties--> environment variables and change the value of this variable. This will permanently change this value, so you don't have to set it every time you logs in.
Regards
-- SanjayLeave a comment:
-
You can try this stored procedure:
RegardsCode:DROP PROCEDURE remove_duplicate @ CREATE PROCEDURE remove_duplicate() LANGUAGE SQL BEGIN CREATE TABLE t1 LIKE a; INSERt INTO t1 SELECT DISTINCT(a) FROM a; DELETE FROM a; INSERT INTO a SELECT * FROM t1; END @
-- SanjayLeave a comment:
No activity results to display
Show More
Leave a comment: