open var1 for select id from testtable where testid = testid1请问这句起什么作用呢 ?var1 和 testid1 是变量
谢谢各位

解决方案 »

  1.   

    OPEN 可不可以对一个变量直接操作的,ORACLE 中?
      

  2.   

    不是游标,那是什么类型?Native dynamic SQL is easier to use and much faster than package DBMS_SQL. In the following example, you declare a cursor variable, then associate it with a dynamic SELECT statement that returns rows from database table emp: DECLARE
       TYPE EmpCurTyp IS REF CURSOR;
       emp_cv   EmpCurTyp;
       my_ename VARCHAR2(15);
       my_sal   NUMBER := 1000;
    BEGIN
       OPEN emp_cv FOR
          'SELECT ename, sal FROM emp 
              WHERE sal > :s' USING my_sal;
       ...
    END;