Posts

Showing posts from January, 2013

Dot Net - Dataset - retrieving from sys_refcursor Oracle Package

Image
First, I am not sure if this is really a problem or just an issue with my understanding of some issues. Essentially, I was trying to access an ORACLE STORED PROCEDURE in a PACKAGE. The procedure returns a sys_Refcursor parameter - which simply means, it is weakly typed. Creating a Table Adapter in VS2010 and making the appropriate references did not go on as I had anticipated. Normally, if you bind a procedure to a TableAdapter, it should generate the column list automatically as well as the parameter list - if any. However, I noticed that this was not the case for the sys_Refcursor type parameter procedure. I actually think - it's got nothing to do with the sys_refcurson type but a problem with the way the procedure name is generated with some funny escape characters. Either way, you can get around this issue following the steps described in this article. Once you have this situation, the column list is not automatically generated for the Data table, neither is the paramet...

WCF Service - Using Datasets

There are a lot of articles out there on why it is not a good practice to use "Dataset" type in WCF. Basically, it is platform dependent and if the web service were to be consumed from another platform other than Windows, there could be an issue of data compatibility. There are two possible ways of getting around this - serializing and compressing the dataset using the WriteToXML method and then compressing with gzip or using a collection of a data class made up of primitive data types. For strictly Windows based platform, you could use Dataset type and have something liek this : [ServiceContract] public interface IContactManager { [OperationContract] DataSet GetContacts(); [OperationContract] void UpdateContact(int id, string name, string phone); } public class ContactManager: IContactManager { public DataSet GetContacts() { return _contacts; } public void UpdateContact(int id, string name, string phone) { var row = _con...

Remove Oracle manually

Have you ever had the challenge of trying to remove Oracle using the universal installer with no success? Well, try removing Oracle manually. Removing Oracle Keys from the Microsoft Registry Editor Oracle Universal Installer creates Windows services for Oracle components during installation but it does not delete all the services created by Oracle Net Configuration Assistant and Oracle Database Configuration Assistant during deinstallation. In addition, Oracle Universal Installer does not delete several other registry editor keys. You need to remove any existing registry keys manually by following the instructions in one of the following sections: Removing the Oracle Net Service Registry Key Removing All Oracle Registry Keys Caution: Use Microsoft Registry Editor at your own risk. Incorrectly using the Registry Editor can cause serious problems and may require reinstallation of your operating system. Removing the Oracle Net Service Registry Key To remove only the Oracle Net...

ORACLE TNS Configuration

TNS Connections The TNS connection type is an appropriate option in any of the following circumstances: You have an Oracle client installed on your machine. You have access to many Oracle Database instances. You do not know the machine details of the system hosting the Oracle Database instance you want to connect to. A TNS connection uses an alias entry from a tnsnames.ora file. Oracle SQL Developer uses only one tnsnames.ora file. You may have more than one on your local machine or want to use the tnsnames.ora file on a remote machine, so note that Oracle SQL Developer looks sequentially for the tnsnames.ora file in the following locations: $HOME/.tnsnames.ora $TNS_ADMIN/tnsnames.ora /etc/tnsnames.ora (non-Windows systems) $ORACLE_HOME/network/admin/tnsnames.ora Registry key On Windows systems, if a tnsnames .ora file exists but Oracle SQL Developer isn't using it, create a TNS_ADMIN environment variable via Control Panel -> System -> Advanced -> Envir...