문자열을 반환하는 매개 변수없이 Testing이라는 간단한 Oracle 함수를 작성했습니다.Oracle 함수 호출 .NET에서 저장 프로 시저
System.Data.OracleClient.OracleException :
ORA-06550: line 1, column 7:" "PLS-00221: 'TESTING2' is not a procedure or is undefined".
내가 할 "이중에서 테스트()를 선택합니다"로 변경하면 내 .NET 응용 프로그램에서 호출 할 때 오류가 발생합니다 CommandType을 Text로 변경하면 작동합니다. 내가 뭘 놓치고 있니?
Dim oracleConn As OracleConnection = CreateConnection(<connection info here>)
Dim oracleCmd As New OracleCommand()
oracleCmd.Connection = oracleConn
'oracleCmd.CommandText = "SELECT TESTING2() FROM DUAL" 'this works
oracleCmd.CommandText = "TESTING2" 'this does not work
oracleCmd.CommandType = CommandType.StoredProcedure
'oracleCmd.ExecuteReader() 'also tried this
Dim tmpVar As String = oracleCmd.ExecuteScalar()
create or replace FUNCTION testing2
RETURN VARCHAR2
AS
begin
return 'hello';
end;
당신은 오라클 서버에 로그온하는 데 사용하는 사용자에 대해 해당 sproc에 대한 실행 권한을 부여 했습니까? 당신은 패키지 안에 sproc을 정의 했나요? – codingadventures
내 사용자에게 할당 된 모든 역할에 대해 보조금을 실행했습니다. 함수의 일부를 패키지의 일부로 호출하려고했지만 동일한 오류가 발생했습니다. – Kelly