SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[11.1.125 Pro] - VALUES formatting issues (MariaDB)

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[11.1.125 Pro] - VALUES formatting issues (MariaDB)
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post [11.1.125 Pro] - VALUES formatting issues (MariaDB) Reply with quote
I've got the following formatting rules:

#1
Code:

VALUES (..., ...)
      ,(..., ...);


#2
Code:

(..., ... AND ... OR ...)


Rule #1 transforms this:
Code:

VALUES (
    1
    ,`lv_totd_tid`
    ,`lv_foc_sfs_normal`
    ,`lv_transport_number_1`
    ,'ACTIVE'
    ,`lv_current_test_case`
)
,(
    2
   ,`lv_totd_tid`
   ,`lv_foc_sfs_normal`
   ,`lv_transport_number_2`
   ,'ACTIVE'
   ,`lv_current_test_case`
)
,(
    3
   ,`lv_totd_tid`
   ,`lv_foc_sfs_normal`
   ,`lv_transport_number_2`
   ,'ACTIVE'
   ,`lv_current_test_case`
)
,(
    4
   ,`lv_totd_tid`
   ,`lv_foc_sfs_normal`
   ,`lv_transport_number_2`
   ,'ACTIVE'
   ,`lv_current_test_case`
);


into this
Code:

VALUES (1, `lv_totd_tid`, `lv_foc_sfs_normal`, `lv_transport_number_1`, 'ACTIVE', `lv_current_test_case`)
      ,(2
      ,`lv_totd_tid`
      ,`lv_foc_sfs_normal`
      ,`lv_transport_number_2`
      ,'ACTIVE'
      ,`lv_current_test_case`)
      ,(3
      ,`lv_totd_tid`
      ,`lv_foc_sfs_normal`
      ,`lv_transport_number_2`
      ,'ACTIVE'
      ,`lv_current_test_case`)
      ,(4
      ,`lv_totd_tid`
      ,`lv_foc_sfs_normal`
      ,`lv_transport_number_2`
      ,'ACTIVE'
      ,`lv_current_test_case`);



instead of this
Code:

VALUES (1, `lv_totd_tid`, `lv_foc_sfs_normal`, `lv_transport_number_1`, 'ACTIVE', `lv_current_test_case`)
      ,(2, `lv_totd_tid`, `lv_foc_sfs_normal`, `lv_transport_number_2`, 'ACTIVE', `lv_current_test_case`)
      ,(3, `lv_totd_tid`, `lv_foc_sfs_normal`, `lv_transport_number_2`, 'ACTIVE', `lv_current_test_case`)
      ,(4, `lv_totd_tid`, `lv_foc_sfs_normal`, `lv_transport_number_2`, 'ACTIVE', `lv_current_test_case`);


I have to select the rows with id 2-4 and apply rule #2 to them so that I can get the desired result.

Any hints on why that happens?
Mon Apr 27, 2020 8:20 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
In the formatting rules, at the formatting style level there is a separate option for handling CSV items. From the result it appears that you are currently using the "Stacking (leading)" option. I think for this case you want a different style using the "Wrapped" option.
Tue Apr 28, 2020 1:34 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
Are you referring to this one mentioning the commas, marked in green? Yes, that was is to Stacked (leading).



I always believed the second line of rule #1 would define how it should format subsequent values sets after the first one.

I guessed that only modified the rules in the current ruleset, I'd never have thought it would affect the contents of the editor this way. Changing that from the Options dialog would be a very bad idea as it would instantly ruin my customized rules (and not only the note in red says so). Regardless, I tried, just to be sure, and it still works the same. It properly formats the first set of data with the id of 1 (one line), and "expands" all the rest into multiple lines.
Tue Apr 28, 2020 7:42 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.