SQL Queries

  

Hi Guys,

 I have one doubt about the output structure on SQL Queries,

As per documentation, the outputs structure should  be same as result from SQL(pls correct me if I'm wrong) mean in output structure the datatype should be same ()but not ORDER) 

Id query returns 

eg: SQL output : id, (First Name)text, phoneNumber, (Last Name)text

then

Output structure should be: id, PhoneNomer, text, text (Datatype should be same but not order)

 then how outsystem knows text field(Fist Name) is related to which one (4 OR 5)?

Hi Ritesh,

The Order should also be same otherwise It would try to map in wrong field

Regards

Devendra


Solution

Hi Ritesh,

The order in which you select your values should be the same as the output structure.

For your example, your select statement should be:

1. Id; 2. PhoneNumber; 3. FirstName(text); 4. LastName(text)

to match the output structure, while maintaining the same datatype.


Best regards,

Davide Résio

Solution

Hi Ritesh,

The correct answer has already been given (twice), but I got curious as to what documentation you refer to, that says the order is not important?