Hi, allI can't solve and would like to know about how to use SQL widget.
Originally, the reference data for the table was one master, but I changed the new table to reference only what is displayed in column A.Create a new OutputSearch Structure and add the [new table code]attribute and [name]attribute.(I want to display the code name + name in column A.)Set the SQL widget to retrieve from a new table.Set [OutputSearchList Structure] to Output Entities/Structure in SQL widget.
When I run Test output, the following error is displayed.Error in advanced query ***: Column count doesn't output structure attribute count.
When I set "TableHeader Structure" to Output Entities/Structure and perform Test output, 「Code name + name」 is displayed, but it is not displayed on the actual screen.Please tell me how to put it together.
Regards,
Zamiemon
Hi @Zamiemon U,
Please share sample OML to understand the problem statement in a better way.
Thanks,Vignesh Prakash.
Please share your OML File
Hello Zamiemon,
For SQL the output structure needs to match the number of outputs from the SQL query, let’s say that your query returns 6 columns, then your structure need to have 6 attributes. In your case Cd + name are columns in the SQL but there is only one attribute in the structure (where you merge them, correct me if I’m wrong)
Also, you can always try to share the OML.
Hello @Zamiemon U
In your case, the selected fields in your query are not mapping with the structure, specifically they less than 7 fields of OutputSearchList Structure (B, C, D, Update ID, Table No, Cd, Name) and maybe >= 3 fields of TableHeader Structure(in case the selected fields in your query >= number fields in structure, Outsystems will try to mapping in order and throw error if have any not mapping data type)
Ex: the OutputSearch with 2 attributes and the selected fields in my query just only one, I got the same error with you.
Hope this help!
Thanks!
Hi Zamiemon,
If your output structure contains more attribute than your select statement, the sql will return an error but if your output structure contain less attribute then select statement it will run successfully and bind that attribute with no. of output structure so in your case why dont you create your output structure same as your table header or if you want to have same output structure then fetch the same number of attribute and do the other calculate on screen (cd+Name)
Thanks