MapBasic Max String Length

303 views
Skip to first unread message

Erik

unread,
Jan 30, 2015, 3:13:14 AM1/30/15
to mapi...@googlegroups.com
Hi,

For a customer project, i'm trying to generate a possibility for a user, to just select an object in a mapwindow and by generating a SDO_GEOMETRY-string and passing it in an oracle spatial query to a remote oracle instance to give back for example features of an oracle spatial table within this selected object.
This works already perfectly for simple selected objects, but when these objects are a little mor complex, the maximum size of the internal MapBasic string data type of 32.768 Bytes is way too small.

i know, that this sounds like a purely fictional question, but is there a possiblity to extend this?
or how can i pass more than 32.768 Bytes in a Query to a remote database?

Thanks in advance for your help
Cheers

Erik


Thomas Bacon

unread,
Jan 30, 2015, 4:29:10 AM1/30/15
to mapi...@googlegroups.com

One option would be to use a .NET library to do the grunt work. I think the maximum string size in .NET is something like 2 billion so that should cover it I would imagine!

 

Cheers,

 

Tom Bacon

GIS Engineer, Mouchel

T 01444 472380 │ E thomas...@mouchel.com W www.mouchel.com

Our values: innovation │ excellence │ integrity │ responsibility

--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



 

Mouchel Limited (Mouchel) is registered in England and Wales with registered number 01686040 at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX.  The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. No contracts may be concluded on behalf of Mouchel by means of email communications. Mouchel reserves the right to monitor and intercept emails sent and received on our network. 

Erik

unread,
Jan 30, 2015, 4:35:36 AM1/30/15
to mapi...@googlegroups.com
Well, but to get the resulting objects back to MiPro, i only see the Server_execute() method, and this method doesn't take a .NET-String as far as i can see.
Or am i wrong?

Stefan

Thomas Bacon

unread,
Jan 30, 2015, 4:54:38 AM1/30/15
to mapi...@googlegroups.com

Stefan,

 

I think you MAY be able to do something like this (assuming mi is an instance of your current MapInfo session and you pass the connection number ‘hdbc’ to the function):

 

string superLongGeometryQuery;

int hstmt;

 

hstmt = mi.Evaluate("Server_Execute (" + hdbc + "," + superLongGeometryQuery + ")");

 

You can then return hstmt to MapBasic to deal with the statement number.

 

I have to admit, I’ve rarely worked with external databases and when I have it has never been with Oracle so I might be wrong about this, but it seems like it should work to me.

 

Good luck,

 

Mouchel Limited (Mouchel) is registered in England and Wales with registered number 01686040 at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX.  The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. No contracts may be concluded on behalf of Mouchel by means of email communications. Mouchel reserves the right to monitor and intercept emails sent and received on our network. 

--

Thomas Bacon

unread,
Jan 30, 2015, 5:07:53 AM1/30/15
to mapi...@googlegroups.com

Should have mentioned to save SDO_GEOMETRY string into an array of strings in MapBasic and pass that array to .NET to build it into superLongGeometryQuery.

 

Tom Bacon

GIS Engineer, Mouchel

T 01444 472380 │ E thomas...@mouchel.com W www.mouchel.com

Our values: innovation │ excellence │ integrity │ responsibility

 

Peter Horsbøll Møller

unread,
Jan 30, 2015, 5:20:16 AM1/30/15
to mapi...@googlegroups.com
I think you might even have an even shorter string within the ODBC connection.
I think this is limited to 5000 characters.

Not sure whether this is a limit in MapInfo Pro or on the ODBC driver

Peter Horsbøll Møller
Pitney Bowes Software



From: Thomas...@mouchel.com
To: mapi...@googlegroups.com
Subject: RE: [MI-L] MapBasic Max String Length
Date: Fri, 30 Jan 2015 09:53:55 +0000

Erik

unread,
Jan 30, 2015, 5:46:46 AM1/30/15
to mapi...@googlegroups.com
Thank you Tom for that, somewhat crude sounding idea, but i might give it a try.

@Peter
since you work at PB since a while:
It seems a bit strange to me to limit the query size to a remote database in such a drastic way, since these should be the machines to do big jobs. Was there never even considered a native solution for this issue?

Thanks for your answers

Stefan
Reply all
Reply to author
Forward
0 new messages