varchar2(2000) 为什么内容长度只有1056多,剩余的就显示不了呢,实际内容2100使用语句:DECLARE
SQLSTR VARCHAR2(4000);
V_DAYS VARCHAR2(2);
BEGIN
FOR I IN 1 .. 31 LOOP
IF I < 10 THEN
V_DAYS := '0' || I;
ELSE
V_DAYS := I;
END IF;
-- V_COUNT := V_COUNT + 1;
IF I < 16 THEN
SQLSTR := SQLSTR || ',max(case SUBJECT when ''D07' || V_DAYS ||
''' then COUNTI else 0 end) as ''D07' || V_DAYS || '''' ||
CHR(10);
END IF;
END LOOP;
DBMS_OUTPUT.PUT_LINE(SQLSTR);
DBMS_OUTPUT.PUT_LINE(LENGTHB(SQLSTR));
END;显示文本:“,max(case SUBJECT when 'D0716' then COUNTI else 0 end) as 'D0716'
,max(case SUBJECT when 'D0717' then COUNTI else 0 end) as 'D0717'
,max(case SUBJECT when 'D0718' then COUNTI else 0 end) as 'D0718'
,max(case SUBJECT when 'D0719' then COUNTI else 0 end) as 'D0719'
,max(case SUBJECT when 'D0720' then COUNTI else 0 end) as 'D0720'
,max(case SUBJECT when 'D0721' then COUNTI else 0 end) as 'D0721'
,max(case SUBJECT when 'D0722' then COUNTI else 0 end) as 'D0722'
,max(case SUBJECT when 'D0723' then COUNTI else 0 end) as 'D0723'
,max(case SUBJECT when 'D0724' then COUNTI else 0 end) as 'D0724'
,max(case SUBJECT when 'D0725' then COUNTI else 0 end) as 'D0725'
,max(case SUBJECT when 'D0726' then COUNTI else 0 end) as 'D0726'
,max(case SUBJECT when 'D0727' then COUNTI else 0 end) as 'D0727'
,max(case SUBJECT when 'D0728' then COUNTI else 0 end) as 'D0728'
,max(case SUBJECT when 'D0729' then COUNTI else 0 end) as 'D0729'
,max(case SUBJECT when 'D0730' then COUNTI else 0 end) as 'D0730'
,max(case ”
显示长度:1056
SQLSTR VARCHAR2(4000);
V_DAYS VARCHAR2(2);
BEGIN
FOR I IN 1 .. 31 LOOP
IF I < 10 THEN
V_DAYS := '0' || I;
ELSE
V_DAYS := I;
END IF;
-- V_COUNT := V_COUNT + 1;
IF I < 16 THEN
SQLSTR := SQLSTR || ',max(case SUBJECT when ''D07' || V_DAYS ||
''' then COUNTI else 0 end) as ''D07' || V_DAYS || '''' ||
CHR(10);
END IF;
END LOOP;
DBMS_OUTPUT.PUT_LINE(SQLSTR);
DBMS_OUTPUT.PUT_LINE(LENGTHB(SQLSTR));
END;显示文本:“,max(case SUBJECT when 'D0716' then COUNTI else 0 end) as 'D0716'
,max(case SUBJECT when 'D0717' then COUNTI else 0 end) as 'D0717'
,max(case SUBJECT when 'D0718' then COUNTI else 0 end) as 'D0718'
,max(case SUBJECT when 'D0719' then COUNTI else 0 end) as 'D0719'
,max(case SUBJECT when 'D0720' then COUNTI else 0 end) as 'D0720'
,max(case SUBJECT when 'D0721' then COUNTI else 0 end) as 'D0721'
,max(case SUBJECT when 'D0722' then COUNTI else 0 end) as 'D0722'
,max(case SUBJECT when 'D0723' then COUNTI else 0 end) as 'D0723'
,max(case SUBJECT when 'D0724' then COUNTI else 0 end) as 'D0724'
,max(case SUBJECT when 'D0725' then COUNTI else 0 end) as 'D0725'
,max(case SUBJECT when 'D0726' then COUNTI else 0 end) as 'D0726'
,max(case SUBJECT when 'D0727' then COUNTI else 0 end) as 'D0727'
,max(case SUBJECT when 'D0728' then COUNTI else 0 end) as 'D0728'
,max(case SUBJECT when 'D0729' then COUNTI else 0 end) as 'D0729'
,max(case SUBJECT when 'D0730' then COUNTI else 0 end) as 'D0730'
,max(case ”
显示长度:1056
解决方案 »
- 新手求助啊!PB11.5 + ORACLE 10G
- oracle 10g登陆OEM问题求教高手解决
- Oracle使用record不知道表结构问题
- 使用指示符变量向ORACLE表中插入空值的问题
- 如何在web.xml里面配置数据源
- 可以推荐几本好一点的ORACLE的书吗?
- 没分~初学ORCAL 谁告诉我个ORCAL的作业怎么写啊 最好有例子 谢谢
- 数据导入问题!
- 请问ORA-00472 PMON process terminated with error的 错误怎么解决?
- 问题解决有100分给,各位高手怎么才能在做应用程序的安装程序时“把ORACLE客户端”打进安装程序中,使其客户在安装时无需再安装ORACLE客
- oracle 数据导入到sql server中
- 数组如何改写为动态SQL
,max(case SUBJECT when 'D0701' then COUNTI else 0 end) as 'D0701'
,max(case SUBJECT when 'D0702' then COUNTI else 0 end) as 'D0702'
,max(case SUBJECT when 'D0703' then COUNTI else 0 end) as 'D0703'
,max(case SUBJECT when 'D0704' then COUNTI else 0 end) as 'D0704'
,max(case SUBJECT when 'D0705' then COUNTI else 0 end) as 'D0705'
,max(case SUBJECT when 'D0706' then COUNTI else 0 end) as 'D0706'
,max(case SUBJECT when 'D0707' then COUNTI else 0 end) as 'D0707'
,max(case SUBJECT when 'D0708' then COUNTI else 0 end) as 'D0708'
,max(case SUBJECT when 'D0709' then COUNTI else 0 end) as 'D0709'
,max(case SUBJECT when 'D0710' then COUNTI else 0 end) as 'D0710'
,max(case SUBJECT when 'D0711' then COUNTI else 0 end) as 'D0711'
,max(case SUBJECT when 'D0712' then COUNTI else 0 end) as 'D0712'
,max(case SUBJECT when 'D0713' then COUNTI else 0 end) as 'D0713'
,max(case SUBJECT when 'D0714' then COUNTI else 0 end) as 'D0714'
,max(case SUBJECT when 'D0715' then COUNTI else 0 end) as 'D0715'990
完全没发现你说的问题。
可以通过下面的方式分开显示,一样的哈~DECLARE
SQLSTR VARCHAR2(4000);
V_DAYS VARCHAR2(2);
V_LENGTH NUMBER:=0;
BEGIN
FOR I IN 1 .. 31 LOOP
V_DAYS:=LPAD(I,2,0);
SQLSTR := ',max(case SUBJECT when ''D07' || V_DAYS ||
''' then COUNTI else 0 end) as ''D07' || V_DAYS || '''';
V_LENGTH:=V_LENGTH+LENGTH(SQLSTR);
DBMS_OUTPUT.PUT_LINE(SQLSTR);
END LOOP;
DBMS_OUTPUT.PUT_LINE('显示长度'||V_LENGTH);
END;
因此想打印出来了,但Oracle显示不全