Looks like we can only use sql parameter in oracle_sql module.

On Saturday, January 25, 2020 at 5:30:05 PM UTC-5, Dick Visser wrote:
>
> This isn't a module that ships with ansible, please contact the 
> module's authors for support. 
>
> On Sat, 25 Jan 2020 at 16:03, Anand Solomon <[email protected] 
> <javascript:>> wrote: 
> > 
> > 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" 
> >     } 
> > } 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Ansible Project" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected] <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/d4403538-8111-4e52-87af-390efa2dd5cd%40googlegroups.com.
>  
>
>
>
>
> -- 
> Dick Visser 
> Trust & Identity Service Operations Manager 
> GÉANT 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7e5f2424-992c-4777-a0f9-738511d1bf43%40googlegroups.com.

Reply via email to