0
votes

I am using Teiid vdb model where i need to extract query constraints inside the ddl and use it in a stored procedure to fetch results of my choice. For example, if I run following query : select * from Student where student_name = 'st123', i want to pass st123 to my procedure and return the results based on some processing. How can i extract this constraint inside the ddl instead of teiid doing the filtering for me and returning the matching row. Is there a way around developing the connector and handling this in vdb instead?

1

1 Answers

0
votes

See http://teiid.github.io/teiid-documents/master/content/reference/r_procedural-relational-command.html

If you have the procedure:

create virtual procedure student (in student_name string) returns table (<some cols>) as
begin
  if (student_name like '...')
  ...
end

then you can all it as if it were a table:

select * from student where student_name = 'st123'