Sunday, May 1, 2011

Microsoft Certified Technology Specialist NET Framework 4 Service communication application




Finally, I have completed this exam :)\

I got in-depth learning and details for the below modules.


  1. A solid understanding of WCF in the context of the .NET Framework 4 solution stack
  2. Experience creating service model elements
  3. Experience using WCF to support open and .NET communication
  4. Experience configuring and deploying WCF applications
  5. Experience using Visual Studio tools, tracing tools, SvcUtil, WCF performance monitoring, and IIS/WAS for hosting services
  6. Experience securing WCF applications
  7. A solid understanding of concurrency

Thursday, April 21, 2011

Compare Date in oracle with date time



select * from TableName c
where c. id = 25326424
and c.time_create= to_date('4/21/2011 3:43:24 PM','mm/dd/yyyy:hh:mi:ssam')

Wednesday, April 20, 2011

Some Important operation in DUAL table



1) SELECT greatest(12,54,2,75,142) from dual;
2) SELECT level as ID
FROM DUAL
CONNECT BY level < 101
3) select 5 * 6 from dual
SELECT USER FROM DUAL
SELECT COUNT(*) FROM DUAL;
INSERT INTO DUAL VALUES ('X');
4) select 'test' from dual;
5) select object_name, owner, object_type from dba_objects where object_name = 'DUAL';

How to generate random number in oracle





SELECT greatest(12,54,2,75,142) from dual;

select output,
       count(*)
from   (
       select round(dbms_random.value(1,9)) output
       from   dual
       connect by level <= 1000000)
group by output
order by 1

1   62423
2   125302
3   125038
4   125207
5   124892
6   124235
7   124832
8   125514
9   62557

SELECT MOD(Round(DBMS_RANDOM.Value(1, 99)), 9) + 1 FROM DUAL

How to get max value in oracle



Sample Query to get Top n Record from oracle

Select * from tableName where FiledName =”” and rownum<=5

The above statement will give u top 5 record
rownum<=5

A few more queries -


Not in

SELECT 'TRUE' 
    FROM emp 

    WHERE deptno NOT IN (5,15); 


LIKE Operator

SELECT sal 
    FROM emp 

    WHERE ename LIKE 'SM%';

Case Sensitivity and Pattern Matching

UPPER(ename) LIKE 'SM%'

Oracle UNION Example 

SELECT part, partnum, to_date(null) date_in
    FROM orders_list1
UNION
SELECT part, to_null(null), date_in
    FROM orders_list2;

Oracle UNION ALL Example 
Result - SELECT part 
    FROM orders_list1 
UNION ALL 
SELECT part 
    FROM orders_list2;

MINUS Example

SELECT part 
    FROM orders_list1 
MINUS 
SELECT part 
    FROM orders_list2;

INTERSECT  Example
SELECT part 
    FROM orders_list1 
INTERSECT 
SELECT part 

    FROM orders_list2;




The Oracle DUAL table



dual is a table which is created by oracle along with the data dictionary. It consists of exactly one column whose name is dummy and one record. The value of that record is X.

rene@ora92> desc dual
Name Null? Type
----------------------- -------- ----------------
DUMMY VARCHAR2(1)

rene@ora92> select * from dual;

D
-
X

The owner of dual is SYS but dual can be accessed by every user.
As dual contains exactly one row (unless someone fiddled with it), it is guaranteed to return exactly one row in select statements. Therefor, dual is the prefered table to select a pseudo column (such as sysdate

select sysdate from dual

Although it is possible to delete the one record, or insert additional records, one really should not do that!.
-------------------------
Note that the outer query references the dummy table called “dual” the dual table is used in Oracle when you need to run SQL that does not logically have a table name. For example, we can select our current user ID from dual and the current date from dual.


select user from dual;

USER
------------------------------
PUBS

select sysdate from dual;

SYSDATE
---------
27-MAY-02


We can also use the dual table for date arithmetic. This last query displays the day of the week for any date in the past 1,000 years. To see the day of the week that you were born, copy this query into your c: directory, add your birth date, and run the query see what day of the week you were born on.


select
to_char(to_date('25-MAR-1956','dd-mon-yyyy'),'day')
from dual;

TO_CHAR(T
---------
sunday