Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: Update XML Values using two primary keys

by jcb (Parson)
on Jan 06, 2021 at 23:31 UTC ( [id://11126486]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Update XML Values using two primary keys
in thread Update XML Values using two primary keys

Logically, the primary key here is a "geographic point" type, but SQL does allow a primary key to be declared as an arbitrary tuple of multiple columns in the same table. The PRIMARY KEY constraint must be written as a table constraint instead of a column constraint to do this.

For our questioner's example, and assuming a database that does not directly support lat/long coordinates (i.e. not Postgres with PostGIS installed), there could be a table like: (untested)

CREATE TABLE tags ( lat numeric(24,20), lon numeric(24,20), name text, PRIMARY KEY(lat, lon));

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found