Tuesday, December 8, 2009

Interview Q?

Dynamic sql:
Dynamic SQL is generally used for sending SQL statements to the database
manager from interactive query building graphical user interfaces and
SQL command line processors as well as from applications where the complete
structure of queries is not known at application compilation time and
the programming API supports dynamic SQL.

ynamic SQL can be used from the following interfaces:
Applications and external routines that employ APIs that support dynamic SQL including: Embedded SQL, JDBC, CLI, ADO.NET
Interactive DB2 GUI interfaces including: DB2 Command Editor in the DB2 Control Center
DB2 Command Line Processor
DB2 Command Windows


Commit inside trigger:

Yes, We can used commit inside trigger.
For that required to use set pragma_ananomous on;

Wednesday, October 7, 2009

Some Q....

Diff between Union and union all is:
Union: select all distinct values from 2 tables.. and
Union all: select all values from both tables

you all know. Then you try this one
Q1.
select all column_name from table1 Union
select all column_name from table2.

guess what is the result? ..
.........................

Q2.
select distinct column_name from table1 Union All
select distinct column_name from table2.
what is the result? ..

try out find the result .....