Syntax to insert multiple values
Last Post 10-18-2012 04:54 AM by Ryan Bakerink. 6 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
CollinUser is Offline
going with the flow
going with the flow
Posts:57
Avatar

--
10-16-2012 05:39 PM
    What is the syntax to use for an insert completion event to add multiple values from a combo box?

    Thanks in advance
    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    10-16-2012 08:17 PM
    To be clearer, I'd like to insert data into a SQL table using the checkbox group. How do I pass the selected values from the checkbox group to a SQL table using the completion event?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    10-17-2012 04:52 AM
    Hello Collin,

    The Checkbox Group in Dynamic Forms will concatenate all of the values into a comma separated list.

    Let's say that you have a Checkbox Group with the shortfield name of "RSVP" with the Following checkboxes:
    * Yes
    * Maybe
    * No

    If a User checked all of these checkboxes, then the value would look like this when trying to use the token in a SQL Completion Event:

    '$(RSVP)' would render to: Yes,Maybe,No

    Please let me know if you have any questions.

    Thanks,

    Ryan
    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    10-17-2012 10:49 AM
    Ah, so I need to take a comma separated sting value and write a SQL statement that will delimit it so that each value can be passed to a table.

    Any idea on what SQL statement to use on that?
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    10-17-2012 11:04 AM
    Hello Collin,

    If you use this SP call:

    usp_InsertStoredProcedure '$(RSVP)'

    And all three checkboxes were checked, then the call renders to this:

    usp_InsertStoredProcedure 'Yes,Maybe,No'

    If you need to separate these values, I would recommend looking for a SQL Split Function:
    http://stackoverflow.com/questions/...lit-string

    The Function in the post from the link I gave you will return three separate values:

    * 'Yes'
    * 'Maybe'
    * 'No'

    The issue is that all of these values at the moment are 1 value. You need to split based off of a comma being the delimiter. Based on the values returned, you can run a series of different events.

    Please let me know if you have any questions.

    Thanks,

    Ryan

    CollinUser is Offline
    going with the flow
    going with the flow
    Posts:57
    Avatar

    --
    10-17-2012 04:42 PM
    That worked. Thanks for the lead.
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    10-18-2012 04:54 AM
    Glad that I could be of assistance.

    Have a great day!

    -Ryan


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi