28 October 2009

0 confirmation

This post confirms my ownership of the site and that this site adheres to Google AdSense program policies and Terms and Conditions.
Read More...

02 October 2009

0 SQL Tutorial - Decrease the retrieval time from database using Multiple threads

SQL Tutorial - SQL Tip - Decrease the retrieval time from database using Multiple threads

How To  decrease the retrieval time while retrieving data from a table from database?

Normal retrieval query  :    

select  *  from user_info
     since user_info table having vast amount of data it will take lot of  time to retrieve entire data.

Query with Multi threading

select  /*+parallel(8)*/   *   from user_info
       8 in parenthesis represents number of threads. It will invoke 8 threads  and execution will happen on 8 threads in parallel. Comparatively this query using multiple threads will take less time  than the earlier query. Query with Multi threading will help us to reduce the execution time while fetching large number of records.
Read More...

0 SQL Tutorial - Loading data from a text file

SQL Tutorial - SQL Tip - Loading data from a text file

How can I load data into table from a .txt file?

You can load data into table from a .txt file using the below command.

LOAD DATA LOCAL INFILE <.txt file >
INTO TABLE <table_name>  FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n';
The data file should have the fields terminated by ‘,’ and lines terminated by '\r\n';

For Example
Say, the required input file "user.txt" is in the location C:\

LOAD DATA LOCAL INFILE 'C:\\user.txt'
INTO TABLE user_name  FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n';
Read More...

5 DB2 Tutorial - Making the primary key auto incremental in DB2

DB2 Tutorial - DB2 Tip - Making  the primary key auto incremental in db2

How to make a field auto incremental in DB2?

The following query example will show you how to set a field as Auto-increment field in DB2
create table WCSADM.itemlist
(
   ITEMLIST_INDEX         Integer          GENERATED ALWAYS AS IDENTITY,
   RESULTCODE      VARCHAR(254),
   ADDLINFO      VARCHAR (254)
)
Read More...

1 SQL Tutorial - Insert Zero in the auto incremental field

SQL Tutorial - MySQL Tips1 - Inserting Zero in the auto incremental field

How to insert a " 0" or zero value in the auto incremental column of MySQL ?

The following query will be setting Auto-increment to start from 0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";

This will allow us to insert value zero in the auto incremental column which otherwise can only begin with atleast 1. This change should in no way affect the existing auto-incremental values.
That is, Auto increment value will start from 1 itself but we will be able to insert a record with 0 in the auto increment column.

Read More...

0 AJAX Tutorial onComplete event of Ajax Updater

AJAX Tutorial - Tips1 - onComplete event of Ajax.Updater

How to ensure that a function or action is called only after the successful execution of the AJAX call ?

Ajax updater has onComplete callback, which will be executed after the successful execution of the AJAX call. This will help to prevent AJAX updater success action before the successful execution of the AJAX call.

new Ajax.Updater('searchResults', 'items/seachItems.html', {
      parameters: {
            searchTerm: p_searchTerm,
            searchTermValues: p_searchTermValues,
            pageIndex :p_pageIndex,
            startIndex : p_startindex,
            endIndex :p_endIndex
      },
      onComplete : function updateValues(){
            updateValues1(p_startindex,p_endIndex,p_pageIndex);
      }
});
On the Event "onComplete", the function "updateValues()" will be executed, which in turn can call any function in the script.
Read More...