Alpha Video Training
Results 1 to 7 of 7

Thread: How to run a Stored Procedure?

  1. #1
    "Certified" Alphaholic
    Real Name
    Jetson Lilibeth
    Join Date
    Dec 2011
    Posts
    1,083

    Default How to run a Stored Procedure?

    1. How do I run a stored procedure with parameters when I save an invoice using the ux component or dialog component?
    2. How do I run a procedure with output parameters? When I click a button
    3. How do I run a stored procedure with no parameters? and Automatically when the built in save button is clicked on a dialog or UX component

    Thanks very much!

  2. #2
    Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,595

    Default Re: How to run a Stored Procedure?

    Jetson - you would probably find all the answers you need if you use the Search feature of this board first. For starters, see the related threads at the bottom of this one.
    -Steve


  3. #3
    "Certified" Alphaholic
    Real Name
    Jetson Lilibeth
    Join Date
    Dec 2011
    Posts
    1,083

    Default Re: How to run a Stored Procedure?

    The answers are " Report this to alpha, it may be a bug" etc. Where are the answers Steve Working + s?

  4. #4
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,595

    Default Re: How to run a Stored Procedure?

    Are you using MySQL or MSSql or other? Makes a difference in syntax.
    Pat Bremkamp
    MindKicks Consulting

  5. #5
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    1,002

    Default Re: How to run a Stored Procedure?

    Here's a related posted in V11 newsgroup: http://msgboard.alphasoftware.com/al...ored+procedure

    Here is a wiki article on passing a parameter to SQL proc: http://wiki.alphasoftware.com/~alpha...rs+from+Xbasic

    I don't know about "output parameters" - I just have my scaler stored procedures return data as if it were doing a select statement. For example, I have an ms-sql proc that takes a number of input parameters and creates a record. The data I want returned from the proc include: The identity value of the created record and the values from two columns in a related lookup record. So, the the final statement in my stored procedure is something like this:

    SELECT New_SysID = @@IDENTITY, SomeValue1, SomeValue2 FROM SomeTable WHERE (SomeTable.SysID = @p1)

    The error handler in the sql proc has this for its last line:

    SELECT New_SysID = 0, '' AS SomeValue1, '' AS SomeValue2

    In XBasic, after the call to the proc I just check for success and then read the result from the record set as if it were a normal SELECT statement.

    The sql-proc has no other SELECT statements in the format that would return a record set.

  6. #6
    "Certified" Alphaholic
    Real Name
    Jetson Lilibeth
    Join Date
    Dec 2011
    Posts
    1,083

    Default Re: How to run a Stored Procedure?

    How do I use it on a grid component or ux component, I want that when data is saved then it will automatically execute the code, is the code applicable in the grid or ux component? Or maybe put the code on a button.

  7. #7
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    1,002

    Default Re: How to run a Stored Procedure?

    In the Grid Builder select the "Server-side Events" node under "Code" in the left-hand panel. Under the "Server-side Events" column notice the events:
    AfterUpdateRecords
    AfterUpdateRecord
    AfterInsertRecord
    AfterDeleteRecord

    To learn about these events, just go to the "Help" menu in Alpha and select Video Finder. In the filter box type: afterupdate
    Watch the videos under SSE2.
    Then in the video filter box type:
    after update

    With the space. it comes up with video D47 for dialog/UX.

Similar Threads

  1. Stored procedure issues
    By canc in forum Application Server Version 11 - Web/Browser Applications
    Replies: 4
    Last Post: 06-13-2016, 11:15 PM
  2. MySQL Stored Procedure
    By Tasos in forum Application Server Version 11 - Web/Browser Applications
    Replies: 7
    Last Post: 07-22-2013, 02:08 PM
  3. Help with Basic Stored Procedure
    By gaby_h in forum Application Server Version 11 - Web/Browser Applications
    Replies: 5
    Last Post: 06-26-2013, 06:33 PM
  4. how to use Stored Procedure in grid???
    By Tony Anderson in forum Application Server Version 8
    Replies: 4
    Last Post: 03-05-2008, 08:49 PM
  5. MYSQL stored procedure
    By asawyer13 in forum Web Application Server v7
    Replies: 1
    Last Post: 06-28-2006, 01:07 PM

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
  •