There is a mismatch between no. of columns selected and the output structure

There is a mismatch between no. of columns selected and the output structure

  

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

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

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

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.

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

Hi harlin, thanks for the response,

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

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

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

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.

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


Usama Hassan wrote:

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



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

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


 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

Hi dilin,

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

Cheers

Eduardo Jauch

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

Solution

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

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/

Hi Jimmy,

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


Thanks

Dilin