oravirt / ansible-oracle-modules

Oracle modules for Ansible
MIT License
214 stars 161 forks source link

Oracle Parameter #137

Closed sathishbbala closed 4 years ago

sathishbbala commented 4 years ago

Can someone please help me understand why I am needed to change the following code?

elif name.startswith('_') and mode == 'sysdba':
    sql = 'select **count(*)** from sys.x$ksppi where ksppinm = lower(\'%s\')' % name

else:
    sql = 'select **count(*)** from v$parameter where name = lower(\'%s\')' % name

try:
        cursor.execute(sql)
        result = (cursor.fetchone())
except cx_Oracle.DatabaseError as exc:
        error, = exc.args
        msg = error.message+ 'sql: ' + sql
        return False

**if result is None:
    msg = 'The parameter (%s) doesn\'t exist' % name
    return False
else:
    return True**
oravirt commented 4 years ago

What is the problem you're trying to solve?

sathishbbala commented 4 years ago

Here is my code:


I ran into an error with this piece of code earlier but not now. Not sure what changed.

oravirt commented 4 years ago

Ok, so it’s not a problem anymore?

sathishbbala commented 4 years ago

No, no errors now