Results 1 to 2 of 2

Thread: [Answers] SQLlookup

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] SQLlookup

    Q:
    Why is a wrong field shown in column "groep".
    choices: SELECT omschrijving FROM groep WHERE bedrijf = 234 AND periode = 2015
    Get data mapping : sqllookup("groep","where bedrijf = 234 AND periode = 2015 AND groep = '{}'", "","omschrijving","0")
    Swt data mapping : sqllookup("groep","where bedrijf = 234 AND periode = 2015 AND omschrijving = '{}'", "","groep","0")
    A:
    What are the datatypes of groep and omschrijving?
    If they are character, the final parameter (notfound) in SQLLOOKUP() should be in quotes within quotes "'0'"



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2017-01-23 at 03:07.

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    I am currently working on a web app where I need to perform some server side data retrieval.

    While referencing SQLLOOKUP, when the virtual table is used, the return value is the customer id.

    Is it possible to have multiple returned values?
    For example, can the return value be customerid and employeeid.

    If it is not possible, other than calling SQLLOOKUP() several times, what would be the best way to use the same functionality with virtual tables?
    I am trying to make a call to a virtual table that returns two columns from a table.
    I would then taken the values, place them in a JSON string format and return the encoded object to the client.

    I am currently using two sqllookup calls and I'm trying to make it easier with one single call.

    Code:
    
    m_defbranch = sqllookup("vtsecure","where loginname = '" + m_username + "'", "","defbranch","'Not found'")
    
    m_colcode = sqllookup("vtsecure","where loginname = '" + m_username + "'", "","collcode","'Not found'")
    I am storing each of the values in the caption of a label in a canvas section for other uses (which will not be visible to the user).
    A:
    The easiest nocode way I can think of: put a canvas section on the page that is invisible.
    Put
    two textboxes on the section set to the two fields you want to use.
    Set the
    datasource to be a VT which will give you the values you want.

    When you need to requery() (here's another place where having all the details would make a difference),
    set the WHERE attribute of the section..
    I'm not sure if it will
    requery itself, or where you will then have to requery the section. One way or the other, your two values will be available for you to use as you need.



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/showthread.php?2717-Answers

Bookmarks

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
  •  
Journey into the Cloud
Join us