Re Database Toolbox: quicker way to determine read-only columns
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi! I'm writing an automated database application, including automated inserts and updates; I'm trying to anticipate and deal with "failure modes" before they happen, rather than after. :-) Accordingly, I'd like to ensure that the program doesn't try to insert to/update read-only columns (e.g., primary keys); I've figured out how to do this by creating a cursor, querying the column(s) in question, and then examining its (their) attributes, but this seems like a lot of overhead, especially w.r.t. its time requirement. Before I figured out that way to do it, I spent quite a bit of time unsuccessfully trying to figure out if there was some object, method, or property associated w/ the database object (or one of its children) which either already had or quickly generated a list of primary keys (or, more generally, read-only columns). However, not really knowing what there might be, let me pose the question rather generally: is there a quicker and/or more elegant way to either generate a global list of read-only columns and/or determine if any given column is read-only? Thanks!
0 Kommentare
Antworten (1)
the cyclist
am 30 Dez. 2011
I am by no means an expert in this, and I do not know the specific answer to your question. However, I know that in PostgreSQL, there are "metatables" that contain information about the tables in the database. Here is a web page that shows how to find various bits of information about a PostgreSQL database. It looks like some of the comments talk about finding primary keys.
Since your question doesn't really have anything to do with MATLAB, you might be better off finding a forum that covers database questions.
Siehe auch
Kategorien
Mehr zu Database Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!