解决方案 »

  1.   

    用程序必须要用select  into不能简单的select :
    如:
    declare
    a varchar2(100);
    b number;
    BEGIN
     select Date_ID,pmHoPrepSuccLteIntraF*pmHoPrepSuccLteInterF into a,b from SGHO;
    dbms_output.put_line(a||b);
     END ; 
      

  2.   

    能不能帮忙解释一下语句的含义,多谢declare
     a varchar2(100);
     b number;
     BEGIN
      select Date_ID,pmHoPrepSuccLteIntraF*pmHoPrepSuccLteInterF into a,b from SGHO;
     dbms_output.put_line(a||b);
      END ;  
      

  3.   

    能不能帮忙具体解释一下语句的用途,多谢
    declare
     a varchar2(100);
     b number;
     BEGIN
      select Date_ID,pmHoPrepSuccLteIntraF*pmHoPrepSuccLteInterF into a,b from SGHO;
     dbms_output.put_line(a||b);
      END ;  
      

  4.   

    百度 pl/sql语法
    从基础语法开始学起吧
      

  5.   

    将查询出来的值赋给变量,然后用 dbms_output.put_line(a||b);将变量的值打印出来。
    注意这里查询出来的值只能为单条记录。
    我建议你还是先自己看看书,因为这个是最简单的。
      

  6.   

    因为在pl/sql语句块中,必须把查询到的数据都存放在一个地方,以待后续使用。要么存储到相应的变量要么使用游标等等。
      

  7.   

    你在 beginend 中 只执行select  是没有返回结果的
      

  8.   

    返回结果用游标来接收
    SQL SERVER这点比较方便,直接可以返回结果集合
      

  9.   

    露珠想学习plsql可以找一本基础的课本进行学习。
    随便写一段代码吧:
    declare
    i1 varchar2(16);
    i2 varchar2(16);
    begin
    for  c1 in(select area_id from dim_area_no) loop
    select   tel  into  i1 from  tbl_tel1
    where area=c1.area_id;
    select   tel  into  i2 from  tbl_tel2
    where area=c1.area_id;
    if  i1<>i2  then 
    dbms_output.put_line(i1);
    end if ;
    end loop;
    end;
      

  10.   

    declare     
    变量定义;
    begin    
    这里写上你的sql语句
    end;
      

  11.   

    使用begin  end 运行select 时,不能单单地使用select,必须使用select  into 。声明一个变量,将查询到的结果 into 赋给一个变量。
      

  12.   

    如11楼所言
    declare     
    变量定义;
    begin    
    sql语句
    end;
    需要注意的是begin  end 运行select 时,使用select  into 。否则你执行一个select毫无意义啊