Wednesday, March 11, 2009
Monday, March 09, 2009
TCS likely to lay off 1,300 staffers
Chennai: India's IT major Tata Consultancy Services (TCS) will lay off around 1,300 employees - less than a percent of its global workforce- over the next few months, as these employees failed to meet performance standards, a company spokesperson said. The company has a total headcount of around 1.3 lakh.
Lay-offs have started at the company's development centers in Chennai, where over 200 employees have been asked to leave in the last fortnight, said TCS employees on condition of anonymity, as reported by The Economic Times.
A member of the TCS corporate communication team confirmed the development to the daily but did not put a number or place to it. "This is mostly employees who have been given a second chance to improve and haven't. They will be sent over a period, in the next few months. This will constitute less than a percent of our global workforce. We had to let go of 500 people last year on performance issues," the corporate communication team member said.
This comes less than a week after the company's CEO S Ramadorai said the company would review the variable pay component for its employees and also increase the working hours.
Asked about job cuts, he had said the company wasn't planning to cut jobs immediately but might have to if the situation worsened.
Employee expenses make up at least 53-54 percent of the company's total cost. Going by its analyst presentation for the third quarter ended December 2008, TCS had a total employee count of 1,30,343.
Wednesday, March 04, 2009
Oracle and Visual Basic using ADO - Sources: http://www.vb6.us/tutorials/oracle-and-visual-basic-using-ado
Oracle databases have been around for years, and although they are not as popular as their Microsoft counterpart, many business rely on Oracle backends for all their needs. Because of this, we must know how to interface with an Oracle database from within our VB6 application. This VB6 tutorial will walk us through exactly how to do this.
To access an Oracle database it is very similar to how you access any other database. We can simply use an ADO Connection object. We set the provider to be our Oracle provider and setup our connection string and password.
- Set dbConn = New ADODB.Connection
- With dbConn
- .Provider = "OraOLEDB.Oracle"
- .Properties("Data Source") = "DatabaseName"
- .Properties("User Id") = "someuser"
- .Properties("Password") = "somepassword"
- .Open
- End With
After we setup the connection all we do next is setup an ADO Command object that will be used with our oracle database. This is the same things we do for any Visual Basic database application.
- Set Cmd = New ADODB.Command
- Set Cmd.ActiveConnection = dbConn
- With Cmd
- .Parameters.Append .CreateParameter(, adVarChar, adParamOutput, 50)
- .Parameters.Append .CreateParameter(, adNumeric, adParamOutput)
- End With
Now is where things start being specific to our Oracle database. Getting a result set back from an Oracle SP is not as simple as it is in SQL Server. The results must come back to the calling program in something called a reference cursor (ref cursor). This will discuss what a ref cursor is and how to implement them and get data back.
Oracle creates an implicit cursor for every select query (I think that is the same for any database system). The cursor is simple the recordset results. If you are not going to use that result set for anything else (ie: to generate another query to execute) then you do not need to declare a cursor. But to get the result set out of Oracle you need something that is called a ref cursor. This ref cursor is more or less the same as and ADO recordset. You declare the ref cursor in code some where on the Oracle database, that ref cursor (sort of a structure in .Net) is then listed as an In and Out parameter of the SP.
You generate the select statement you want to run then open the ref cursor you created as follows:
- Open cRefCur For
- Select ....... (columns form whatever tables)
- From (table names)
- Where (conditions and Joins).
This is the way to create the cursor:
First we create a package that will hold all the different return types:
- CREATE OR REPLACE PACKAGE cv_types AS
- TYPE WellData IS RECORD(
- WellName Varchar2(50),
- ResultsCount Number
- );
- TYPE CV_WEllData IS REF CURSOR RETURN WellData;
- End;
- /
(This procedure does not have any inputs, only output paramters).
- Create Or Replace Procedure WellCounting (
- pWellName OUT VARCHAR2,
- pCount OUT NUMBER,
- rsWellData IN OUT cv_types.CV_WEllData)
- AS
- BEGIN
- Open rsWellData For
- Select
- Wells.WELLNAME,Count(RESULTS.WELLID)
- Into
- pWellName,
- pCount
- From
- Wells, Results
- Where
- Wells.WellID = Results.WellID
- group by
- WEllName;
- EXCEPTION
- WHEN OTHERS THEN
- ROLLBACK WORK;
- RAISE;
- End WellCounting;
- /
An example of a stored procedure with input parameters is here:
- Create Or Replace Procedure OneWellCount (
- pWellID IN Number,
- pWellName OUT VARCHAR2,
- pCount OUT NUMBER,
- rsWellData IN OUT cv_types.CV_WEllData
- )
- AS
- BEGIN
- Open rsWellData For
- Select
- Wells.WELLNAME,Count(RESULTS.WELLID)
- Into
- pWellName,
- pCount
- From
- Wells, Results
- Where
- Wells.WellID = pWellID And
- Wells.WellID = Results.WellID
- group by
- WEllName;
- EXCEPTION
- WHEN OTHERS THEN
- ROLLBACK WORK;
- RAISE;
- End OneWellCount;
- /
- Enter the command SET SERVEROUTPUT ON;
- Now we set up variables to hold data going into and out of the SP:
Assuming we are using the first SP displayed, the we will need 3 variables:
VARIABLE P1 VARCHAR2(50) This is because the field we are returning is 50 chars
VARIABLE P2 Number This is a number coming back from the SP;
VARIABLE P3 REFCURSOR This will hold the result set that is coming back - From the SQL prompt enter:
EXECUTE WellCounting( :P1, :P2, :P3); - If the procedures completes successfully we can now display the output.
The variable P1 and P2 will hold the last Well Name and number of results
for that well name. The variable P3 will hold the complete recordset that
is being returned. To display that result in SQL*Plus enter:
Print P3