Will the following code run when connected to Oracle?

From: <kgoff_at_worldnet.att.net>
Date: Fri, 30 Aug 2002 03:43:40 GMT
Message-ID: <MRBb9.42332$Ke2.2960505_at_bgtnsc04-news.ops.worldnet.att.net>



[Quoted] I have a question about creating temporary tables 'on the fly' in the middle-tier. In our app, users select lists of accounts and products as a [Quoted] part of running reports. Basically, I take the key(s) for each account/product that the users select, build temp tables in SQL Server, and [Quoted] then perform a query with a JOIN against the temp tables that were created. [Quoted] I know that the following code (using .NET, written in C#) will work when running against SQL Server. I'd like to know how much modification I'd need to do to support use of Oracle...

MyConn = OleDbConnection("connect string for either Oracle or SQL"); MyConn.Open();
OleDBCommand oCmd = new OleDbCommand("CREATE TABLE #GeoList (GeoKey INTEGER)",MyConn);
oCmd.ExecuteNonQuery();
OleDbCommand oCmd2 = new OleDbCommand("INSERT INTO #GeoList (GeoKey) VALUES (100)");
oCmd2.ExecuteNonQuery();
[Quoted] MyAdapter = new OleDBAdapter("SELECT * FROM History JOIN #GeoList ON History.GeoKey = #GeoList.GeoKey",MyConn); DsReturn = new DataSet();
MyAdapter.Fill(DsReturn,"myhistoryextract"); MyConn.Close();

I've read that temp tables are created somewhat differently in Oracle. If it's just a matter of minor syntax changes in the CREATE TABLE #TEMP statement, I can obviously account for differences in syntax. Any thoughts?

Thanks,
Kevin Received on Fri Aug 30 2002 - 05:43:40 CEST

Original text of this message