You can translate the question and the replies:

Order of records getting changed

Hi Team, I have teradata storedprocedures which has update statment when i execute the restAPI by updating a record then the order of rows are getting changed example: before updation: ROW1 ROW2 ROW3 ROW4 After updation: ROW3 ROW1 ROW4 ROW2 etc like all the rows are getting interchange is there anyway to fix this Query2: I have a flattened view which accepts multiple values as an array in that i have an ID column which has below condition in my query cast(a11.opr_id as varchar(10)) in (@id) or 'ALL' in (@idx) i'm not able to get records with 'ALL' only able to get data if pass mutiple values for ID column, Need help how to add above condition
user
24-02-2021 09:59:57 -0500

1 Answer

Hi, The Virtual Data Port retrieves data in realtime from the underlying source and displays the result as it is in the source. Hence, if the data returned from the source is not ordered, I would use Order by clause to get the data in an orderly manner. In order to achieve “cast(a11.opr_id as varchar(10)) in (@id) or ‘ALL’ in (@idx)” in Virtual DataPort, I would use CASE statement as below, `CASE WHEN <condition> THEN id ELSE idx END` To know more about the order by clause and CASE statement, refer to [ORDER BY Clause](https://community.denodo.com/docs/html/browse/latest/en/vdp/vql/queries_select_statement/order_by_clause/order_by_clause#order-by-clause) and [CASE Clause](https://community.denodo.com/docs/html/browse/latest/en/vdp/vql/queries_select_statement/case_clause/case_clause#case-clause) sections of Virtual DataPort VQL Guide respectively. Hope this helps!
Denodo Team
25-02-2021 05:01:54 -0500
You must sign in to add an answer. If you do not have an account, you can register here