Alpha Video Training
Results 1 to 6 of 6

Thread: <<%sql% yes, <<%code% no

  1. #1
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,644

    Default <<%sql% yes, <<%code% no

    Can someone tell me why this works:

    Code:
    SQL_Select1 = <<%sql%SELECT Pay_Rate 
    FROM emp_pay 
    WHERE Pay_Emp_Id = 12 AND ( Pay_Category = 'Starting Pay' OR Pay_Category = 'Raise' ) 
    ORDER BY Pay_Date DESC 
    LIMIT 1
    %sql%
    But this does not:

    Code:
    SQL_Select1 = <<%code%SELECT Pay_Rate 
    FROM emp_pay 
    WHERE Pay_Emp_Id = 12 AND ( Pay_Category = 'Starting Pay' OR Pay_Category = 'Raise' ) 
    ORDER BY Pay_Date DESC 
    LIMIT 1
    %code%
    The statements are identical.

  2. #2
    "Certified" Alphaholic glenschild's Avatar
    Real Name
    Glen Schild
    Join Date
    Apr 2000
    Location
    Frome, Somerset, UK
    Posts
    1,520

    Default Re: <<%sql% yes, <<%code% no

    Not sure but is code a reserved word?
    Glen Schild



    My Blog


  3. #3
    Member
    Real Name
    Garry M Flanigan
    Join Date
    Jul 2004
    Location
    Melbourne, Australia
    Posts
    909

    Default Re: <<%sql% yes, <<%code% no

    The pop-up help describes %code% option as:

    Xbasic code string
    Which I guess your string is not. For SQL statements seems best to use %sql% or %str%
    The debugger does not like your first example but is happy with:

    SQL_Select1 = <<%str%
    SELECT Pay_Rate
    FROM emp_pay
    WHERE Pay_Emp_Id = 12 AND ( Pay_Category = 'Starting Pay' OR Pay_Category = 'Raise' )
    ORDER BY Pay_Date DESC
    LIMIT 1
    %str%

  4. #4
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: <<%sql% yes, <<%code% no

    I am sorry to report
    it does work in a dialog
    in version 11
    (not the exact statement that you have, but a select statement construct using <<%code% .... %code% block)


    EDIT:
    from alpha wiki

    %code% is a tag that indicates the start of the string and the end of the string. The actual text used for the marker is irrelevant. The only requirement is that the marker at the beginning of the string must match the marker at the end of the string. In the above example, the text "code" is used as the marker.

    NOTE : While you are free to use any string that you want in the %marker% delimiter, we recommend that you use %dlg% as the delimiter for the "Dialog Format" string, and %code% as the delimiter for the "Code" string in a UI_DLG_BOX()command. If you use these specially named delimiters, Alpha Five will give you bubble-help in the Code Editor while you are editing these strings.
    it will only give you code completion and bubble help, but it does work.
    Last edited by GGandhi; 10-06-2014 at 08:12 AM.
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  5. #5
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,695

    Default Re: <<%sql% yes, <<%code% no

    You must have a crlf after the opening delimiter (<<%sql% or <<%code%). Your first line of text would begin on the next line. The closing delimiter does not need to be on a new line.

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

  6. #6
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,644

    Default Re: <<%sql% yes, <<%code% no

    I'll check it Lenny, thanks.

Similar Threads

  1. Executing SQL Code
    By sprivitera in forum Application Server Version 11 - Web/Browser Applications
    Replies: 3
    Last Post: 04-16-2013, 08:52 PM
  2. Linked table returns SQL Error executing SQL SELECT statement opening link table code
    By RichKat in forum Alpha Five Version 9 - Desktop Applications
    Replies: 2
    Last Post: 12-29-2012, 09:56 AM
  3. Use my SQL code instead of Alpha's
    By jmsilva in forum Application Server Version 11 - Web/Browser Applications
    Replies: 13
    Last Post: 06-14-2012, 09:01 AM
  4. Connecting to SQL table in code
    By wake in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 10-05-2008, 12:49 AM
  5. Connecting to SQL database in code
    By wake in forum Application Server Version 9 - Web/Browser Applications
    Replies: 1
    Last Post: 10-03-2008, 10:31 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
  •