develooper Front page | perl.dbd.oracle.changes | Postings from April 2008

[svn:dbd-oracle] r11048 - in dbd-oracle/trunk: . t

From:
byterock
Date:
April 3, 2008 05:00
Subject:
[svn:dbd-oracle] r11048 - in dbd-oracle/trunk: . t
Author: byterock
Date: Thu Apr  3 05:00:05 2008
New Revision: 11048

Modified:
   dbd-oracle/trunk/Oracle.h
   dbd-oracle/trunk/Oracle.pm
   dbd-oracle/trunk/Oracle.xs
   dbd-oracle/trunk/dbdimp.c
   dbd-oracle/trunk/t/32xmltype.t

Log:
A cosmetic change from ORA_NTY to ORA_XMLTYPE.  I think it is better because NTY could be other data types than XMLTYPE, Such as VARRAY, TABLE, OBJECT etc,

Modified: dbd-oracle/trunk/Oracle.h
==============================================================================
--- dbd-oracle/trunk/Oracle.h	(original)
+++ dbd-oracle/trunk/Oracle.h	Thu Apr  3 05:00:05 2008
@@ -98,7 +98,7 @@
 
 #define ORA_VARCHAR2_TABLE	201
 #define ORA_NUMBER_TABLE	202
-#define ORA_NTY			    108
+#define ORA_XMLTYPE			108
 
 /* other Oracle not in noraml API defines
 

Modified: dbd-oracle/trunk/Oracle.pm
==============================================================================
--- dbd-oracle/trunk/Oracle.pm	(original)
+++ dbd-oracle/trunk/Oracle.pm	Thu Apr  3 05:00:05 2008
@@ -20,7 +20,7 @@
     %EXPORT_TAGS = (
 	ora_types => [ qw(
 	    ORA_VARCHAR2 ORA_STRING ORA_NUMBER ORA_LONG ORA_ROWID ORA_DATE
-	    ORA_RAW ORA_LONGRAW ORA_CHAR ORA_CHARZ ORA_MLSLABEL ORA_NTY
+	    ORA_RAW ORA_LONGRAW ORA_CHAR ORA_CHARZ ORA_MLSLABEL ORA_XMLTYPE
 	    ORA_CLOB ORA_BLOB ORA_RSET ORA_VARCHAR2_TABLE ORA_NUMBER_TABLE
 	    SQLT_INT SQLT_FLT ORA_OCI SQLT_CHR SQLT_BIN     
 	) ],
@@ -1199,7 +1199,7 @@
 =item :ora_types
 
   ORA_VARCHAR2 ORA_STRING ORA_NUMBER ORA_LONG ORA_ROWID ORA_DATE ORA_RAW
-  ORA_LONGRAW ORA_CHAR ORA_CHARZ ORA_MLSLABEL ORA_NTY ORA_CLOB ORA_BLOB 
+  ORA_LONGRAW ORA_CHAR ORA_CHARZ ORA_MLSLABEL ORA_XMLTYPE ORA_CLOB ORA_BLOB 
   ORA_RSET ORA_VARCHAR2_TABLE ORA_NUMBER_TABLE SQLT_INT SQLT_FLT ORA_OCI 
   SQLT_CHR SQLT_BIN  
 
@@ -1520,7 +1520,7 @@
 
 Additional values when DBD::Oracle was built using OCI 8 and later:
 
-  ORA_CLOB, ORA_BLOB, ORA_NTY, ORA_VARCHAR2_TABLE, ORA_NUMBER_TABLE
+  ORA_CLOB, ORA_BLOB, ORA_XMLTYPE, ORA_VARCHAR2_TABLE, ORA_NUMBER_TABLE
 
 Additional values when DBD::Oracle was built using OCI 10.2 and later:
 
@@ -3669,10 +3669,10 @@
 
 Any NULL values found in the embedded object will be returned as 'undef'.
 
-=head1 Support for Insert of XMLType (ORA_NTY)
+=head1 Support for Insert of XMLType (ORA_XMLTYPE)
 
 Inserting large XML data sets into tables with XMLType fields is now supported by DBD::Oracle. The only special 
-requirement is the use of bind_param() with an attribute hash parameter that specifies ora_type as ORA_NTY. For
+requirement is the use of bind_param() with an attribute hash parameter that specifies ora_type as ORA_XMLTYPE. For
 example with a table like this;
 
    create table books (book_id number, book_xml XMLType);
@@ -3693,7 +3693,7 @@
 	        </Books>....
 	        <Book id=10000> ...';
    my $sth =$dbh-> prepare($SQL);
-   $sth-> bind_param("p_xml", $xml, { ora_type => ORA_NTY }); 
+   $sth-> bind_param("p_xml", $xml, { ora_type => ORA_XMLTYPE }); 
    $sth-> execute();
        
 In the above case we will assume that $xml has 10000 Book nodes and is over 32k in size and is well formed XML. 

Modified: dbd-oracle/trunk/Oracle.xs
==============================================================================
--- dbd-oracle/trunk/Oracle.xs	(original)
+++ dbd-oracle/trunk/Oracle.xs	Thu Apr  3 05:00:05 2008
@@ -21,7 +21,7 @@
     ORA_CHAR	 =  96
     ORA_CHARZ	 =  97
     ORA_MLSLABEL = 105
-    ORA_NTY	 	 = 108
+    ORA_XMLTYPE	 = 108
     ORA_CLOB	 = 112
     ORA_BLOB	 = 113
     ORA_RSET	 = 116

Modified: dbd-oracle/trunk/dbdimp.c
==============================================================================
--- dbd-oracle/trunk/dbdimp.c	(original)
+++ dbd-oracle/trunk/dbdimp.c	Thu Apr  3 05:00:05 2008
@@ -262,7 +262,7 @@
     case 116:	/* SQLT_RSET	OCI 8 cursor variable	*/
  	case ORA_VARCHAR2_TABLE: /* 201 */
     case ORA_NUMBER_TABLE: /* 202 */
-    case ORA_NTY:   /* SQLT_NTY   Well realy only XML clobs not embedded objects  */
+    case ORA_XMLTYPE:   /* SQLT_NTY   must be carefull here as its value (108) is the same for an embedded object Well realy only XML clobs not embedded objects  */
 	return 1;
     }
     return 0;
@@ -2468,7 +2468,7 @@
     case SQLT_RSET:
 	    done = dbd_rebind_ph_rset(sth, imp_sth, phs);
 	    break;
-	 case ORA_NTY:
+	 case ORA_XMLTYPE:
 	    done = dbd_rebind_ph_xml(sth, imp_sth, phs);
  	    break;
     default:

Modified: dbd-oracle/trunk/t/32xmltype.t
==============================================================================
--- dbd-oracle/trunk/t/32xmltype.t	(original)
+++ dbd-oracle/trunk/t/32xmltype.t	Thu Apr  3 05:00:05 2008
@@ -60,11 +60,11 @@
 
 $sth =$dbh-> prepare($stmt);
   
-$sth-> bind_param(1, $small_xml, { ora_type => ORA_NTY });
+$sth-> bind_param(1, $small_xml, { ora_type => ORA_XMLTYPE });
 
 ok ($sth->execute(), '... execute for small XML return true');
 
-$sth-> bind_param(1, $large_xml, { ora_type => ORA_NTY });
+$sth-> bind_param(1, $large_xml, { ora_type => ORA_XMLTYPE });
 
 ok ($sth->execute(), '... execute for large XML return true');
 



Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About