The Nasdaq rose on Friday as quarterly results from Oracle and Research In Motion boosted optimism about a recovery in technology spending, but the U.S. dollar's rise weighed on the Dow and S&P 500 as investors pared back risky bets.

The U.S. dollar index <.DXY> climbed 0.3 percent, a move that put pressure on the broader market and weighed on shares of exporters and other multinationals. Shares of Caterpillar Inc fell 0.6 percent, while Coca-Cola Co shed 0.7 percent. Plane maker Boeing Co declined 2 percent.

Geopolitical concerns supported the flight to the U.S. dollar following reports that Iranian troops had entered Iraqi territory and raised the Iranian flag at an oilfield whose ownership is disputed by Iran.

I think we're seeing a continued flight to safety, said Tom Schrader, managing director of U.S. equity trading at Stifel Nicolaus Capital Markets in Baltimore.

The stronger the dollar gets it means investors will be unwinding the dollar carry trade, and that's going to put upward pressure on the dollar and downward pressure on the stocks.

The Dow Jones industrial average <.DJI> gained 1.66 points, or 0.02 percent, to 10,309.92. The Standard & Poor's 500 Index <.SPX> edged up 3.32 points, or 0.30 percent, to 1,099.40. The Nasdaq Composite Index <.IXIC> jumped 21.74 points, or 1.00 percent, to 2,201.79.

The indexes opened strongly but lost ground in late morning.

Strength in the U.S. dollar forces investors who had bet on the greenback going down to cover their short dollar positions buy selling equities or other assets.

A strengthening dollar ... means, in my opinion, a rotation into quality, said Haag Sherman, co-founder and chief investment officer for Salient Partners, a Houston-based investment firm with $8 billion in client assets. These companies have morphed into what the big industrials once were, which is steady growth.

Trading was choppy as Friday marks the expiration of December options and futures, a convergence known as quadruple witching that often means increased volatility as big investors adjust or exercise derivatives positions.

In addition the market was set to see the reconstitution of the S&P 500. Visa Inc , up 2.3 percent at $89, is among companies that will be the newest additions to the benchmark index after the close.

In tech news, Oracle Corp reported a bigger-than-expected increase in new software sales and BlackBerry maker Research In Motion Ltd gave a strong forecast.

Oracle shares rose 6.3 percent to $24.32, while RIM's Nasdaq-traded shares jumped 10.3 percent to $70.

Technology shares have been a strong performer in the market's run-up from early March due to the appeal of strong balance sheets and prospects for strong growth overseas.

(Editing by Kenneth Barry and Jeffrey Benkoe)