select x || ' ' y 
into  a,b 
from tab
上面是过程的片断一般常见是
select x , y 
into  a,b 
from tab这两种语法有什么不同吗

解决方案 »

  1.   

    select x || ' ' y 
    into  a,b 
    from tab
    这个能执行通?会报错
      

  2.   


    第一种是明显错误的,
    x || ' ' y 只是一个值, y将被认为是别名,所以,into列表中的变量多于select值是错误的
      

  3.   


    select x , y 
    into  a,b 
    from tab
      

  4.   

    select x , y 
    into  a,b 
    from tab
      

  5.   

    SQL code
    select x || ' ' y 
    into  a,b 
    from tab不匹配,select 中只有一个值,y是x||''的别名
      

  6.   


    declare 
    a int;
    b varchar2;
    begin
    select tbbookdata.itemid||''tbbookdata.url into a,b  from tbbookdata;
    end;报错,绝对的!
      

  7.   


    select x || ' ' y   --这里是一个字段x || ' ' , y作为别名 插入会报错的
    into  a,b 
    from tab
    select x , y 
    into  a,b 
    from tab  --这个就可以
      

  8.   

    同意楼上的说法,select中的字段是一个,而不是二个,所以是不行的,|| 在oracle中是连接符!
      

  9.   

    select x || ' ' y 与select x , y 区别是,X字段的值加上空的字符赋予y,第二个是x的值就是x字段,y的值就是y字段