/// <devdoc> /// This is a private method that will build the Oracle package name if your stored procedure /// has proper prefix and postfix. /// This functionality is include for /// the portability of the architecture between SQL and Oracle datbase. /// This method will also add the reference cursor to the command writer if not added already. This /// is required for Oracle .NET managed data provider. /// </devdoc> private static void PrepareCWRefCursor(DBCommandWrapper commandWrapper) { OracleCommandWrapper oracleCommandWrapper = (OracleCommandWrapper)commandWrapper; if (!(oracleCommandWrapper.ParameterDiscoveryRequired)) { if (CommandType.StoredProcedure == commandWrapper.Command.CommandType) { // Check for ref. cursor in the command writer, if it does not exist, add a know reference cursor out // of "cur_OUT" if (!oracleCommandWrapper.IsRefCursorAdded) { oracleCommandWrapper.AddParameter(RefCursorName, OracleType.Cursor, 0, ParameterDirection.Output, true, 0, 0, String.Empty, DataRowVersion.Default, Convert.DBNull); } } } }
/// <summary> /// <para>Create an <see cref="OracleCommandWrapper"/> for a SQL query.</para> /// </summary> /// <param name="query"><para>The text of the query.</para></param> /// <returns><para>The <see cref="OracleCommandWrapper"/> for the SQL query.</para></returns> /// <exception cref="ArgumentNullException"> /// <para><paramref name="query"/> can not be <see langword="null"/> (Nothing in Visual Basic).</para> /// </exception> /// <exception cref="ArgumentException"> /// <para><paramref name="query"/> hast not been initialized.</para> /// </exception> public override DBCommandWrapper GetSqlStringCommandWrapper(string query) { OracleCommandWrapper wrapper = new OracleCommandWrapper(query, CommandType.Text, ParameterToken); return(wrapper); }