Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Problems with passing Arrays from c++ to stored procedures
I've got some problems with passing an Array as parameter to a PL/SQL
stored procedure in C++. The usage below allows me to pass the array as
a parameter and inserts records... although the fraction part of all
numbers have been truncated. Anyone who can give me a hint of what's
wrong or maybe give me a tip of another way of doing the same thing?
OParamArray latitudes( params.AddTable( "latitudes", OPARAMETER_INVAR,
OTYPE_NUMBER, numPoints ) );
OParamArray longitudes( params.AddTable( "longitudes",
OPARAMETER_INVAR, OTYPE_NUMBER, numPoints ) );
for ( unsigned int point( 0 ); point < numPoints; ++point ) {
latitudes.SetValue( vectorOfPoints[ point ].latitude, point ); longitudes.SetValue( vectorOfPoints[ point ].longitude, point );}
m_database.ExecuteSQL( "Begin PRC$InsertInCoords( :msg_id, :latitudes, :longitudes ); End;" );
TYPE latitudeArray IS TABLE OF NUMBER INDEX BY PLS_INTEGER; TYPE longitudeArray IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
PROCEDURE PRC$InsertInCoords
( msg_id IN NUMBER, latitudes IN latitudeArray, longitudes IN longitudeArray, )
/d Received on Wed Apr 26 2006 - 10:13:56 CDT