MYM and fields name '_key'
Afficher commentaires plus anciens
With many thanks again to the author of MYM! We use it heavily in a production environment on a number of Matlab licenses and machine types.
Recently an issue has cropped up that cannot have affected us only, although we get no matches on searches at this site.
One of our main (and elderly) tables uses a Primary Key (auto-incrementing) with the name '_key'. This seems to be a common database technique. However, Matlab does not allow variable names that start with an underscore! Thus the MYM query works perfectly and returns the struct with member _key in it. And Matlab displays this variable ok, ie:
quakeDump =
_key: [2179x1 double]
time: {2179x1 cell}
latitude: [2179x1 double]
longitude: [2179x1 double]
Yet any attempt to operate on this field gets us:
??? Error: File: blah.m Line: 42 Column: 11
The input character is not valid in MATLAB statements or expressions.
There must be some simple work-around we are missing? So far though, the only ways out we see include:
1. Rename field from '_key' to 'key", etc. Problem: impacts hundreds of lines of existing code, and we'll never hear the end of it!
2. Revert to our pre-MYM technique and use a PERL-DBI script to access the database. Problem: Slower than frozen molasses!
Does anybody have any suggestions? THANKS ALOT!
- Clark
1 commentaire
Walter Roberson
le 17 Mai 2012
Jan has a work around for this, but I never remember the keywords for searching for it.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Database Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!