SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Dec 2009
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    send a column value to a function

    Is it possible to send column alias to a function ?

    I have a select which is basically have a structure like below ..


    select mytable.myfield as
    ,
    func_info(field1),
    ....................
    .....................


    I get error unknow column at runtime .. .

    my question is is this structure wrong ? Whats the correct way to send a column value to a function ?

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    San Sebastian, Spain
    Posts
    93
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    To pass the value into the function issue:

    SELECT func_info(mytable.myfield) as result1

    The result of the func_info with the field passed in will be named result1.

  3. #3
    SitePoint Addict
    Join Date
    Dec 2009
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rcashell View Post
    To pass the value into the function issue:

    SELECT func_info(mytable.myfield) as result1

    The result of the func_info with the field passed in will be named result1.
    Thanks. This worked.


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
  •