# oracle\_sql module question

**URL:** <https://forum.ansible.com/t/oracle-sql-module-question/32060>\
**Category:** Ansible Developer\
**Tags:** aws\
**Created:** [January 25, 2020, 3:09pm UTC](https://forum.ansible.com/t/oracle-sql-module-question/32060 "2020-01-25T15:09:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anand\_Solomon](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@Anand\_Solomon](https://forum.ansible.com/u/Anand_Solomon)\
**Post date:** [January 25, 2020, 3:09pm UTC](https://forum.ansible.com/t/oracle-sql-module-question/32060/1 "2020-01-25T15:09:04Z")

</div>

Hi,  
I am trying to run a sql script which has simple select statement. (select username from dba\_users). Will oracle\_sql module run a “Select” statement and returns the results ?

My playbook is

- name: Script will creates Oracle DBA IDs and Profiles on AWS RDS.  
oracle\_sql:  
username: “{{user}}”  
password: “{{password}}”  
service\_name: “{{sname}}”  
port: “{{prt}}”  
host: “{{host}}”  
script: “/home/ansible/Compliance.sql”  
environment: “{{oracle\_env}}”  
register: query\_result  
connection: local

If I run the sql statement as sql: “select username from dba\_users”, it works. The same sql statement if I run script: /home/ansible/Compliance.sql. It is not working.

I am getting "{“changed”: false, “msg”: “Something went wrong while executing sql - ORA-00972: identifier is too long sql: "Finished running script /home/ansible/Compliance.sql \nContents: \nselect username\\n \ from dba\_users"”}

The debug output is as below:

TASK [Display the query results] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [22.174.101.30] =\> (item=msg.stdout) =\> {  
“msg”: {  
“changed”: true,  
“failed”: false,  
“msg”: “Finished running script /home/ansible/Compliance.sql \nContents: \nselect username from dba\_users”  
}  
}
