vibrokatana
08-28-2008, 04:40 PM
Ok, I am working with a really stupid application. In order for certain functions to work properly it needs to be able to see a primary key. The problem is we are working with a relational database and use a view to fetch the data. When the program scans the table (using describe or a similar query) it looks for the "PRI" in the key column, which is of course missing from the view.
The other option is to periodically download a rather ugly XML schema mapping it generates and manually add in the elements and key fields. However this is rather ugly and I am not even sure it will take it (it places the views in a separate definition, so it would be rather extensive, the file has over 1800 lines). And this would have to be updated every time the views are modified (usually about once every 5-8 months).
The "perfect" solution would be to define the primary key attribute for the views. However I don't think this is possible with MySQL, as the view syntax does not mention it.
The other option is to periodically download a rather ugly XML schema mapping it generates and manually add in the elements and key fields. However this is rather ugly and I am not even sure it will take it (it places the views in a separate definition, so it would be rather extensive, the file has over 1800 lines). And this would have to be updated every time the views are modified (usually about once every 5-8 months).
The "perfect" solution would be to define the primary key attribute for the views. However I don't think this is possible with MySQL, as the view syntax does not mention it.
