我在使用下面的代码时遇到问题。我不断收到“数字或值错误:字符串缓冲区太小”错误。似乎 str 变量应该保存长字符串,因为它是一个 clob 变量。我被迫将输入到“str”clob 变量中的字符串分成块,因为我之前收到“字符串文字对于 CLOB 来说太长”错误。然而,现在似乎变量“str”没有被识别为 clob,我受到 varchar2 长度最大限制的限制。任何帮助深表感谢。str 变量的字符长度为 80,000。
example data real array is much longer
sqlLineArray = [-107.67346538 47.88608515, -107.67240372 47.88971443, -107.67122833 47.89342082, -107.67126488 47.89706066, -107.67198103 47.90075708]
s = ', '.join(sqlLineArray)
l = s.split()
n = 250
array = [' '.join(l[x:x+n]) for x in xrange(0, len(l), n)]
"declare
in_themeid number := "+str(themeInfoObjId)+";
in_featurename varchar2(100) := '"+replaceApostrophes(row[2])+"';
str clob;
p_nextRowId number;
begin
SAVEPOINT starting_point;
str := 'linestring (' || '"+"' || '".join(array)+"'||')';
p_nextRowId := sde.version_user_ddl.next_row_id('REFRNC', "+getTableId('FWPMAPPERLINES', 'REFRNC')+");
INSERT INTO FWPMAPPERLINES (OBJECTID, REFRNC_ID, FEATURENAME, SHAPE) VALUES
(p_nextRowId,in_themeid, in_featurename, sde.st_transform(sde.ST_LineFromText(str,82),2));
commit;
END;"