Alpha Video Training
Results 1 to 2 of 2

Thread: SQL works localhost and direct on database but not on debug interactive window

  1. #1
    Member jmsilva's Avatar
    Real Name
    Juan Silva
    Join Date
    May 2011
    Location
    Altamonte Springs, FL
    Posts
    237

    Default SQL works localhost and direct on database but not on debug interactive window

    The xBasic code below creates the following SQL select statement
    Code:
    SELECT website_id, google_analytics_account FROM website_config WHERE website_url = "pablosmasterjeweler" AND website_status = 1 AND sysdate() BETWEEN start_date AND end_date;
    and executes it on the current connection.

    The problem is that as shown on the attached captured snippet it never returns any records on the debug interactive window used for testing code. It works without a hitch if I test the xbasic code on the LOCALHOST or if I copy the resulting SQL select statement and execute it against my database.

    I have tested my SQL code many times before on the interactive window and it had always worked just fine, can any of you see what am I doing wrong here?

    Code:
        
        if  session.targetURL  =  " "
            session.targetURL  =  "pablosmasterjeweler"
        end if
         
     ' -----------------------------------------------------------------------------------------------------------    
     ' Access website_config table to retrieve website_id
     ' -----------------------------------------------------------------------------------------------------------    
         Select_exp     =              "SELECT website_id, google_analytics_account FROM website_config "
         Select_exp     = Select_exp + "WHERE website_url = \"" + session.targetURL + "\" AND website_status = 1 "
         Select_exp     = Select_exp + "AND sysdate() BETWEEN start_date AND end_date;"
     
         if .not. e.conn.execute(Select_exp)
             bpage = "Error: " + e.conn.CallResult.text
             e.conn.close()
             end
         end if
         
         dim session.website_id as N = 2
         dim session.ganalytact as C = ""
         
         rs = e.conn.ResultSet
         if rs.NextRow()
             session.website_id = rs.data("website_id")
             session.ganalytact = rs.data("google_analytics_account")
         end if
    Capture.JPG
    Juan Silva
    My Small Bizz, LLC

  2. #2
    Member jmsilva's Avatar
    Real Name
    Juan Silva
    Join Date
    May 2011
    Location
    Altamonte Springs, FL
    Posts
    237

    Default Re: SQL works localhost and direct on database but not on debug interactive window

    The question here is not about SQL or xBasic but why would an xBasic code with embedded SQL work on the localhost and not the interactive debugger window, it is true I am using session variables, but these have been assigned values for when executing in the interactive debugger window.
    Juan Silva
    My Small Bizz, LLC

Similar Threads

  1. Using localhost and external server - how do I direct Publish?
    By webcommerce in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 02-05-2013, 04:44 PM
  2. Script works in interactive window but not in app
    By Sooty57 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 11
    Last Post: 02-03-2010, 06:44 PM
  3. Works in interactive but not in AfterUpdateRecords
    By scotthanes in forum Application Server Version 9 - Web/Browser Applications
    Replies: 4
    Last Post: 04-07-2009, 12:08 AM
  4. Debug, Trace, Interactive Window
    By Steven Spencer in forum Alpha Five Version 5
    Replies: 1
    Last Post: 12-26-2002, 11:23 PM
  5. My program only works when i use the DEBUG(1)!
    By Ilesh Mistry in forum Alpha Five Version 4
    Replies: 3
    Last Post: 12-04-2001, 02:11 AM

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
  •