> I get no result on my "EXPLAIN SELECT * FROM myTable WHERE 

You can use the following python script as a workaround.
It can be executed using <depend path>\bin\x_python.exe.

#!/usr/bin/env python
# explain.py
import sys
import sapdb

sql = """SELECT * FROM myTable 
WHERE FIELD1 IS NOT NULL
"""

# sql = sys.stdin.read ()

session = sapdb.connect ('USER', 'PASSWORD', 'DBNAME', '', 'component=ODBC')

def transformNull (value):
    if value is None:
        return '?'
    else:
        return value

def formatResultset (cursor):
    format = ''
    headers = []
    for desc in cursor.getDescription ():
        headers.append (desc [0])
        format = format + '|%-' + `desc [3]` + 's'
    print format % tuple (headers)
    for row in cursor:
        print format % tuple (map (transformNull, row))

def explain ():
    cursor = session.sql ('EXPLAIN ' + sql)
    formatResultset (cursor)

if __name__ == "__main__":
    explain ()

# end of script

Daniel Dittmar

-- 
Daniel Dittmar
SAP DB, SAP Labs Berlin
[EMAIL PROTECTED]
http://www.sapdb.org/
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to