Results 1 to 11 of 11

Thread: Call functions from stored procedured.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2009
    Posts
    66

    Call functions from stored procedured.

    I heard 3 tier architect. But i dont know how can i call procedures from back end layer.

    please give me a simple example.

    Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Call functions from stored procedured.

    Are you asking how your database executes methods in your VB code? The answer is that it doesn't, no matter the architecture. Your data access layer executes stored procedures and the database returns the results. That's it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2009
    Posts
    66

    Re: Call functions from stored procedured.

    Quote Originally Posted by jmcilhinney View Post
    Are you asking how your database executes methods in your VB code? The answer is that it doesn't, no matter the architecture. Your data access layer executes stored procedures and the database returns the results. That's it.
    Thanks for reply.

    Yes i want call those results in my application. How can i do that ?

    I mean example. i write interface part. i want call all results which written in back end layer.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Call functions from stored procedured.

    I'm not sure what you're actually asking for. Are you saying that you don't know how to query the database from your application? If so then you should follow the DB FAQ link in my signature and avail yourself of some of the resources it links to.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2009
    Posts
    66

    Re: Call functions from stored procedured.

    Quote Originally Posted by jmcilhinney View Post
    I'm not sure what you're actually asking for. Are you saying that you don't know how to query the database from your application? If so then you should follow the DB FAQ link in my signature and avail yourself of some of the resources it links to.
    I mean, i want to call functions which writen in sql. I know they populate in stored procedured of sql.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Call functions from stored procedured.

    Are you saying that you want to call a database function from a database stored procedure, or that you want to call a database function direct from your VB code?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Lively Member
    Join Date
    May 2009
    Posts
    66

    Re: Call functions from stored procedured.

    Quote Originally Posted by jmcilhinney View Post
    Are you saying that you want to call a database function from a database stored procedure, or that you want to call a database function direct from your VB code?
    I want to call a database function from a database stored procedure

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Call functions from stored procedured.

    Quote Originally Posted by taybacuniversity View Post
    I want to call a database function from a database stored procedure
    Then why have you posted in the VB.NET forum? That's straight SQL and has nothing to do with VB.NET. SQL questions belong in the Database Development forum.

    You call user-defined functions in exactly the same way as you call inbuilt functions: you put the name and then a comma separated list of arguments within parentheses, e.g.
    SQL Code:
    1. SELECT * FROM MyTable WHERE MyColumn = MyFunction(param1, param2)
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9

    Thread Starter
    Lively Member
    Join Date
    May 2009
    Posts
    66

    Re: Call functions from stored procedured.

    Quote Originally Posted by jmcilhinney View Post
    Then why have you posted in the VB.NET forum? That's straight SQL and has nothing to do with VB.NET. SQL questions belong in the Database Development forum.

    You call user-defined functions in exactly the same way as you call inbuilt functions: you put the name and then a comma separated list of arguments within parentheses, e.g.
    SQL Code:
    1. SELECT * FROM MyTable WHERE MyColumn = MyFunction(param1, param2)
    You mean i have to go to this section ?

    http://www.vbforums.com/forumdisplay.php?f=3

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Call functions from stored procedured.

    I've already asked the moderators to move this thread so please don't post this same question again. In future though, yes your DB-specific questions belong in that forum. Just read the description of each forum and ask yourself which one describes your topic. If you want to write a stored procedure that calls a function then that has nothing to do with the application that will execute that stored procedure. You could write a hundred different applications in a hundred different languages to call that stored procedure and that wouldn't change how it calls a function.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  11. #11
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Call functions from stored procedured.

    Thread moved to Database Development forum

    (thanks for letting us know jmcilhinney )

Posting Permissions

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



Click Here to Expand Forum to Full Width