Updated from 4:02 p.m. EDT

Stocks were held to modest gains Wednesday as falling oil prices and a spate of bargain-hunting were offset by another round of earnings warnings from the tech sector, including PeopleSoft ( PSFT).

The Dow added 20.95 points, or 0.21%, to 10,240.29; the S&P 500 gained 2.11 points, or 0.19%, to 1118.32; and the Nasdaq was up 2.65 points, or 0.13%, to 1966.08. The 10-year Treasury note was trading down 1/32, yielding 4.48%, while the dollar was lower against the yen and euro.

Trading was moderate, with volume just over 1.3 billion shares on the New York Stock Exchange, where advancers held about a 3-to-2 majority over decliners. On the Nasdaq, more than 1.7 billion shares changed hands, and decliners held a 5-to-4 edge.

"I think the market is pausing here in anticipation of earnings releases coming up over the next few weeks," said Jay Suskind, head of institutional equity trading with Ryan Beck & Co. "The last few macroeconomic numbers have showed a little slowness in the economy, and I think the market, rather than focusing on the earnings over the last quarter, is going to be looking at what these companies foresee over the next quarter or two as far as business activity.

"If the earnings statements come in optimistic, saying that business still looks brisk going forward for the rest of the year, then I think the market rallies," Suskind added. "If you start to hear things about warnings and things slowing down, then I think you might be in for some downside here. Right now, the market is dwelling on some negative numbers, but I think it's too early to tell what the overall tone will be."

Today's negativity centered at the outset around a release from PeopleSoft that put second-quarter operating earnings roughly 4 cents to 6 cents below estimates. The company also expects to report revenue of $655 million to $665 million in the quarter, short of analyst estimates of $690 million. Despite the report, the stock swung to a gain in late-session trading to close up 30 cents, or 1.8%, to $17.12.

That news came after several negative after-hours preannouncements from software companies Tuesday, including Ascential Software ( ASCL), Kana Software ( KANA), JDA Software ( JDAS) and FileNet ( FILE).

John Butters, a research analyst with Thomson First Call, said that while its negative-to-positive preannouncement ratio recently ticked up to 1.5 from 1.4, the average for the ratio is 2.2, thus the quarter still looks better than usual. Although Thomson has recorded 23 negative announcements in July, and no positive ones, the weakness is isolated to the software sector and even there, it's coming mostly from smaller companies not included in the S&P 500.

"It's definitely something to keep an eye on," Butters said. "But it's nothing to get too worried about for most investors unless it starts spreading to larger companies or other sectors."

Quest Software ( QSFT), meanwhile, became the only software vendor so far to preannounce upside to its quarterly results, with revenue reaching record levels. It announced that total revenue in the quarter would range from $90 million to $91 million, representing a 27% increase from a year earlier. The stock closed up 52 cents, or 4.7%, to $11.63.

In the first second-quarter report from a Dow component, Alcoa ( AA) released results after the close, saying that its net income rose 87%, coming in just a penny shy of estimates. The aluminum producer earned $404 million, or 46 cents a share, compared with $216 million, or 26 cents a share, in the same quarter last year. Its stock, which gained 2.5% during the session, was recently down $1, or 3%, in after-hours trading.

Oil prices pulled back from Tuesday's rally after Iraq resumed output after a weekend bombing damaged a 42-inch pipeline, halving the nation's exports. Also, OPEC officials hinted that the cartel still plans to raise its output ceiling in August. The benchmark U.S. crude settled at $39.08, off 57 cents, or 1.4%, while gasoline prices closed a fraction of a cent higher at $1.273 a gallon.

Separately in Iraq, the country's new interim government announced a package of laws designed to address security issues that would allow Prime Minister Iyad Allawi to announce martial law in areas where insurgents are particularly disruptive. It also allows him, after receiving unanimous approval from the cabinet, to assign curfews to specific areas, conduct cordon-and-search operations, and detain individuals with weapons on them.

Despite the announcement, violence continued to plague the streets of Baghdad. Iraqi forces backed by U.S. troops and helicopters battled insurgents in the streets near Martyrs' Square, according to a report from The Associated Press. At least four people were killed and 20 others injured in the fight.

In other corporate news, Microsoft ( MSFT) was in focus, closing up 8 cents, or 0.3%, to $28.10, after a 4,900-word internal memo to employees was publicized that outlined Chief Executive Steve Ballmer's plans to cut costs, foster innovation and keep the software empire from turning into a slow-moving giant.

Meanwhile, investors eyed Boeing ( BA) after it announced new orders that show a healthy demand for its latest aircraft model. Its stock closed up 8 cents, or 0.2%, to $49.39.

Accenture ( ACN) said its third-quarter profit rose 59%, meeting Wall Street's expectations. The management and technology consulting firm said its net income was $210.4 million, or 37 cents a share, up from $132.1 million in the same quarter last year. Its stock closed up a cent to $27.25.

Overseas markets closed mostly lower, with London's FTSE 100 down 0.3% to 4358 and Germany's Xetra DAX down 0.4% to 3930. In Asia, Japan's Nikkei closed down 0.8% to 11,385, while Hong Kong's Hang Seng added 0.3% to 12,320.

On Thursday, the government is expected to report that initial jobless claims dipped to 345,000 in the week ended July 3, from the 351,000 logged in the previous week.

Also before the opening bell, Pepsi Bottling ( PBG) is expected to report second-quarter earnings before items of 51 cents a share, up from last year's 46 cents a share.