The act of transforming procedural code into SQL has been of interest to me lately. I know that not absolutely everything is expressable in a turing complete procedural language.
What if you have a special purpose procedural language though? For instance converting something like this:
foreach(var row in Table){
if(row.FirstName=="Foo"){
yield new {row.TableRID};
}
}
into this:
select TableRID from Table where FirstName='Foo'
Is there a name for something like this?
Also, in my psuedo code assume that row
is immutable and it is impossible to do something like Table[0].FirstName...
and other things which obviously have no (easy) translation into ANSI SQL.
Can anyone give me a name for this or any resources about this?