SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SA 9.0.166 Pro] - Snippets + caret misplacements

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SA 9.0.166 Pro] - Snippets + caret misplacements
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2137

Post [SA 9.0.166 Pro] - Snippets + caret misplacements Reply with quote
The pipe (|) in a snippet should mark the position the caret should end up when the text is inserted into the editor. I get random misplacements based on where the | is in the snippet. Examples follow:

#1 Snippet:
Code:

-- change tracking initial load
DECLARE @datum_tol             SMALLDATETIME = ? --GETDATE()
--       ,@last_sync_version     BIGINT = 0
--       ,@min_valid_version     BIGINT = CHANGE_TRACKING_MIN_VALID_VERSION(OBJECT_ID('$OBJECT(TABLE)$'))
--       ,@current_version       BIGINT = ? -- CHANGE_TRACKING_CURRENT_VERSION() 
;

SELECT
    d.$COLUMNS(vertical)$
FROM
    $OBJECT(TABLE)$|        AS d
WHERE   1 = 1
    AND (@datum_tol <= d.datum_tol OR d.datum_ig IS NULL OR (d.datum_tol <= @datum_tol AND @datum_tol <= d.datum_ig))
;


#1 Result: the caret is where it should be (see |)
Code:

-- change tracking initial load
DECLARE @datum_tol smalldatetime = ? --GETDATE()
                                     --       ,@last_sync_version     BIGINT = 0
                                     --       ,@min_valid_version     BIGINT = CHANGE_TRACKING_MIN_VALID_VERSION(OBJECT_ID('dbo.adatgyujtok'))
                                     --       ,@current_version       BIGINT = ? -- CHANGE_TRACKING_CURRENT_VERSION() 
;

SELECT
    d.id_adatgyujto
   ,d.fszg_id
   ,d.gkt_datum_tol
   ,d.datum_tol
   ,d.datum_ig
   ,d.id_adatgyujto_tipus
   ,d.adatgyujto_ertek
FROM
    dbo.adatgyujtok| AS d
WHERE   1 = 1
    AND (@datum_tol <= d.datum_tol OR d.datum_ig IS NULL OR (d.datum_tol <= @datum_tol AND @datum_tol <= d.datum_ig))
;


#2 Snippet:
Code:

-- change tracking initial load
DECLARE @datum_tol             SMALLDATETIME = ?| --GETDATE()
--       ,@last_sync_version     BIGINT = 0
--       ,@min_valid_version     BIGINT = CHANGE_TRACKING_MIN_VALID_VERSION(OBJECT_ID('$OBJECT(TABLE)$'))
--       ,@current_version       BIGINT = ? -- CHANGE_TRACKING_CURRENT_VERSION() 
;

SELECT
    d.$COLUMNS(vertical)$
FROM
    $OBJECT(TABLE)$        AS d
WHERE   1 = 1
    AND (@datum_tol <= d.datum_tol OR d.datum_ig IS NULL OR (d.datum_tol <= @datum_tol AND @datum_tol <= d.datum_ig))
;


#2 Result: the caret is put at the end of the line, after the comment
Code:

-- change tracking initial load
DECLARE @datum_tol smalldatetime = ? --GETDATE()|
                                     --       ,@last_sync_version     BIGINT = 0
                                     --       ,@min_valid_version     BIGINT = CHANGE_TRACKING_MIN_VALID_VERSION(OBJECT_ID('dbo.adatgyujtok'))
                                     --       ,@current_version       BIGINT = ? -- CHANGE_TRACKING_CURRENT_VERSION() 
;

SELECT
    d.id_adatgyujto
   ,d.fszg_id
   ,d.gkt_datum_tol
   ,d.datum_tol
   ,d.datum_ig
   ,d.id_adatgyujto_tipus
   ,d.adatgyujto_ertek
FROM
    dbo.adatgyujtok AS d
WHERE   1 = 1
    AND (@datum_tol <= d.datum_tol OR d.datum_ig IS NULL OR (d.datum_tol <= @datum_tol AND @datum_tol <= d.datum_ig))
;


#3 Snippet:
Code:

-- change tracking initial load
DECLARE @datum_tol             SMALLDATETIME = ? --GETDATE()
--       ,@last_sync_version     BIGINT = 0
--       ,@min_valid_version     BIGINT = CHANGE_TRACKING_MIN_VALID_VERSION(OBJECT_ID('$OBJECT(TABLE)$'))
--       ,@current_version       BIGINT = ? -- CHANGE_TRACKING_CURRENT_VERSION() 
;

SELECT
    d.$COLUMNS(vertical)$
FROM
    $OBJECT(TABLE)$        AS |d
WHERE   1 = 1
    AND (@datum_tol <= d.datum_tol OR d.datum_ig IS NULL OR (d.datum_tol <= @datum_tol AND @datum_tol <= d.datum_ig))
;


#3 Result: the caret got lost somewhere between R and E in WHERE
Code:

-- change tracking initial load
DECLARE @datum_tol smalldatetime = ? --GETDATE()
                                     --       ,@last_sync_version     BIGINT = 0
                                     --       ,@min_valid_version     BIGINT = CHANGE_TRACKING_MIN_VALID_VERSION(OBJECT_ID('dbo.adatgyujtok'))
                                     --       ,@current_version       BIGINT = ? -- CHANGE_TRACKING_CURRENT_VERSION() 
;

SELECT
    d.id_adatgyujto
   ,d.fszg_id
   ,d.gkt_datum_tol
   ,d.datum_tol
   ,d.datum_ig
   ,d.id_adatgyujto_tipus
   ,d.adatgyujto_ertek
FROM
    dbo.adatgyujtok AS d
WHER|E   1 = 1
    AND (@datum_tol <= d.datum_tol OR d.datum_ig IS NULL OR (d.datum_tol <= @datum_tol AND @datum_tol <= d.datum_ig))
;

Sat Oct 22, 2016 3:47 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.