641
Views
18
Comments
Solved
There is a mismatch between no. of columns selected and the output structure
Question

Hi,

i am stucked on a point,

i have to perform sql action when a button is clicked and that gets the cheapest room from database and show in a form field.

I have written the query, the problem comes with structures, i have used entities as well but there was same warning,

below is the attached screen shot of query used.

If any one there to help

thanks in advance


Untitled2.png
2022-05-05 07-05-40
Jimmy Vankerkhove
Champion
Solution

Hi Dilin,

the whole query isn't displayed in the screenshot. So either your query just returns no results because of the query or like Eduardo asks, are your input parameters set correctly? Meaning, did you enter values that should return some rows?

Cheers
Jimmy

2024-03-25 06-19-08
Harlin Setiadarma

You used: select {room}.* from {room} where....

Just remove the structure from Output, then drag Room entity to the output.

2022-05-05 07-05-40
Jimmy Vankerkhove
Champion

Do you really need all attributes from the room entity? If not, only select the ones you need.
Make sure you output structure matches your selection or like Harlin said, use the entity if you're always going to select everything.

UserImage.jpg
Osama Hassan

i have tried to add entities as structures but still my query doesn't show any rows in testing

UserImage.jpg
Osama Hassan

Hi harlin, thanks for the response,

but my query also involves the booking table to get the free room only which is not booked

2024-03-25 06-19-08
Harlin Setiadarma

Booking table does not matter, as it was not in selected columns.

UserImage.jpg
Osama Hassan

Harlin Setiadarma wrote:

Booking table does not matter, as it was not in selected columns.


i have added room entity directly as structures, but the query sends no rows back

2024-03-25 06-19-08
Harlin Setiadarma

have you removed the existing structure on your Output Entity/Structure?

it should only have Room entity on the Output Entity/Structure.

This is from Booking Assignment Materials right?

I've done this before, and it should works.

UserImage.jpg
Osama Hassan

Harlin Setiadarma wrote:

have you removed the existing structure on your Output Entity/Structure?

it should only have Room entity on the Output Entity/Structure.

This is from Booking Assignment Materials right?

I've done this before, and it should works.


yes this is from booking assignment material,

great..please help me out to sort this i am working on it from yesterday

thanks


UserImage.jpg
Osama Hassan

Usama Hassan wrote:

i have removed the previously added structure and added room , but when i test the query it gives no rows result



2022-05-05 07-05-40
Jimmy Vankerkhove
Champion

Did you test in the query screen via the test button? Are test inputs set correctly?

2017-08-26 10-06-58
dilin 1212

 wrote:

Did you test in the query screen via the test button? Are test inputs set correctly?

Hi Jimmy,

     I am working on the same section. I am attaching the screenshots. Could you check it whats the error on this. 


Thanks 

Dilin

UserImage.jpg
Osama Hassan

yes this is working fine now, now i have to get that cheapest price value and room no. and then have to show it in a form when the "get available room button" clicks


2026-06-05 12-38-17
Eduardo Jauch

Hi dilin,

Are you defining the test parameter values in the test input tab?

Cheers

Eduardo Jauch

2022-05-05 07-05-40
Jimmy Vankerkhove
Champion
Solution

Hi Dilin,

the whole query isn't displayed in the screenshot. So either your query just returns no results because of the query or like Eduardo asks, are your input parameters set correctly? Meaning, did you enter values that should return some rows?

Cheers
Jimmy

2017-08-26 10-06-58
dilin 1212

Thanks Jimmy & Eduardo,


 As Eduardo said it's error happened test parameter values in the test input tab.

Now works. But i am trying to display it in same screen after clicking the "Get Available Room" button. How can i do that.

Thanks

Dilin

2022-05-05 07-05-40
Jimmy Vankerkhove
Champion

Hi Dilin,

this can be done in several ways. Did you watch some Outsystems videos already or followed a learning path?
There are great videos available that will help you with questions like these.
https://www.outsystems.com/learn/
https://www.outsystems.com/learn/courses/15/developing-outsystems-web-applications/

2017-08-26 10-06-58
dilin 1212

Hi Jimmy,

              Thank you very much  . I am going through the courses. 


Thanks

Dilin 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.