Stocks were little changed on Wednesday as an unexpected rise in October wholesale inventories was offset by continued concerns on foreign debt and a weak outlook in the tech sector.

Gains were limited by concerns over the credit ratings of Greece and Spain and an outlook from Texas Instruments Inc, as chip makers are generally considered one of the first sectors to recover from recession.

U.S. total wholesale inventories rose 0.3 percent in October, according to data from the Commerce Department, reversing a 12-month declining trend. Analysts were expecting inventories to fall 0.5 percent.

Added to Friday's above-consensus jobs report, the inventory figure shows surprising resilience as we work to recover, said Thomas Nyheim, portfolio manager at Christiana Bank & Trust Co. in Greenville, Delaware.

January crude futures initially rose but later fell back about 0.4 percent to $72.34 per barrel after data showed an unexpected drawdown in crude inventories, a positive sign for potential demand.

The S&P Energy index <.GSPE> rose 0.4 percent and was the percentage leader among S&P sectors.

The Dow Jones industrial average <.DJI> rose 13.52 points, or 0.14 percent, to 10,299.87. The Standard & Poor's 500 Index <.SPX> was unchanged at 1,091.93. The Nasdaq Composite Index <.IXIC> fell 2.10 points, or 0.10 percent, at 2,170.91.

The Nasdaq was pressured a day after Texas Instruments gave a fourth-quarter earnings view that disappointed some investors who had hoped for a stronger outlook on signs of improving demand. The stock fell 2.6 percent to $25.65.

People didn't love the T-I news, especially since that company is such a barometer of what's going on, said Wayne Kaufman, chief market analyst at John Thomas Financial in New York.

Stocks were also buffeted by concerns about the global economic recovery after ratings agency Standard & Poor's revised its outlook on Spain to negative, one day after Fitch Ratings downgraded Greece's debt rating.

The move also comes after a potential debt default in Dubai raised concerns about the prospects for another global economic crisis.

(Editing by Padraic Cassidy)