Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

input multiple data into table with one entry

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    input multiple data into table with one entry

    Is there any way to have a single entry into a table be a trigger to create multiple rows of data?

    Here is a for example:

    If I am creating a sales map, and have a sales rep that covers the south east, I would love to be able to set them up as southeast somehow, and that creates multiple rows, one for each state in the south east (north carolina, south carolina, etc, etc).

    I want a row for each state, because I've got a clickable map where a customer might click on georgia, and I want that sales rep to show up as a contact for that state.

    Does that make sense? Thanks.

    #2
    Re: input multiple data into table with one entry

    You could set up a "template" table which carries all the States and their Region. When you need to set up a sales rep, fire off a Stored Proc that selects all the records from the template with the Region needed... and inserts them into your sales map table. You'd pass into the Proc the Region (for the template Select) and the sales rep Id (for the Insert).

    Comment


      #3
      Re: input multiple data into table with one entry

      David, that sounds like a great idea. I'm still sort of a newbie, could you point me in the general direction of how I would set that up? Thanks.

      Comment


        #4
        Re: input multiple data into table with one entry

        I think this needs to go back to how your tables are setup to THEN determine how you would make the call to pull out of the database what you want. I would bet that 5 guys could give you 5 diff scenarios on how to accomplish this - none of them wrong, even if they were not the best. The best would really be determined by your needs.
        First how are you storing the info?
        If your table column for the "state" that they are reps for contains just one state name and your considering creating a new row for each state they rep that might be one way.
        Another way would be to have a table of states, each with a numeric ID then in the reps table you list the ID's instead of the state names.

        Your button would essentially create a list of reps where the ID matched the state ID in the URL - there are (youtube?) videos on how to use the URL itself in the call - David I think was just discussing this in another thread the other day.

        So again, you may want to say how your storing the info first, maybe even how your inputting it into the database, then how are you making the call - is it a state specific URL? is it just a list that can be searched? A searchable list would be the fastest way for a new guy to do it - in my opinion anyway.
        All you have to do is create a list, include a search section and put the search function on the state column - add in the search and clear filter buttons and that should work pretty much right out of the box.

        Once you build that it wouldn't be long before you can start working through setting up a filter or "search" through the URL.

        Good luck!
        NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

        Comment


          #5
          Re: input multiple data into table with one entry

          You don't say which sql database you're using... the Stored Proc Alpha call for SQL Server and MySQL are different. This forum has posts about the proper syntax for each. For the sql database you're using, Google creating a Stored Proc with parameters... you'll find a lot of good information. You could do the record creation in XBasic which means a lot of looping. Go the Stored Proc route... it's a valuable skill to have... and worth the time understanding it.

          Within your sql database manager, create the Stored Proc and test it there... ensure it's working properly. Then worry about the call from Alpha.

          Comment


            #6
            Re: input multiple data into table with one entry

            I'm using MySQL.

            I've got one table called sales_rep that has the following fields:

            name, title, phone, email, picture

            I've got another table called sales_rep_state_mapping, which has the following fields:

            record ID, email, state

            I've created a view named sales_rep_view which joins the two based on the email field.


            For admin purposes, I created a tabbed UI. Inside of that, I have button to create a sales rep, which is where you can input data into the sales_rep table. I have a second button where you can then link that sales rep to multiple states (dropping that data into the sales_rep_state_mapping table). The process right now would be to select the email address of the sales rep from a dropdown, and then select a state from the dropdown. And basically just keep doing this over and over until you have that email address associated with as many states as you want.

            And then I have an html map. Clicking on a state on that map takes you to a UX component I created that pulls data from the sales_rep_view table.

            This is what it looks like so far:

            https://snap.scansourcesecurity.com/sales_map.htm

            Comment


              #7
              Re: input multiple data into table with one entry

              Perhaps you should enable multiple selections for the state drop down.
              NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

              Comment


                #8
                Re: input multiple data into table with one entry

                Hey Charles, thanks for the idea. I tried multiple selections using checkboxes, but that became problematic when I tried to go from my clickable map to the UX component filtered by state.

                I ended up restructuring my data which seems to work ok. I created a table where I defined regions. So for example I would have an East, West, North, whatever region. And then I mapped specific states to regions. And then I created a view that pulled together my sales data with the region table. This works much better, as I only have to define the regions once, and then when I add a new sales rep, I just specify which region they are in, and it dumps all of the entries into my view for that rep with each state.

                Thanks all for the feedback.

                Comment

                Working...
                X