Written by

Question Wesley West · Aug 26, 2022

Changing the order of SQL Fields

Hello! I am currently creating a class for a small error trap. I have it working and all is good but I really want to change the order of the fields in the SQL return from Alphabetical to something else.  

The current Order is ID, ActionType, ErrorCount, ErrorDetails, Model, ResultCode, ResultMessage, Stock and Yard

I would really like for the field order to be ID, Yard, Stock, Model, etc.

Example of current order,  

Is this possible?

Thanks in advance!!

Product version: Caché 2017.1

Comments

Wesley West · Aug 26, 2022

I figured it out,  [ SqlColumnNumber = 7 ] will rearrange the order of fields..

0
Eduard Lebedyuk · Aug 27, 2022

Sounds like you're writing SELECT * queries. While fine for debugging or development, remember to always explicitly specify the list of columns in actual production queries.

0