0

从外部查询访问数据时遇到问题

        SELECT y.task_id,y.R,y.location_id,

         (SELECT COLUMN_VALUE FROM (

          SELECT ROWNUM R, B.* FROM TABLE(  

          SELECT VALUE FROM

          DATASET WHERE R=1) B) WHERE R =1) AS latitude,

         (SELECT COLUMN_VALUE FROM (

          SELECT ROWNUM R, A.* FROM TABLE(

          SELECT VALUE FROM

          DATASET WHERE R =y.R) A) WHERE R =2) AS longitude

     FROM DATASET y

执行此操作时出现错误,例如

ORA-06553: PLS-306: wrong number or types of arguments in call to 'OGC_Y'

但如果我删除WHERE R =y.R,那么它会给出一些输出。我无法弄清楚这个问题

4

1 回答 1

0

使用 With 子句?

纬度为(SELECT COLUMN_VALUE FROM(

      SELECT ROWNUM R, B.* FROM TABLE(  

      SELECT VALUE FROM

      DATASET WHERE R=1) B) WHERE R =1), 
 longitude as (SELECT COLUMN_VALUE FROM (

      SELECT ROWNUM R, A.* FROM TABLE(

      SELECT VALUE FROM

      DATASET WHERE R =y.R) A) WHERE R =2

) SELECT y.task_id, yR, y.location_id, lat.column_value, lon.column_value FROM dataset y, latitude lat, longitude lon

于 2013-12-06T11:20:37.023 回答