我使用BFILENAME命令上传一个文件到BLOB中,创建目录的SQL语句如下: /*确定目录 否存在,如果不存在,则创建*/
select count(*) into directoryNum from all_directories where directory_name = upper(path);
if directoryNum <>0 then/*如果目录存在,则先将此目录删除*/
tmpSql:='drop directory '||path;
execute immediate tmpSql;
end if;如果文件路径path全部为英文,则一切正常(包括上传文件),但如果文件路径path为中文,则不能创建,并显示错误,如何解决?
select count(*) into directoryNum from all_directories where directory_name = upper(path);
if directoryNum <>0 then/*如果目录存在,则先将此目录删除*/
tmpSql:='drop directory '||path;
execute immediate tmpSql;
end if;如果文件路径path全部为英文,则一切正常(包括上传文件),但如果文件路径path为中文,则不能创建,并显示错误,如何解决?
execute immediate tmpSql;filePath中如果有英文,则报错。
pFileParm[2] = new OracleParameter("filePath", OracleType.VarChar); //文件路径
pFileParm[2].Direction = ParameterDirection.Input;
pFileParm[2].Value = strPath;在Oracle中,使用
tmpSql:='create directory cjsTempFilePath as ' ||''''||filePath||'''';
execute immediate tmpSql;
语句来创建directory 。
当VS调用ORACLE中的存储过程时,报错是:ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小。
tmpSql:='create directory cjsTempFilePath as '||chr(39)||filePath||chr(39);
tmpSql:='create directory cjsTempFilePath as ' ||''''||filePath||'''';
execute immediate tmpSql;
语句来创建directory 。
当VS调用ORACLE中的存储过程时,报错是:ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小
看上面的报错是:ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小你的变量tmpSql定义的长度是多少?是不是赋给该变量的值超过了,该变量定义的长度了。建议把该变量tmpSql的大小设置大一点。tmpSql VARCHAR2(2000);