Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command - InfoPath Dev
in

InfoPath Dev

Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

Last post 01-22-2013 11:28 AM by Mfranco. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 01-21-2013 02:52 PM

    Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Hey guys,

    Im having a rather odd issue. Im trying to execute a stored procedure in sql using the qrules command ExecuteSqlQuery.

    I set a fields value: Command

    I use this formula( bear with me im going off of memory server is down for maintenance): concat("ExecuteSqlQuery /dsname=SQLConnect /sql=Execute dbo.prj_event_interface_imp3_insert @passed_prj_code = SingleQuoteDoubleQuote, my:prj, DoubleQuoteSingleQuoteDoubleQuote ) yes, where SQLConnect is located I have my data connection in place.

    I may not have that exactly right but soon as i can ill post the actual expression, its along these lines though. Now for the problem. I succesfully got it to trigger the stored procedure and if i remember right it's with parameters. But we had some issues with our Query, we began to conduct testing, so i disabled the action rule(my ExecuteSqlQuery) and went to submit again. Expecting to see data in all my tables in SQL we found that the stored procedure we created was still being triggered. Our stored procedure statement contains a truncate for the two tables we intially submit to, An insert statement moves that data into our target DB before said truncate. With the rule disabled it should not be truncating nor inserting or anything in our stored procedure. So I then deleted the rule all together. Closed and reopened the form(the designer not just the preview). Opened, previewed and submit. Only to see that STILL our stored procedure was being executed. We've gone over all established data connections and inspected all our queries for anything that could have possibly be triggering this event. Nothing else points to it.

    Any help you guys can come up would great. I know you guys are busy. Thank you in advance.

  • 01-21-2013 03:03 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Is the data connection still in the form? Is it set to execute on load?
    Hilary Stoupa

  • 01-21-2013 03:10 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    It is still on the form, It is not set to load upon opening. Its only set to execute(when i did have the rule set) on the submit button.Thank you for your quick response.
  • 01-21-2013 03:17 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Can I take a look at your form? If you aren't comfortable attaching it under the Options tab, email to Support AT Qdabra DOT com and mention this thread in the email.
    Hilary Stoupa

  • 01-21-2013 03:31 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Hilary that will not be a problem, soon as the server is back up and i can rdc in, i will email it over with this thread and tags. Please keep in mind this is the same form that Joann is working with Charlie(CCBS). You too i believe have hand in it as well. Does this help?
  • 01-21-2013 03:37 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Well - the heart of the question seems to be:

    Why is this form executing a qRules command that has been removed?

    And that's why I want to take a look at the form - see if there is some logic hanging out somewhere making trouble. :-)

    Hilary Stoupa

  • 01-21-2013 03:48 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Indeed that is the heart of it. I appreciate your rapid responses. I will update and provide a copy ASAP.
  • 01-21-2013 04:17 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    I talked with my boss he would like me to email you the form directly, please.

  • 01-21-2013 04:33 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Sounds good - can you email it to the Support alias listed above? Or do you need to email directly to me?
    Hilary Stoupa

  • 01-21-2013 04:38 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Directly to you if you wouldnt mind please.

  • 01-21-2013 04:56 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    On its way, and I'm going to delete your message w/ your email address in it. :)
    Hilary Stoupa

  • 01-21-2013 05:13 PM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Thank you kindly. ;)
  • 01-22-2013 08:05 AM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    I see nothing in the form. Any chance there is a trigger on your DB tables that is executing your stored proc? Can you run SQL Server Profiler while walking through the steps you are performing to repro this?
    Hilary Stoupa

  • 01-22-2013 08:58 AM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Hilary,

    Thank you for taking the time to look over the form. I am undergoing the process to see if anything at all could be triggering the SP. We looked over all triggers and we find nothing. i will get back to you soon as i find anything of use or questionable. Thank you for your expedience.

  • 01-22-2013 11:28 AM In reply to

    Re: Executing a Stored Procedure in a SQL DB using the ExecuteSqlQuery command

    Found our problem!!! nothing to do with form. Found our main UDC was pointing at the wrong DB. Bypassing our target DB. Thank you for help. Thought id update you on what we found.
Page 1 of 1 (15 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.