Results 1 to 2 of 2

Thread: Stored Procedures

  1. #1
    Join Date
    Oct 2012
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Stored Procedures

    I am working on a student database for a project and I want the range of modules assigned to a particular cohort to be automatically inserted into the relevant tables once the cohort has been allocated to each student. I am trying to create a procedure which will insert this specific data to the relevant table once the administrator identifies the correct cohort for the student. The data in question i.e.the modules are pre-determined. The data is inserted to the relevant table using the Primary Key= student ID.It From researching the task it looks like a stored procedure is the way to go. Any suggestions as to how the syntax should be created would be much appreciated.

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    A stored procedure would be a good approach if you have several scripts/systems that all need to trigger the same action. In most cases it is unnecessary - but that doesn't mean you shouldn't do it that way if you decide it would be best. Keep in mind that most web hosts require you to buy a VPS before they allow stored procedures.

    Something else that occurs to me from reading your question is that, if the data is all "pre-determined," why not simply set that data as the default values for your table?

    Have you studied how stored procedures are written? What code do you have so far?

Similar Threads

  1. Convert SQL Server to Mysql 5.0 PROCEDURES
    By designervibe02 in forum MySQL and other databases
    Replies: 0
    Last Post: 04-10-2011, 03:44 PM
  2. sql stored procedure
    By aldo007 in forum MySQL and other databases
    Replies: 0
    Last Post: 08-30-2010, 02:41 PM
  3. use of stored procedures with php
    By MSK7 in forum PHP
    Replies: 1
    Last Post: 01-05-2010, 07:50 AM
  4. Increment a Value Stored in the DB
    By Moshambi in forum MySQL and other databases
    Replies: 3
    Last Post: 04-08-2009, 12:21 PM
  5. MS SQL stored Procedure
    By mahathi in forum MySQL and other databases
    Replies: 0
    Last Post: 08-11-2006, 07:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •