highball2006

Load database rows into Python List or Dictionary?

Discussion created by highball2006 on Aug 26, 2012
Latest reply on Aug 27, 2012 by highball2006
SDE 9.3.1
ArcGIS/Catalog 9.3.1
Python 2.5
Oracle 11.1.0.6.0

Using gp.CreateObject("ARCSDESQLEXECUTE", <conn_name>)

Table: T_TRANSFER

OBJECTID NUMBER(38)
FC_NAME TEXT(50)
FC_NAME_2 TEXT(50)
FC_NAME_3 TEXT(50)
TRANSFER_DATE (DATE)

SQL = SELECT * FROM T_TRANSFER ORDER BY FC_NAME

I'm a little new to Python and was wondering how you can read records from a Table in Oracle (SDE) into a List (?) or Dictionary(?) or "something-else" so I can reuse it later in my code.

Pseudo-code

[1] Load rows into Dictionary or List or "something-else"?

Later in code???

[2] Loop through rows make data count on Feature Classes named in Colum "FC_NAME"

[3] Loop through rows make delete on Feature Classes named in Colum "FC_NAME"

[4] Loop through rows make delete on Feature Classes named in Colum "FC_NAME_2"


Steps [2], [3] and [4] are ok to code - I just seem to be having issues in [1] and then making a reference to loop through rows.


Can anyone help?

Outcomes