| 1 | <?xml version="1.0" encoding="utf-8"?> |
|---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Open Method</title><link rel="stylesheet" type="text/css" href="lib.css?format=raw" /><style xml:space="preserve"> |
|---|
| 4 | td.metadataTitle { font-size: 80%; font-weight: bold; font-family: avantgarde, sans-serif; } |
|---|
| 5 | td.metadataValue { padding-left: 0.5em; } |
|---|
| 6 | </style></head><body><div class="navigation"><div><table align="center" width="100%" cellpadding="0" cellspacing="2"><tr><td class="online-navigation"><a title="NextRow Method" href="Method_GeoEco.DatabaseAccess.SelectCursor.NextRow.html?format=raw"><img src="previous.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Previous Page" /></a></td><td class="online-navigation"><a title="SelectCursor Class" href="Class_GeoEco.DatabaseAccess.SelectCursor.html?format=raw"><img src="up.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Up one Level" /></a></td><td class="online-navigation"><a title="SetRowCount Method" href="Method_GeoEco.DatabaseAccess.SelectCursor.SetRowCount.html?format=raw"><img src="next.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Next Page" /></a></td><td align="center" width="100%">GeoEco Python Reference</td><td class="online-navigation"><a title="Table of Contents" href="TableOfContents.html?format=raw"><img src="contents.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Table of Contents" /></a></td><td class="online-navigation"><a title="Module Index" href="ModuleIndex.html?format=raw"><img src="modules.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Module Index" /></a></td><td class="online-navigation"><img src="blank.png?format=raw" border="0" align="bottom" height="32" width="32" alt="" /></td></tr></table><div class="online-navigation"><b class="navlabel">Previous:</b> <a class="sectref" href="Method_GeoEco.DatabaseAccess.SelectCursor.NextRow.html?format=raw">NextRow Method</a> <b class="navlabel">Up:</b> <a class="sectref" href="Class_GeoEco.DatabaseAccess.SelectCursor.html?format=raw">SelectCursor Class</a> <b class="navlabel">Next:</b> <a class="sectref" href="Method_GeoEco.DatabaseAccess.SelectCursor.SetRowCount.html?format=raw">SetRowCount Method</a> </div><hr /></div></div><h1><tt class="member">Open</tt> Method</h1><p>Opens the cursor.</p><table cellpadding="0" cellspacing="0"><tr valign="baseline"><td class="metadataTitle">Class:</td><td class="metadataValue"><tt class="class"><a href="Class_GeoEco.DatabaseAccess.SelectCursor.html?format=raw">SelectCursor</a></tt></td></tr><tr valign="baseline"><td class="metadataTitle">Intended use:</td><td class="metadataValue"><span style="color: red;">Intended for GeoEco internal use only; not recommended for external callers</span></td></tr><tr valign="baseline"><td class="metadataTitle">COM:</td><td class="metadataValue">Not exposed by a COM class</td></tr><tr valign="baseline"><td class="metadataTitle">ArcGIS:</td><td class="metadataValue">Not exposed as an ArcGIS geoprocessing tool</td></tr><tr valign="baseline"><td class="metadataTitle">Method type:</td><td class="metadataValue">Instance Method</td></tr></table><h3>Usage</h3><table cellpadding="0" cellspacing="0"><tr valign="baseline"><td style="white-space: nowrap;"><var>cursor.</var><b><tt class="method">Open</tt></b>(</td><td><var>connection</var><var>, table</var><big>[</big><var>, fields</var><big>[</big><var>, where</var><big>[</big><var>, orderBy</var><big>[</big><var>, directions</var><big>[</big><var>, spatialReference</var><big>[</big><var>, rowCount</var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table><h3>Arguments</h3><dl><dt><var>connection</var></dt><dd><table cellpadding="0" cellspacing="0" style="margin-top: 1.0em;"><tr valign="baseline"><td class="metadataTitle">Python type:</td><td class="metadataValue"><tt class="class">GeoEco.DatabaseAccess.DatabaseConnection</tt></td></tr></table><p>DatabaseConnection instance that manages the database connection that should be |
|---|
| 7 | used to open this cursor.</p></dd></dl><dl><dt><var>table</var></dt><dd><table cellpadding="0" cellspacing="0" style="margin-top: 1.0em;"><tr valign="baseline"><td class="metadataTitle">Python type:</td><td class="metadataValue"><tt class="class">unicode</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Minimum length:</td><td class="metadataValue">1</td></tr></table><p>Database table to access.</p></dd></dl><dl><dt><var>fields</var></dt><dd><table cellpadding="0" cellspacing="0" style="margin-top: 1.0em;"><tr valign="baseline"><td class="metadataTitle">Python type:</td><td class="metadataValue"><tt class="class">list</tt> of <tt class="class">unicode</tt>, or <tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Default value:</td><td class="metadataValue"><tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Minimum length:</td><td class="metadataValue">0</td></tr></table><p>Fields to retrieve for each row (i.e., the columns specified in |
|---|
| 8 | the SELECT clause of a SQL SELECT statement). If no fields are |
|---|
| 9 | provided, all fields will be returned. If the underlying database does |
|---|
| 10 | not support specifying fields in the SELECT clause, an error will be |
|---|
| 11 | raised.</p><p>Do not provide "*", as would be done in a SQL SELECT statement that |
|---|
| 12 | wanted to retrieve all fields. To retrieve all fields, simply omit |
|---|
| 13 | this parameter when you call this method.</p><p>This usual reason to suppy a list of fields is to minimize database |
|---|
| 14 | and network load. If you are not concerned about database peformance, |
|---|
| 15 | there is no reason to provide a value for this parameter.</p></dd></dl><dl><dt><var>where</var></dt><dd><table cellpadding="0" cellspacing="0" style="margin-top: 1.0em;"><tr valign="baseline"><td class="metadataTitle">Python type:</td><td class="metadataValue"><tt class="class">unicode</tt> or <tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Default value:</td><td class="metadataValue"><tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Minimum length:</td><td class="metadataValue">1</td></tr></table><p>SQL WHERE clause expression that specifies the subset of rows to |
|---|
| 16 | process. If this parameter is not provided, all of the rows will be |
|---|
| 17 | processed. If this parameter is provided but the underlying database |
|---|
| 18 | does not support WHERE clauses, an error will be raised.</p><p>The exact syntax of this expression depends on the underlying database |
|---|
| 19 | and the type of connection used to access it. If you are using the |
|---|
| 20 | ArcGIS geoprocessor to access the database, ESRI recommends you |
|---|
| 21 | reference fields using the following syntax:</p><ul><li>If you're querying ArcInfo coverages, shapefiles, INFO tables or |
|---|
| 22 | dBASE tables (.dbf files), enclose field names in double quotes in |
|---|
| 23 | the SQL expression: "MY_FIELD".</li><li>If you're querying Microsoft Access tables or personal |
|---|
| 24 | geodatabase tables, enclose field names in square brackets: |
|---|
| 25 | [MY_FIELD].</li><li>If you're querying ArcSDE geodatabase tables, an ArcIMS feature |
|---|
| 26 | class, or an ArcIMS image service sublayer, don't enclose field |
|---|
| 27 | names: MY_FIELD.</li></ul></dd></dl><dl><dt><var>orderBy</var></dt><dd><table cellpadding="0" cellspacing="0" style="margin-top: 1.0em;"><tr valign="baseline"><td class="metadataTitle">Python type:</td><td class="metadataValue"><tt class="class">list</tt> of <tt class="class">unicode</tt>, or <tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Default value:</td><td class="metadataValue"><tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Minimum length:</td><td class="metadataValue">0</td></tr></table><p>Fields that will be used to sort the rows (i.e., the columns |
|---|
| 28 | specified in the ORDER BY clause of a SQL SELECT statement). If no |
|---|
| 29 | fields are provided, the rows will be sorted in the default order |
|---|
| 30 | determined by the underlying database. If this parameter is provided |
|---|
| 31 | but the underlying database does not support ORDER BY clauses, an |
|---|
| 32 | error will be raised.</p><p>In addition to specifying the ORDER BY fields, you must also specify |
|---|
| 33 | the sort direction for each field.</p></dd></dl><dl><dt><var>directions</var></dt><dd><table cellpadding="0" cellspacing="0" style="margin-top: 1.0em;"><tr valign="baseline"><td class="metadataTitle">Python type:</td><td class="metadataValue"><tt class="class">list</tt> of <tt class="class">unicode</tt>, or <tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Default value:</td><td class="metadataValue"><tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Minimum length:</td><td class="metadataValue">0</td></tr></table><p>List of strings, either 'Ascending' or 'Descending', that specify |
|---|
| 34 | the sort directions for the ORDER BY fields. If this parameter is |
|---|
| 35 | provided but the underlying database does not support ORDER BY |
|---|
| 36 | clauses, an error will be raised.</p></dd></dl><dl><dt><var>spatialReference</var></dt><dd><table cellpadding="0" cellspacing="0" style="margin-top: 1.0em;"><tr valign="baseline"><td class="metadataTitle">Python type:</td><td class="metadataValue"><tt class="class">unicode</tt> or <tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Default value:</td><td class="metadataValue"><tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Minimum length:</td><td class="metadataValue">1</td></tr></table><p>Coordinate system into which coordinate fields should be |
|---|
| 37 | projected. At the time of this writing, only the ArcGIS geoprocessor |
|---|
| 38 | supported this parameter. Please see the ArcGIS documentation for more |
|---|
| 39 | information.</p><p>If the connection's SpatialReferenceSupported property is False, this |
|---|
| 40 | method will fail if you provide a value for this parameter.</p></dd></dl><dl><dt><var>rowCount</var></dt><dd><table cellpadding="0" cellspacing="0" style="margin-top: 1.0em;"><tr valign="baseline"><td class="metadataTitle">Python type:</td><td class="metadataValue"><tt class="class">int</tt> or <tt class="class">None</tt></td></tr><tr valign="baseline"><td class="metadataTitle">Default value:</td><td class="metadataValue"><tt class="class">None</tt></td></tr></table><p>The number of rows that will be retrieved by this cursor, if |
|---|
| 41 | known.</p><p>This parameter is optional and only used in reporting progress to the |
|---|
| 42 | user. If a value is provided, the progress reports will include the |
|---|
| 43 | number of rows remaining and an estimated time of completion. If a |
|---|
| 44 | value is not provided, the progress reports will only include the |
|---|
| 45 | number of rows retrieved so far.</p><p>If a value is not provided for this parameter or for the WHERE clause |
|---|
| 46 | parameter, and the underlying database supports retrieval of row |
|---|
| 47 | counts (i.e. GetRowCountSupported is True), then the row count will be |
|---|
| 48 | obtained from the database when the cursor is opened.</p></dd></dl><h3>Remarks</h3><p>This method will fail if the database connection is not open. Once |
|---|
| 49 | the cursor has been opened, it cannot be re-opened. To open another |
|---|
| 50 | cursor, instantiate another cursor object.</p><div class="navigation"><div class="online-navigation"><p></p><hr /><table align="center" width="100%" cellpadding="0" cellspacing="2"><tr><td class="online-navigation"><a title="NextRow Method" href="Method_GeoEco.DatabaseAccess.SelectCursor.NextRow.html?format=raw"><img src="previous.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Previous Page" /></a></td><td class="online-navigation"><a title="SelectCursor Class" href="Class_GeoEco.DatabaseAccess.SelectCursor.html?format=raw"><img src="up.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Up one Level" /></a></td><td class="online-navigation"><a title="SetRowCount Method" href="Method_GeoEco.DatabaseAccess.SelectCursor.SetRowCount.html?format=raw"><img src="next.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Next Page" /></a></td><td align="center" width="100%">GeoEco Python Reference</td><td class="online-navigation"><a title="Table of Contents" href="TableOfContents.html?format=raw"><img src="contents.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Table of Contents" /></a></td><td class="online-navigation"><a title="Module Index" href="ModuleIndex.html?format=raw"><img src="modules.png?format=raw" border="0" align="bottom" height="32" width="32" alt="Module Index" /></a></td><td class="online-navigation"><img src="blank.png?format=raw" border="0" align="bottom" height="32" width="32" alt="" /></td></tr></table><div class="online-navigation"><b class="navlabel">Previous:</b> <a class="sectref" href="Method_GeoEco.DatabaseAccess.SelectCursor.NextRow.html?format=raw">NextRow Method</a> <b class="navlabel">Up:</b> <a class="sectref" href="Class_GeoEco.DatabaseAccess.SelectCursor.html?format=raw">SelectCursor Class</a> <b class="navlabel">Next:</b> <a class="sectref" href="Method_GeoEco.DatabaseAccess.SelectCursor.SetRowCount.html?format=raw">SetRowCount Method</a> </div><hr /><span class="release-info">Marine Geospatial Ecology Tools version 0.6</span></div></div></body></html> |
|---|