[Mono-devel-list] Need help to enhance oracle datetime parameter support...

Hubert FONGARNAND informatique.internet at fiducial.fr
Fri Apr 15 11:22:50 EDT 2005


Hi,

	I want to enhance oracle datetime parameter support. Today, oracledatetime 
parameter is sended as a string to the oracle server... It's not the way that 
MS.NET does...
MS.NET send the datetime in a byte array. This method don't depend on the 
NLS_DATE_FORMAT parameter.
I think it would be better if mono use this method.

There's a OCI method to do that : OCIDateTimeToArray
So i've imported OCIDateTimeToArray and OCIDateTimeFromText in OCICalls.cs :

internal static int OCIDateTimeToArray (IntPtr hndl,
			IntPtr errhp, IntPtr datetime, IntPtr interval, byte[] outarray, [MarshalAs 
(UnmanagedType.U4)] out int length, uint fsprec)
		{
			return 
OciNativeCalls.OCIDateTimeToArray(hndl,errhp,datetime,interval,outarray, out 
length,fsprec);
		}

		
internal static int OCIDateTimeFromText (IntPtr hndl,
			IntPtr errhp, [In][Out] byte[] date_str, uint dstr_length,
			[In][Out] byte[] fmt, uint fmt_length,
			[In][Out] byte[] lang_name,uint lang_length, IntPtr datetime)
		{
			return 
OciNativeCalls.OCIDateTimeFromText(hndl,errhp,date_str,dstr_length,fmt,fmt_length,lang_name,lang_length,datetime);
		}

We must :
-create a OCIDateTime structure with the sDate String (with 
OCIDateTimeFromText)
-convert this OCIDateTime structure to a byte array with (OCIDateTimeToArray)

but i don't know how to allocate a OCIDateTime Structure in managed code...
Could you help me to implement that????

Hubert FONGARNAND


_______________________________________________
Ce message et les éventuels documents joints peuvent contenir des informations confidentielles.
Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'étant pas sécurisées, l'intégrité de ce message n'est pas assurée et la société émettrice ne peut être tenue pour responsable de son contenu.



More information about the Mono-devel-list mailing list