Unix Technical Forum

OO4O and Spatial

This is a discussion on OO4O and Spatial within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi All, I have the following code that fails. I suspect that I am doing something really dumb, but ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 10:25 AM
pieter
 
Posts: n/a
Default OO4O and Spatial

Hi All,

I have the following code that fails. I suspect that I am doing
something really dumb, but I don't know how to locate the problem.

It fails on the ExecuteSql line with the error: 440: OIP-04149: Invalid
input object for field and parameters

Dim oraSession As New OracleInProcServer.OraSessionClass
Dim userSession As OracleInProcServer.OraDatabase
Set userSession = oraSession.OpenDatabase("aubis", "aubis/aubis",
0)
userSession.AutoCommit = False

Dim sql As String
sql = "UPDATE MAP_CLASTS SET GEOMETRY = :GEOMETRY WHERE CLAST_ID =
2001"

Dim sdo_geom As OracleInProcServer.OraObject
Set sdo_geom = userSession.CreateOraObject("MDSYS.SDO_GEOMETRY")

Dim sdo_elem_info As OracleInProcServer.OraCollection
Set sdo_elem_info =
userSession.CreateOraObject("MDSYS.SDO_ELEM_INFO_A RRAY")

Dim sdo_ordinates As OraCollection
Set sdo_ordinates =
userSession.CreateOraObject("MDSYS.SDO_ORDINATE_AR RAY")


sdo_elem_info.Append (1)
sdo_elem_info.Append (2)
sdo_elem_info.Append (1)

sdo_ordinates.Append (10#)
sdo_ordinates.Append (0#)
sdo_ordinates.Append (0#)

sdo_ordinates.Append (0#)
sdo_ordinates.Append (10#)
sdo_ordinates.Append (0#)

sdo_ordinates.Append (10#)
sdo_ordinates.Append (10#)
sdo_ordinates.Append (0#)


sdo_geom.Item(1).Value = 3002 'SDO_GTYPE
sdo_geom.Item(2) = Null
sdo_geom.Item(3) = Null

sdo_geom.sdo_elem_info = sdo_elem_info
sdo_geom.sdo_ordinates = sdo_ordinates


Dim params As OracleInProcServer.OraParameters
Set params = userSession.Parameters

params.Add "GEOMETRY", sdo_geom, 2
params("GEOMETRY").serverType = ORATYPE_OBJECT

userSession.ExecuteSQL (sql)

params.Remove ("GEOMETRY")

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 10:26 AM
Volker Hetzer
 
Posts: n/a
Default Re: OO4O and Spatial

pieter schrieb:
> Hi All,
>
> I have the following code that fails. I suspect that I am doing
> something really dumb, but I don't know how to locate the problem.
>
> It fails on the ExecuteSql line with the error: 440: OIP-04149: Invalid
> input object for field and parameters
>
> Dim oraSession As New OracleInProcServer.OraSessionClass
> Dim userSession As OracleInProcServer.OraDatabase
> Set userSession = oraSession.OpenDatabase("aubis", "aubis/aubis",
> 0)

Are you sure that this is correct and sufficient?
Can you do a "select sysdate from dual" and retrieve the result?

Lots of Greetings!
Volker
--
For email replies, please substitute the obvious.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:30 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com