How misc. columns in SQL

Philip Tulett philip.tulett at pdq-networks.com
Sun May 15 21:11:42 UTC 2022


Hi Das,In SQL, you can name the returned columns with the AS function.Select 1+2 as The_Result Will return a column called The_Result...Kind regards Philip 
-------- Original message --------From: Das Goravani <goravanis at gmail.com> Date: 15/05/2022  22:03  (GMT+00:00) To: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com> Subject: Re: How misc. columns in SQL > On May 12, 2022, at 1:39 PM, Paul Manning via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:> > You can specify he columns in your SQL Statement> > STA: SELECT Col1,Col2… FROM Table WHERE X> > then when you do the fetch> > SessionObj.$fetch(ReturnList.kFetchAll)> > If the list is not defined it will take the definition of the SELECT StatementGiven the above, I ask:To be clear, you’re saying I CAN put misc. column names into the SELECT statement, along with real table column names, and it will WORK ? I thought I remember it coughing and saying "Some column names are not found in the table" or some such message. I am asking because I have come across SQL in lessons on the web where sometimes a column will be made, generated, as a result of running the SQL command.. for example, strings are put together to form a meaningful phrase and it appears in a new column to the right of other data columns and it might be named "phrase" for example.. not found in the database. In the sample output they show on the web page the made up phrase has it’s own column as it applies to each row. Are you sure I can put in such column names not found in the table being named and it will let those pass to the stage where the SQL is executed and comes up with content for the column names I have put in?My experience is that it’s not so lenient. Maybe if you have SQL that works with that column it accepts it. _____________________________________________________________Manage your list subscriptions at https://lists.omnis-dev.comStart a new message -> mailto:omnisdev-en at lists.omnis-dev.com 


More information about the omnisdev-en mailing list