Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: DBI placeholders for spatial data

by LanX (Sage)
on Jun 26, 2021 at 11:23 UTC ( #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? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2022-05-21 22:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (78 votes). Check out past polls.

    Notices?