Opened 16 years ago

Closed 16 years ago

#2523 closed enhancement (fixed)

pssibility to always used qualifed names for attributes

Reported by: assefa Owned by: assefa
Priority: normal Milestone: 5.2 release
Component: Input - Native SDE Support Version: unspecified
Severity: normal Keywords:
Cc:

Description

This is en e-mail conversation between Assefa and Howard:

Hi There,

Working with mapserver/sde layers, we came across an issue where the attribute names used (ex for a querybyattributes) must be qualified if there is a Join done on the layer and non-qualified if there is no join. Note that this is documented. Do you see any advantage/problem to always be able to use qualified names either there is a join or not? At least be able for those who want it, to be able to have a setting so that qualified names are always used. (this would preserve the way it works now if there is nothing set)

Howard's answer

If I remember correctly, I had a lot of trouble with qualified names and joins with SDE. I settled with what we have now to attempt to preserve existing behavior for folks while still allowing in-database joins to happen. I would support adding some sort of PROCESSING item to switch on fully qualified names, or if there is enough support for 5.2, just moving to always returning and using qualified names (this would require mapfile changes for folks, however).

Change History (3)

comment:1 by assefa, 16 years ago

This is a possible patch that can be applied to have a processing value (PROCESSING "ATTRIBUTE_QUALIFIED=TRUE") that the user can set to always use qualified names. If the processing value is not set (or set to something other that TRUE) the current behavior is maintained. It was tested locally on my machine for such things as layer.getitem and querybyattributes.

Index: mapsde.c =================================================================== --- mapsde.c (revision 7396) +++ mapsde.c (working copy) @@ -267,7 +267,9 @@

}

  • if (sde->join_table) {

+ proc_key = msLayerGetProcessingKey(layer,"ATTRIBUTE_QUALIFIED");

+ if (sde->join_table

+ (proc_key && strcasecmp( proc_key, "TRUE") == 0)) {

strcat(full_column_name, sde->table); strcat(full_column_name, "."); strcat(full_column_name, column_name);

@@ -1822,6 +1824,8 @@

nBaseColumns = 0; nJoinColumns = 0;

+ char *proc_key = NULL; +

if (!msSDELayerIsOpen(layer)) {

msSetError( MS_SDEERR,

"SDE layer has not been opened.",

@@ -1935,7 +1939,10 @@

} else {

msDebug("layer->items has already been initialized!!!");

}

  • if (!sde->join_table) {

+ + proc_key = msLayerGetProcessingKey(layer,"ATTRIBUTE_QUALIFIED"); + if (!sde->join_table &&

+ (proc_key == NULL
strcasecmp( proc_key, "TRUE") != 0)) {

for(i=0; i<layer->numitems; i++) layer->items[i] = strdup(all_itemdefs[i].column_name); for(i=0; i<layer->numitems; i++) { /* requested columns */

for(j=0; j<layer->numitems; j++) { /* all columns */

comment:2 by assefa, 16 years ago

Owner: changed from hobu to assefa
Status: newassigned

any objections if I apply this patch?

comment:3 by assefa, 16 years ago

Resolution: fixed
Status: assignedclosed

patch applied. Closing.

Note: See TracTickets for help on using tickets.