DECODE() in DB2

does any one know if there is a equivalent function for Oracle's DECODE() in DB2?much ...

Decode equivalent for ODBC

what can I use for the equivalent of Oracle's DECODE thru ODBC connecting to SQL Server?? ...

decode equivalent in MS Access

I have to write a query to display credit card types, however this needs to be done in MS Access. Is there an equivalent function to Oracle's decode in MS Access?select name, decode(creditcard,317,'Amex',455,'Visa'), expiryfrom payments ...

DB2 equivalent of Oracle DECODE function?

Anyone knows how to code an Oracle DECODE with DB2?Looked at COALESCE and CASE but can't seem to figure out if either of thesefunctions accomplish the same as DECODE. i.e.DECODE(t.override_cycle, 0, t.cycle, t.override_cycle )IF t.override_cycle = 0 RETURN t.cycle ELSE return t.override_cycle ...

Equivalent system tables in db2

Hai,What is the equivalent DB2 tables for the following oracle tablesv$sessionv$parameterSys.dba_segments ...

Date Conversion from ORACLE to DB2

i am trying to convert the following query in Oracle to DB2SELECT oid, round(enddate - startdate + 1) NoOfDays from table1What should be equivalent for the part,"round(enddate - startdate + 1)"The result i get the above query in Oracle i get the result as,yy-mm-dd hh:mm:ss:sssI tried using ...

Outer Join in DB2?

I am trying to convert the following SQL from Oracle to DB2.Does anyone know the syntax for the outer join. In Oracle we simply add (+)in the WHERE clause.What is the equivalent DB2 syntax? SELECT T2.keapnm, T2.keapnf, T3.kttbid, T3.kttbnm, T3.kttbnfFROM ktusracc T1, ktapptns T2, kttblmnt T3WHERE T1 ...

Help for accessing DB2 Express C from Java(jsp)

evry1..i am very new to DB2 and IBM platform..i want help to migrate from microsoft sql server 2000 to IBM DB2 Express C...i had developed a project in JSP which is deployed in J2EE 1.2.1 and uses MS SQL Server 2000 as the backend...now i hav to use IBM DB2 as the backendi use the following code in ...

SQL Query Help..

I am new to db2 database and trying to convert a sql statement that works fine on SQL-2000 into db2 database.Basically What I am trying todo is If I have two tables named table1 and table 2, I want to count the number of rows in these two tables and represent the results as two different coloumns in ...

UDF with dynamic sql as argument

Environment : DB2 UDB V8.2/AIX 5.3Background : Application migration from Oracle to DB2How to code an equivalent DB2 UDF having a dynamic sql as an argument to get the count of rows present in the table?Equivalent oracle UDF is as belowcreate or replace FUNCTION row_count_check (sql1 IN VARCHAR2)RET ...

SQL with trailing semicolon failing using JDBC but working using CLI

I have a query that has a trailing semicolon and when I execute the query using JDBC I get an error. The query (note the trailing semicolon) is: CALL SQLJ.REFRESH_CLASSES();The error I get back when using JDBC is:DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=;;LJ.REFRESH_CLASSES();END-OF-STA ...

How to create a DB2 UDB V8.2,ESE Equivalent for Oracle Materialized views.

