Wednesday, December 30, 2009
Maximizing Revenue - Web2.0 & Business Process Management
While browsing through the internet i started to think about Web 2.0, Business process, System Integration, System availability, Business Continuity, Customer Satisfaction, faster time to market, more and more!!!..
To a corporate person all these different terms means the single concept, "Maximize Revenue". I am planning to post a series of article on this business concept "Maximize Revenue" linking it to a IT process.
I talked about a web2.0 & business process management in one of my earlier blogs posted here.
Thursday, December 24, 2009
ORACLE Bulk Update from C#
The alternative way of handling bulk updates is through utilizing ORACLE custom packages & C# ORACLE ODP.NET provider. The idea is to group all the data necessary for updates into an Array, hand it over to ORACLE in a single connection from C# utilizing ODP.NET and let ORACLE loop through the bunch of data and update it accordingly.
ORACLE Custom Package
In oracle we can create a custom package of CHAR array or INT array.
CREATE OR REPLACE PACKAGE ARRAY_PACKAGE AS
TYPE REF_CUR IS REF CURSOR;
TYPE CHARARRAY IS TABLE OF VARCHAR2(50) INDEX BY BINARY_INTEGER;
TYPE INTARRAY IS TABLE OF INTEGER(38) INDEX BY BINARY_INTEGER;
TYPE DATEARRAY IS TABLE OF DATE INDEX BY BINARY_INTEGER;
END ARRAY_PACKAGE;
/
The package can be utilized as an input parameter for the stored proc as shown below.
CREATE OR REPLACE PROCEDURE BULK_UPDATE_DATA (
p_Input_Value_Emp_Id Array_Package.Chararray,
p_Input_Value_Emp_Salary Array_Package.Chararray,
)
IS
BEGIN
DECLARE
DECLARE
BEGIN
FOR i IN p_Input_Value_Emp_Id.FIRST .. p_Input_Value_Emp_Id.LAST
LOOP
UPDATE EMP_TABLE
SET EMP_SAL_COL= p_Input_Value_Emp_Salary(i)
WHERE EMP_ID_COL= p_Input_Value_Emp_Id(i);
END LOOP;
COMMIT;
END BULK_UPDATE_DATA;
END;
/
ODP.NET for calling the proc
Well, we have created the ORACLE package/procedure above and we need a mechanism to invoke the procedure from C#. The default Microsoft Oracle provider does not have the necessary interfaces to pass the array to a ORACLE procedure.
The ODP.NET interface provides a collection type called PLSQLAssociativeArray which enables the C# app to pass the Array of value to the ORACLE CHAR ARRAY package.
Through ODP.NET provider, we can set the data type & Collection type of the input paramter as below.
OracleParameter parm1 = new OracleParameter();
parm1.OracleDbType = OracleDbType.Varchar2;
parm1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
So in the above snippet, the input parameter parm1 is of type varchar (string) and the collection is associative array. In simple term, the parm1 is a string array.
Once the parameters are set to match the stored proc we have defined above (BULK_UPDATE_DATA), we just need to add the parameters to the connections command object and invoke the connection.
The complete C# program to invoke the oracle procedure "BULK_UPDATE_DATA" will look like the one given in the image below.
With the next .NET/VS upgrade (.NET4.0/2008) microsoft is getting away with the support for Microsoft's default ORACLE provider and will become deprecated (i have a posting on June that details about microsoft's oracle provider support. please click here to read more ) . So it is good practice to build the new applications that are interfacing with ORACLE using ODP.NET provider.
Friday, December 11, 2009
Music in CLOUD - Apple's strategic move
With the recent purchase of LALA media, an online music provider, there will be a big shift in the way the Apple delivers content. That's correct, Music from CLOUD.
May be the entire technology industry is witnessing a move towards WEB3.0 - CLOUD services.
Thursday, November 26, 2009
Cloud Computing
In the traditional application development model, if there is a need to develop and host a internet facing applications, we need to do the capacity, infrastructure, security planning and purchase hardwares (windows, unix, websphere servers) and softwares. The process of setting up the infrastructure takes few weeks to couple months since it has to go through neccessary approvals and budgetary constraints of the organization. Lets say we crossed the first bottleneck of acquiring hardwares/softwares, the next hurdle is having the infrastructure laid down by the network group and setting up the secure environment with the Militarized zones for security purpose. Also a point to note is, if the application is mission critical and have heavy volume online transactions the capacity planning will also include the details for load balancing of the servers and the infrastructure design and environemnt set up has to account for the installation of load balancers.
Also cost wise in the traditional model, its very expensive to maintain and manage the infrastructure. The project will incur an annual maintanance cost for the servers, licenses and support to install patches and upgrades.
I think i am throwing things that is pretty normal in IT organizations. Well, the cloud computing provides a relief to all these hurdles.
The cloud computing provides the infrastructure and technology facilities over the internet. So the project team doesn't need to worry about establishing the infrastructure. The technology infrastructure is abstracted from the application development. We just need to know the type of infrastructure required for the application (For eg: windows 2008 , unix with ORACLE 10g etc.,). Once the type of technology infrasture has been determined, we can install/set up the hardwares/softwares through couple of mouse clicks and the instances will be ready to use. The infrastructure set up takes around 10-20mins and you are all set to begin development/deployment.
The cloud computing alleviates the effort/cost required to set up the infrastructure and also saves the maintanance cost. One more good thing about cloud computing is the cloud service providers automatically patche the instance/server and its free of cost.
One more point to note in cloud is, if for any reason the application requires additional servers/processing power, adding few more instance to the existing instance is pretty easy. For ex; lets say if the application requires few additioanl processing power from 8AM-5PM and can run with the normal processing power during the rest of the day, the cloud computing provides elastic facility to expand/contract the computing capacity of the server.
From cost perspective, we pay for what we use in terms of computing facility.
I was playing around with Amazon Elastic cloud and was suprised to see that within few mouse clicks i was able to mount the Unix with the ORACLE 10g database instance.
There are several providers in the cloud space but i just looked at services provided by Amazon and its extra-ordinary.
Monday, November 23, 2009
Web 2.0 & Business Process Management
The telecom industry has eliminated the paper submission of application forms for new telephone/wireless connection to online submission and paper bills to electronic bills. The form submitted online is integrated with the Ordering system whereby the orders are keyed in for a customer. The created order flows through the provisioning system where the order is assigned to a network technician for physically establishing the connection to the home. Once the technician completes the order, the call charges are calculated in the Rating system and supplied to a billing system where the bills are generated and posted online for customers review and payments.
The financial services [banking] industries has integrated online submission of mortgage forms with the business process of credit approval. When the customer submit the mortgage form online, the process flow through validating credit history & residential address. Upon credit approval, the business process is coupled with the quote generation for customers review. Once the customer approves the quote online, the customer will be recieve the credit and the bills for mortgage payments are generated online for customers review and payment.
The other major financial services industry is insurance and the business process is tightly integrated with the technology. The insurance companies are promoting the sales online by selling the products through websites. When the customer requests for quote for a policy, the customers primary medical details are collected online. The medical history is verfied with medical information board and the underwriting engine generates the quotes for underwriters review based on mortality/medical history. The quotes are released by underwriters for online review of customers/policy owners. When the customer agrees for the insurance quote, the quote is converted to a policy and the policy is available online for the customers.
We can speak a lot about Web 2.0 and integration of business process management. But the ultimate benefit to the businesses are:
> Reduction in expenses incurred for paper mail
> Quickers sales
> Faster realization of cash/payments from the customers
> Reduction in manual intervention in the business process & hence decreased errors.
> Effective collection of data for generating potential leads
> Environmental friendly business
Monday, November 16, 2009
CNBC - Interview with Gates & Buffett
I admire Mr.Buffett's strong statement about investments on education. He said he will be ready to invest $100K to his employee to go to business school as they will be worth $1M after completion of business studies. He also added that he will invest another $50K for improving communication skills and their net worth will be $1.5M.
A question was asked about Mr.Gates view on "Apple". Mr.Gates responded by applauding Steve jobs for his entreprenurial skills in bringing the Apple back on track once he rejoined the Apple when the companies sales & profits were declining.
Mr.Gates also indicated that Steve jobs brought the competition in the Software/Hardware market by introducing Mac's & iPods.
My take on the entire interview was
Success doesn't come free. You need an investment to become successful. Investment in education, investment of time, investment in research & development always fetches good results regardless of world & economic conditions. For ex; An investment banker will only be successful, only if they invest their time to research the market position, conditions, portfolios before investing in the stocks.
Mr.Buffett indicated that he studied the Moody's 1000 pages rating book twice before doing his first investment.
Thursday, November 12, 2009
GridGain for Elastic Computing
Auto Scaling - Scale up/down based on the computing load
Data Grid - Split the storage across node
But it doesn't come free of cost. The enterprise edition of GridGain has these great feature and its pay per usage (On top of what we pay for Amazon). I asked the question about how to justify the pricing for the usage of GridGain on top of Cloud cost. The presenter explained that the open source version has lot more features like automatic on/off cloud, compute on the cloud etc., But the enterprise edition has more features which will be required by large organization that requires faster computing and data load power.
Tuesday, November 10, 2009
ORACLE Analytics functions
Upon research we discovered that the ORACLE Analytic functions can do whatever the native SQL function does with a better performance.
The requirement was to filter the unique user id, user number from the user profile table with the latest user entry and the result should be group by User Number. For Ex; the query should return the Mohan4 & Mohan 3.
UserId | User_Number | Latest_Entry | Options |
---|---|---|---|
Mohan1 | 1 | Nov-06-2009 | Y |
Mohan2 | 1 | Nov-07-2009 | N |
Mohan3 | 2 | Nov-09-2009 | Y |
Mohan4 | 1 | Nov-10-2009 | N |
The result can be obtained by GROUP BY Clause, but the problem is we can only retrieve GROUP BY Columns. The non-group by columns will not be retrieved in the GROUP BY clause.
We utilized the ORACLE Analytics functions to overcome these difficulties with performance, Group by issue etc, So our query looked like,
(SELECT USER_NUMBER, USER_ID, LATEST_ENTRY, OPTIONS
FROM
(SELECT USRINF.*, ROW_NUMBER() OVER (PARTITION BY USER_NUMBER ORDER BY LATEST_ENTRY DESC) RANK
From DB_SCHEMA.USERINFO USRINF WHERE LATEST_ENTRY IS NOT NULL
ORDER BY LATEST_ENTRY DESC
)
WHERE
1=1
AND RANK=1
);
In the above query, the clause “PARTITION BY” groups the results based on the column name indicated next to it. In this case, it is acted on the column USER_NUMBER. The subquery in the above query
SELECT USRINF.*, ROW_NUMBER() OVER (PARTITION BY USER_NUMBER ORDER BY LATEST_ENTRY DESC) RANK
From DB_SCHEMA.USERINFO USRINF WHERE LATEST_ENTRY IS NOT NULL
ORDER BY LATEST_ENTRY DESC
Will display the result as
UserId | User_Number | Latest_Entry | Options | ROW_NUMBER() |
---|---|---|---|---|
Mohan1 | 1 | Nov-06-2009 | Y | 3 |
Mohan2 | 1 | Nov-07-2009 | N | 3 |
Mohan3 | 2 | Nov-09-2009 | Y | 1 |
Mohan4 | 1 | Nov-10-2009 | N | 3 |
The outer query filters the unique first record from the result set described above ordered by descending of the Latest_Entry column. So the result set of the final query will be
UserId | User_Number | Latest_Entry | Options | ROW_NUMBER() |
---|---|---|---|---|
Mohan3 | 2 | Nov-09-2009 | Y | 1 |
Mohan4 | 1 | Nov-10-2009 | N | 3 |
Monday, September 21, 2009
ORACLE 10g - Merge Into statement
ORACLE's merge statment performs the update/insert through a single statment. Through the merge statement, the validation or check can be made before update/insert. For eg: The following merge statement will update the table EASTable when the userid matches with the input. If the user id is not present in the table, the input user information will be inserted.
MERGE INTO EASTable EAS
USING DUAL
ON ( EAS.USER_ID = USER_ID_INPUT)
WHEN MATCHED THEN
UPDATE SET EAS.IND1 = IND1_INPUT
EAS.IND2 = IND2_INPUT
WHEN NOT MATCHED THEN
INSERT
(EAS.USER_ID, EAS.IND1,EAS.IND2)
VALUES (USER_ID_INPUT,IND1_INPUT,IND2_INPUT);
COMMIT;
Monday, June 22, 2009
Enhance ASPX Page load performance
To improve the page load time, we could consider the following options as well.
Compressing the JavaScript
Compressing the CSS
But the issue with the compression technique is the overhead in debugging.
Friday, June 19, 2009
System.data.oracleclient - Deprecated in .NET 4.0
It has been recommended to make use of microsoft's parter component to substitute the System.Data.OracleClient.
One of the options to consider is using "ORACLE ODP.NET". This component has some issues with respect to performance, errors etc.,
Friday, June 12, 2009
Jquery Part 4 - AJAX method call through JQuery
The above code has many components associated with it. $document.ready will determine whether the HTML is loaded completely and rendered. The next function $('#btn1').click will bind the click event to the function following that. So the scripts within the click function will execute when the user clicks the button btn1.
The next line indicates that we are making an ajax call to the web service url "
jqueryAjax.aspx/GetWebServiceResult". The type parameter indicates the request type GET/POST. The data parameter can be used to pass the input parameter to the server side method. In this example the server side method is GetWebServiceResult. So the method declaration will have a tag [WebMethod] on the method's declaration. This method expects an input parameter of type int and it will pass the parameter recieved from client into the web service. From the client side we will pass the value to this method through data parameter in JQuery.
The contentType and dataType parameter will indicate the type of data transferred between client and server.
When the button is clicked, the client side code will execute and invokes the server side method and pass the input parameter to fetch the result. The server side method in turn will invoke the web service and the result is passed in the object "msg". If the AJAX call is successful, the Success function is invoked. If the AJAX call is failed, the failure function will be invoked.
The BuildHTML method will parse the web service results and display in the HTML.
So it is EASY :), No More UpdatePanel, ScriptManager!!!
Monday, June 1, 2009
WCF and RESTFul Service
Saturday, May 30, 2009
SQL Server 2008 Training in Texas
The registration can be made thrugh TCU's site. Click here to register
SQL Class Date:
June 20th from 9 am to 4 pm
June 21st from 1 pm to 5 pm
June 27th from 9 am to 4 pm
June 28th from 1 pm to 5 pm
Thursday, May 7, 2009
PLINQO - Plano,TX Training updates
The presenters did a great job of demonstrating the PLINQO libraries and its benefit over microsoftjavascript:void(0)'s LINQ.
The greates feature i liked about this component is its ability to dynamically sync up with the database object and Batch Querying.
To learn more about PLINQO please visit the website PLINQO
Wednesday, May 6, 2009
ORACLE Fusion Dev platform
Tuesday, May 5, 2009
JQuery - Part 3 Dynamic object loading
The powerful feature of Jquery selectors combined with CSS scripts enables the client side loading of controls with less coding/effort.
I recently incorporated this featur in one of the projects where we had a requirement to dynamically change the image at run time based on the result set from the database query. I would not want to write server side code to determine the image, Instead i started to research about loading the image through Jquery selectors.
The project required to load the image at one of the table column < td >.
I declared a placeholder client side div with a id "loadImage".
"< td >
< div id="loadImage" >
< %# DataBinder.Eval(Container.DataItem, "Flag").ToString().Trim()% >
< /div >
< /td >"
On the document ready event i wrote the Jquery funtion which will locate the position of the DIV and load the image on the particular DIV as below.
$(document).ready(function() {
$('#tbl_temp tr').each(function() {
var valueee = $(this).find('div');
var txt = jQuery.trim(valueee.text());
var imgSrc = "";
if (txt == 'G') {
imgSrc = 'images/green_icon.gif'
}
else if (txt == 'O') {
imgSrc = 'images/gray_icon.gif'
}
else {
}
if (imgSrc.length > 0) {
var img = new Image()
$(img) // once the image has loaded, execute this code
.load(function() {
//debugger;
$(this).hide();
valueee
.empty()
//.text = '';
// remove the loading class (so no background spinner),
// then insert our image
.append(this);
//debugger;
// fade our image in to create a nice effect
$(this).fadeIn();
}) // if there was an error loading the image, react accordingly
.error(function() {
// notify the user that the image could not be loaded
})
// set the src attribute of the new image to our image
.attr('src', imgSrc)
.css({ 'border': 'none' });
}
})
});
Saturday, April 18, 2009
REST Services
Microsofts ADO.NET Data Service is build on the REST framework. There are some good webcasts and article about the ADO.NET data service in Microsoft website and its worth watching.
Sunday, April 5, 2009
Jquery part 2 – Selectors
The DOM elements can be selected with the Jquery function “$” or “jquery”. For example, the hyperlinks in the HTML pages can be retrieved using the selector $(a).
Following are the few examples of sample selectors that are very useful for DOM manipulation.
a – Retrieves all anchor links with the tag < a >.
#DOMElementID – Retrieves the DOM element with the id “DOMID”.
.DOMElementClass – Retrieves the DOM elements with the class “DOMClass”.
P a.DOMElementClass – Retrieves the DOM element links with the class “DOMClass” embedded within the tag < p >.
Ul > Li > a – Retrieves links which are children of list element
A[href^=http://] – Retrieves links with an href value beginning with http://.
Div[type=text] – retrieves html text box.
P:odd – retrieves every odd paragraph elements.
Li:last-child – retrieves last child < li > of each < ul > element.
:radio:checked – retrieves radio buttons in the DOM that are checked.
:checkbox:checked – retrieves checkboxes in the Dom that are checked.
Input:not(:checkbox) – retrieves input elements from the DOM except checkboxes.
Wednesday, March 18, 2009
JQuery - Part 1
Typically, the JavaScript was considered to be a clumpsy and difficult language to be used in the application development. The applications were designed to make use of javascript to support the validations, styles but the effort required to fix the browser compatibility superseded the benefit of client side scripting. Before the discovery of CSS the applications were developed by coupling the functionality and structure (HTML) together.
< type="button" id="”btnClick”" onclick="document.getElementById('txtName’).style.color='blue';">
Please click here
< / button>
The addition of CSS in the web development world allows us to separate the structure from the stylistic details of the HTML. It also gives us the flexibility to completely change the style by changing the different style sheet.
< type="text/javascript">
window.onload = function() {
document.getElementById(' btnClick ').onclick = ChangeColor;
};
Function ChangeColor ()
{
document.getElementByID(‘txtName’).style.color = “Blue”
}
< / script>
< type="button">
Please click here
In the above example, the structure is separated from functionality. This approach of separating the structure from functionality through javascript is called “Unobtrusive Javascript”
The JQuery drew a huge attention amongst developer for its ability to support the development of unobtrusive JavaScript’s. JQuery works very well with the HTML page and performing operations on the DOM elements with significantly less lines of code. The scripts developed in JQuery model works well in all major browsers.
JQuery has great features like
DOM Selectors
DOM manipulation
Animation
HTML traversing
Sunday, January 11, 2009
Great Quotes from the book "The one minute entrepreneur"
The authors suggests that "To be a succesful entrepreneur one should cultivate an attitude of writing down the learnings in one word in one minute.". I hope this book is a great guide for everyone dreaming to be an entrepreneur.
Friday, January 2, 2009
Cross Browser Compatibility
The decline in IE usage is attributed to several factors including the increase in the sales of Apple MAC using Safari, increase usage of Googles Chrome and open source Mozilla’s FireFox.
The application developments should be more focused to support Cross-browsers.