MCPcopy Index your code
hub / github.com/MapServer/MapServer / sdeGetRecord

Function sdeGetRecord

mapsde.c:583–896  ·  view source on GitHub ↗

-------------------------------------------------------------------- */ sdeGetRecord */ -------------------------------------------------------------------- */ Retrieves the current row as setup via the SDE stream query */ or row fetch routines. */ ------------------------------------------------

Source from the content-addressed store, hash-verified

581/* or row fetch routines. */
582/* -------------------------------------------------------------------- */
583static int sdeGetRecord(layerObj *layer, shapeObj *shape) {
584 int i;
585 long status;
586
587 double doubleval;
588 long longval;
589 struct tm dateval;
590
591 short shortval; /* new gdv */
592 float floatval;
593
594 SE_COLUMN_DEF *itemdefs;
595 SE_SHAPE shapeval=0;
596 msSDELayerInfo *sde;
597
598 SE_BLOB_INFO blobval;
599
600#ifdef SE_CLOB_TYPE
601 SE_CLOB_INFO clobval;
602#endif
603
604#ifdef SE_NCLOB_TYPE
605 SE_NCLOB_INFO nclobval;
606#endif
607
608#ifdef SE_NSTRING_TYPE
609 SE_WCHAR* wide=NULL;
610#endif
611
612
613 if(!msSDELayerIsOpen(layer)) {
614 msSetError( MS_SDEERR,
615 "SDE layer has not been opened.",
616 "sdeGetRecord()");
617 return MS_FAILURE;
618 }
619
620 sde = layer->layerinfo;
621
622 if(layer->numitems > 0) {
623 shape->numvalues = layer->numitems;
624 shape->values = (char **) malloc (sizeof(char *)*layer->numitems);
625 MS_CHECK_ALLOC(shape->values, sizeof(char *)*layer->numitems, MS_FAILURE);
626 }
627
628 status = SE_shape_create(NULL, &shapeval);
629 if(status != SE_SUCCESS) {
630 sde_error(status, "sdeGetRecord()", "SE_shape_create()");
631 return(MS_FAILURE);
632 }
633
634 itemdefs = layer->iteminfo;
635 for(i=0; i<layer->numitems; i++) {
636
637 /* do something special */
638 if(strcmp(layer->items[i],sde->row_id_column) == 0) {
639 status = SE_stream_get_integer(sde->connPoolInfo->stream, (short)(i+1), &shape->index);
640 if(status != SE_SUCCESS) {

Callers 2

msSDELayerNextShapeFunction · 0.85
msSDELayerGetShapeFunction · 0.85

Calls 10

msSDELayerIsOpenFunction · 0.85
msSetErrorFunction · 0.85
sde_errorFunction · 0.85
msSmallMallocFunction · 0.85
msLongToStringFunction · 0.85
msStrdupFunction · 0.85
msDoubleToStringFunction · 0.85
msFreeFunction · 0.85
sdeShapeCopyFunction · 0.85

Tested by

no test coverage detected