Statement not executed or executed statement has no resultset

191 views
Skip to first unread message

Narmada Karthika

unread,
Dec 1, 2023, 8:43:32 PM12/1/23
to Ansible Project
I am getting below error when trying to execute an Insert mssql query, the row is getting inserted but somehow failing with this 
Statement not executed or executed statement has no resultset
this is my playbook

- name: Insert into sql server
      community.general.mssql_script:
        login_user: 'username'
        login_password: "{{ mssql_login_password }}"
        login_host: "{{ mssql_server }}"
        login_port: "{{ mssql_port }}"
        db: testdb
        script: "insert into [Test].[RP].[ApplicationCategory] values (NULL,NULL,'xyz','repo',NULL,getdate(),1,NULL,'xyz',NULL,'xyz')"
      tags: jenkinsjob

Narmada Karthika

unread,
Dec 1, 2023, 8:44:44 PM12/1/23
to Ansible Project
correcting the yml formatting
- name: Insert into sql server
  community.general.mssql_script:
  login_user: 'username'
    login_password: "{{ mssql_login_password }}"
    login_host: "{{ mssql_server }}"
    login_port: "{{ mssql_port }}"
    db: testdb
    script: "insert into [Test].[RP].[ApplicationCategory] values (NULL,NULL,'xyz','repo',NULL,getdate(),1,NULL,'xyz',NULL,'xyz')"
  tags: jenkinsjob

Dick Visser

unread,
Dec 2, 2023, 1:54:09 AM12/2/23
to ansible...@googlegroups.com
That sounds like something specific to your script, which entirely depends on your environment 


Sent from Gmail Mobile


--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/05b03769-32fb-427b-889c-e5ade3b7767bn%40googlegroups.com.

Narmada Karthika

unread,
Dec 2, 2023, 2:05:51 AM12/2/23
to ansible...@googlegroups.com
I don’t think so, I see some others also had this issue on stack overflow, but that solution is giving me another error character max size.

Dick Visser

unread,
Dec 2, 2023, 2:50:16 AM12/2/23
to ansible...@googlegroups.com
What does the server side logs look like? I would increase log verbosity there

Narmada Karthika

unread,
Dec 4, 2023, 11:15:31 AM12/4/23
to Ansible Project
I am able to run the same playbook on jenkins server directtly, not using jenkins job
my pymssl : 2.2.7

Narmada Karthika

unread,
Dec 4, 2023, 5:42:56 PM12/4/23
to ansible...@googlegroups.com
Any other suggestions?



--
 Thanks,
Narmada Karthika Chitturi
 

Dick Visser

unread,
Dec 5, 2023, 12:55:48 AM12/5/23
to ansible...@googlegroups.com
On Mon, 4 Dec 2023 at 17:15, Narmada Karthika <chitt...@gmail.com> wrote:

I am able to run the same playbook on jenkins server directtly, not using jenkins job

Then problem is with 'using jenkins job', ie how ansible is invoked, not with ansible itself.

Also, what did the logs on the server side tell you?

Narmada Karthika

unread,
Dec 8, 2023, 5:20:21 PM12/8/23
to Ansible Project
I think I fixed the issue I added ;Select 1 this at the end of the insert statement and that fixed the issue when running mssql module to run an Insert query through jenkins console
Reply all
Reply to author
Forward
0 new messages