I want to create a materialized view in DB2 for an oracle equivalent one.The code in oracle is given below:-CREATE MATERIALIZED VIEW BTREAT.MVW_PERIODICUSERCOLLECTIONPCTFREE 10PCTUSED 40INITRANS 2MAXTRANS 255STORAGE (INITIAL 64 KMINEXTENTS 1MAXEXTENTS UNLIMITEDPCTINCREASE 0FREELISTS 1FREELIST GROUPS ...

DB2 equivalent for SET FORCEPLAN of sybase

Set Forceplan is an optimization tool for sybase queries.It is used for Joins in the query. Please let me know if there is any equivalent for this in DB2Thanx ...

DB2 equivalent of Oracle %ROWCOUNT attribute?

Is there an equivalent to the Oracle %ROWCOUNT attribute in DB2.In a DB2 stored procedure I want to obtain the number of rows deleted by a delete statement. Is it possible to do this? ...

Equivalent of MDX in DB2

Hi!! I'd like to know if there is any tool in DB2 that is the equivalent of MS SQL Server MDX.If yes,where can I get it??Presently,I'm using MS Excel Add-in to view reports.Is there a better tool to view and analyze cubes??I'm using OLAP Starter Kit right now.Any suggestions?? ...

db2 - offset equivalent

I am wondering if db2 has an equivalent of postgres "offset" ..."OFFSET says to skip that many rows before beginning to return rows to the client. OFFSET 0 is the same as omitting the OFFSET clause. If both OFFSET and LIMIT appear, then OFFSET rows are skipped before starting to count ...

datediff function equivalent in DB2

I have the following function in MS SQL Server 2000 that I'm trying to convert to IBM DB2:set @elapsed = datediff(ms, @clock, getdate());Can anyone let me know the db2 equivalent of this? ...

NVL , isNuLL equivalent in DB2

I have SQL like select columnname from table t order by NVL(columnname, ' ') ASCAbove query for oracle fetches the null 'columnname' first. Similarly we use isNull() function for SQL Server.Please let me know the equivalent function in DB2. NULLIF does not serve my purpose ...

DB2 equivalent of Oracle Create table ... as select ...

Is their a direct equivalent in DB2 to create a table with a select ?in Oracle it goes somethng like this:create table newtable as Select * from mytable; ...

What is the equivalent function for isnull in db2?

I want to know the equivalent function for isnull in db2In oracle we can use isnull in predicated for fetching the null values, but we dont have same function in db2? is anyother way to fetch null values through any db2 function.udb v8.1 in solarisif any one know please let me know. ...

SUBSTRING_INDEX equivalent in DB2?

Is there a equivalent MYSQL SUBSTRING_INDEX function in Version 7-8 DB2?String sqlQueryString = ("SELECT EVNTID, ENTDATE, DESC, SUBSTRING_INDEX(NOTES, ' ', 2), EVNTNAME FROM " + DatabaseSchema + ".TWBCALENDAR WHERE JULIAN_DAY(ENTDATE) >= JULIAN_DAY('" + startDate + "') OR ...

Equivalent to time datatype in DB2???

do anyone know the equivalent datatype in SQL server to 'time' datatype in DB2? For your information, 'time' datatype allows to store only hh:mm:ss.Appreciate your help.Jake ...

Equivalent to @@TRANCOUNT in DB2

I am migrating SQL Server procedures to DB2. Is there any equivalent to @@TRANCOUNT in DB2, how could i manage to get the eqivalent values in DB2. ...

Equivalent to Oracle's INSTR in DB2 UDB?

In Oracle 8i I can parse a string for the position of a specific character.Position = INSTR(String_To_Search, Character being searched, Start search at position x in String_To_Search, Occurence)SoPosition = INSTR('abcabc', 'b', 1, 1)will return 2 since the first occurence of 'b' when starting the se ...

equivalent of SERIAL for DB2

I'm wondering if an equivalent of the type SERIAL exists in DB2 (V7 or V8). ...

Equivalent of Oracle's %ROWTYPE in DB2

HiI am presently converting a Oracle database to DB2. I have converted almost everything and wrote a Java program for converting %TYPE format too.Now My problem is that I am confused about TABLENAME%ROWTYPE. As its very hard for me to find the DB2 equivalent for the same. For me the most suitable re ...

Equivalent function of Oracle "Instr function" in DB2

I am looking for the funtion in Db2 which is equivalent to INSTR() funtion in Oracle.So far i have looked at funtions "LOCATE" and "POSSTR" in DB2 which provide similar but LESS funtionality than INSTR() in Oracle.I am using DB2 8.0 .Any help will be greatly apprecitaed.the INSTR ...

What is the EQUIVALENT OF NLS_LANGUAGE(oracle) IN DB2

Can anyone help me? I need to know what is the equivalent of NLS_LANGUAGE or NLS_CHARACTER _SET parameter of Oracle in DB2.I want to see the current date in language other than english.say in Arabic , so how do I do that?For your informationthe querySELECT TO_CHAR(SYSDATE,'MON','NLS_DATE_LANGUAGE=AR ...

Sybase's sysprocesses and sysdatabases equivalent in db2

One of the stored procedures in my application(on sybase and now being migrated to UDB DB2) uses the Sybase system tables sysprocesses and sysdatabases to find out the number of connections to a particular database at a given time. The problem with mapping this particular functionality to DB2 is tha ...

Sybase's sysprocesses and sysdatabases equivalent in db2

One of the stored procedures in my application(on sybase and now being migrated to UDB DB2) uses the Sybase system tables sysprocesses and sysdatabases to find out the number of connections to a particular database at a given time. The problem with mapping this particular functionality to DB2 is tha ...

"sp_attach_db" Equivalent for DB2

Does anybody know what is the equivalent of the MSSQL "sp_attach_db" stored procedure for DB2?Basically i am looking for a fast way to create a new database from a template database. With MSSQL i was copying and renaming the db files and then attaching them in the server using the "sp ...

Anything equivalent to nlsparam parameter of to_char of oracle in DB2

Is there anything equivalent to nlsparam parameter of to_char of oracle in DB2.Iam using MTK for conversion from oracle to DB2.There is a UDF ora.to_char with the nlsparam parameter,but then for nls_calendar='persian' value for nlsparam in Oracle,there is no equivalent in ora.to_char of DB2.It retur ...

Equivalent of Group_Concat() in DB2?

I am trying to achieve a result equivalent to the MySQL Group_Concat() (also known as LIST() in some database SQL dialects I think) in DB2.I have a table like this:User ID Group------- -------1 Admin1 Readers2 Admin3 Moderator3 Admin3 ReadersAnd I want to get a result like:User ID Group------- ----- ...

Binary_Checksum() equivalent in db2

What is the equivalent for this Binary_Checksum() function in DB2We are using Binary_Checksum() function over a row of a table to to detect changes to a row of a table in SQL.How to achieve the same in DB2. ...

looking for DB2 function equivalent to INSTR() in Oracle (was "Please Help")

I am looking for the funtion in Db2 which is equivalent to INSTR() funtionin Oracle.So far i have looked at funtions "LOCATE" and "POSSTR" in DB2which provide similar but LESS funtionality than INSTR() in Oracle.I amusing DB2 8.0 .Any help will be greatly apprecitaed.the INSTR() ...

How to convert Oracle Decode statement in DB2

I created a decode statement in Oracle to find out the Total Weekly count. If I run on Monday it should give me the count of prior week group by each weekday. When run on Tue it should give me the count on Monday of current week etc.Please let me know how to write the below statement in DB2 version ...

CLOB Equivalent in DB2 9.1

I was using the following command to show an encrypted value on a particular column on the DB2 7.1select CLOB(column name) from SCHEMA.TABLE_NAME where COL_NAME='value'Apparently the same CLOB is not working in DB2 9.1. Without the CLOB i can see only the encrypted value. Can anyone help me what is ...

RPAD equivalent in db2

i need to know the db2 equivalent query of the following: RPAD( string,17,'X') ...

DB2 JDBC equivalent of oracel.sql.STRUCT and oracle.spatial.geometry.JGeometry?

I'm asking this just to check, because I believe the answer is "no", but in case not, is there a JDBC extension for DB2 that has equivalent classes for oracle.spatial.geometry.JGeometry and oracle.sql.STRUCT?In Oracle, these classes enable you to retrieve data from a spatial column:STRUCT ...

DB2 equivalent for '@' in oracle

In oracle it is possible to run a sql script with the '@' command. What is the equivalent command in DB2? ...

Equivalent of Oracle's DECODE function on SQLServer

What is the equivalent function in SQL server for the DECODE function in Oracle?For example: select decode(customer_type,'B','Business','Non Business')from CUSTOMER_TABLEThis is the function statement that we use currently in Oracle. I need to do this same function in Sql server. ...

Migrate team: Multi-byte equivalent in DB2 for Sql Server NVARCHAR?

I am in the process of adding support to DB2 for our product. I have readthat VARGRAPHIC is equivalent of the NVARCHAR in SQL Server. So, well I wentahead and used VARGRAPHIC in my DB2 code.I have written a few stored procedures which accept VARGRAPHIC as aparameter. It is not working quite well. Th ...

equivalent of SET ROWCOUNT in DB2

Can anyone tell me what the equivalent of SET ROWCOUNT (for SQLServer) inDB2 is? One can limit the number of rows returned by a SELECT by "FETCHFIRST ...ONLY". Is there any way to limit the number of rows affected by aDELETE?KedarN.B SET ROWCOUNT in SQLServer stops processing the query after thespec ...

DB2 Equivalent of Oracle's prompt

In Oracle, you can echo information messages like:prompt "Creating ticket table..."CREATE TABLE ticket)....);Do we have an equivalent in DB2 ? ...

Does DB2 have anything equivalent to NUMBER(0) in Oracle?

Does DB2 support or dynamic precision non-floating point numbers such that no rounding or truncation happens?In Oracle the type to use would be NUMBER(0). The 0 parameter makes it variable-precision, meaning there is no fixed precision. If I insert 1.20 as the value to a variable-precision number fi ...

Anything equivalent to nlsparam parameter of to_char of oracle in DB2

Is there anything equivalent to nlsparam parameter of to_char of oracle in DB2.Iam using MTK for conversion from oracle to DB2.There is a UDF ora.to_char with the nlsparam parameter,but then for nls_calendar='persian' value for nlsparam in Oracle,there is no equivalent in ora.to_char of DB2.It retur ...

Equivalent to time datatype in DB2???

do anyone know the equivalent datatype in SQL server to 'time' datatype in DB2? For your information, 'time' datatype allows to store only hh:mm:ss.Appreciate your help.Jake ...

Sybase's sysprocesses and sysdatabases equivalent in db2

Hi,One of the stored procedures in my application(on sybase and now being migrated to UDB DB2) uses the Sybase system tables sysprocesses and sysdatabases to find out the number of connections to a particular database at a given time. The problem with mapping this particular functionality to DB2 is ...

DB2 Equivalent for Oracle Drop table .. CASCADE CONSTRAINTS PURGE

In DB2 is there any equivalent for Oralce Drop table xyz CASCADE CONSTRAINTS PURGE ...

DB2 9.5 equivalent for DB2 9.7 “cur_commit” setting

Application works well with DB2 9.7 due to “cur_commit” setting and concurrent operation support and our application supports DB2 9.5 also there we facing lot of Deadlock issues.Is there any “cur_commit” equivalent for DB2 9.5 ...