SELECT * FROM USER_TAB_COLUMNS WHERE COLUMN_NAME<>'一个字段的名字' AND TABLE_NAME='A'一条语句没有办法实现。
解决方案 »
- 两个服务器oracle中表格的insert into table select * from anothertable;
- oracle update的时候怎么排序
- shutdown abort后出现Ora-00439:feature not enabled:Real Application Clusters错误,怎么解决,
- Oracle的系统表保存在哪个地方?
- 如何在新装的oracle10g中恢复以前的完全备份
- 看一下,这条语句中啥意思
- 索引性能查看
- 帮忙写一条SQL,急切!!!
- 难题:以下三个表如何关联(我的头大了),使用sql
- 请问如下语句错在那里了select * from persons where rownum>10 and rownum<100
- oo4o比ado的方式如何?
- 帮兄弟一把
呵呵
DAT Y1 Y2 ………………………………………………
-------- ---------- ---------- ---------- -------
04-01-04 2 4 ………………………………………………
04-01-05 3 5 ………………………………………………
04-01-06 1 8 ………………………………………………
t2表中
DAT X1 X2 ………………………………………………
-------- ---------- ---------- ----------
04-01-07 2 4 …………………………………………
04-01-08 0 1 ………………………………………………
04-01-06 11 12 ………………………………………………select之后的表t3为:
DAT Y1 Y2 X1 X2
-------- ---------- ---------- ----------- -----------
04-01-04 2 4
04-01-05 3 5
04-01-06 1 8 11 12
04-01-07 2 4
04-01-08 0 1不知道能看懂不?
这能查出来未知道字段的名字,但是能以这个结果去A表查这些字段对应的记录吗?
好像不行,我试了一下.还望达人解释一下.分不够,再加.
as
type mycursor is ref cursor;
end;
/
create procedure pro(p_rc out test_age.mycursor)
as
cursor t_sor is
SELECT column_name FROM USER_TAB_COLUMNS WHERE COLUMN_NAME<>'一个字段的名字' AND TABLE_NAME='A';
str varchar2(100);
begin
str:='select ';
for v_sor in t_sor loop
str:=str||v_sor.column_name||' ';
end loop;
str:=str||'from a';
open p_rc for str;
end;
/
1.str 的大小可以再定义大一点
2. str:=str|| v_sor.column_name|| ' '
------------------------------
应该是
str:=str|| v_sor.column_name|| ',' 循环完毕后:
str: =substr(str,1,length(str)-1)