Selection Using FROM TABLE

Asked

Viewed 33 times

0

I have a table and a function that returns a pipeline, only the function needs to receive a data from the first table, I imagined that the selection would be something like this:

Select FERRAMENTA.IDFERRAMENTAS
 FROM SIG_SERVICOSFERRAMENTAS FERRAMENTA
INNER JOIN TABLE(SELECT TEXTO1,DATA1,DATA2 FROM TABLE(LIDER.PKG_EQP.FN_FERRAMENTA_ETQ(FERRAMENTA.IDFERRAMENTAS))) VALIDADE
 ON 1 = 1 

and I’m getting the following error:

TOOL.IDTOOLS idenficator invalid

I’ve made similar queries, I know the mistake must be something small in the selection, but I’m unable to find it.

  • TOOL and IDTOOL are two fields of SIG_SERVICOSFERRAMENTAS ? If yes, exchange '.' for ','

1 answer

1


The scope of your second subselect (SELECT TEXTO1,DATA1,DATA2...) can’t "see" the field FERRAMENTA.IDFERRAMENTAS.

Try to remove it and see if you get the expected result, as follows:

SELECT FERRAMENTA.IDFERRAMENTAS
FROM SIG_SERVICOSFERRAMENTAS FERRAMENTA
INNER JOIN TABLE(LIDER.PKG_EQP.FN_FERRAMENTA_ETQ(FERRAMENTA.IDFERRAMENTAS)) VALIDADE
ON 1 = 1 
  • Resolve, I just wanted to optimize the selection and not traqzer the other Mps that I will not use, I thought making another selection was possible Thanks.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.