Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: DBI placeholders for spatial data

by LanX (Saint)
on Jun 26, 2021 at 11:23 UTC ( [id://11134330]=note: print w/replies, xml ) Need Help??


in reply to Re^2: DBI placeholders for spatial data
in thread DBI placeholders for spatial data

>    ST_GeomFromText('POINT( ? ? )')

To make my argument clearer: this 'POINT( ? ? )' might look like an SQL function but it's a string which is parsed by ST_GeomFromText() !

Please note the missing commas, too. Function arguments in SQL are comma separated.

The MariaDB documentation calls the argument a WKT with T for Text! °

WKT is not SQL, pretty much like SQL is not Perl

Your string passed here to ST_GeomFromText() will always include literal question marks in your example.

There is nothing like ? placeholder handling inside strings in SQL!

The error you get will be along the line "too many arguments for placeholders" because the two ? inside a string are just ignored.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) The Well-Known Text (WKT) representation of Geometry is designed to exchange geometry data in ASCII form

update

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11134330]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-19 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found