Good Morning.
I am facing a very strange problem. I have an Oracle stored procedure which will accept a VARCHAR2 parameter.
From my ASP.NET application, I am calling this stored procedure and passing a comma separated string to this parameter. The length of the comma separated string is 700 characters (including commas).
Now the problem is Oracle procedure is returning the error "3421: Application uses a value of the wrong type for the current operation".
If I delete some content of the input string and send it to procedure, then it is running successfully.
I read that VARCHAR2 in Oracle accepts a maximum of 4000 characters. I am sending only 700 characters. Still it is not taking it.
I tried to give the size to the procedure parameter. But it is giving compilation error and I read that we can't specify the size to oracle procedure prameter.
Can you please help me in resolving this issue.
Thanks Srinivas
Input String that is sent to VAR33 in SP_TESTPROC procedure:
195083,195320,195815,196311,196247,196866,197002,197271,197294,197998,198107,
195322,195501,196537,196887,198194,198964,195125,196153,196454,196587,197158,
197082,197277,197482,198110,198312,196586,196403,196428,196510,196694,197075,
197543,198111,198351,195215,196399,197697,198200,198338,196267,195851,196069,
196435,197154,196411,196883,196898,196384,196892,196826,197138,198123,198590,
197384,196383,196438,197044,197831,198917,195787,198199,198120,195874,197155,
197262,197264,197447,198193,195730,196886,196891,196899,197076,198502,196232,
196538,196603,196857,196263,195380,196660,198041,198763,195616,195720,196430,
197559,197836,197844,198015,198666,195777,195951,196433,196795,195843,196398,
196448
create or replace PROCEDURE SP_TESTPROC
(VAR33 IN VARCHAR2 DEFAULT NULL
RC1 IN OUT OMWB_EMULATION.GLOBALPKG.RCT1)
AS
BEGIN
OPEN RC1 FOR
SELECT *
FROM TABLE1 A
INNER JOIN TABLE2 B ON A.ID = B.TABLE1ID
WHERE A.ID IN (select TO_NUMBER(regexp_substr(SPCWKF_CASEASSIGNMASTERQUERY.VAR33,'[^,]+', 1, level)) from dual
connect by regexp_substr(SPCWKF_CASEASSIGNMASTERQUERY.VAR33, '[^,]+', 1, level) is not null);
END SP_TESTPROC;
3421: Application uses a value of the wrong type for the current operation
is not an Oracle message. Are you invoking this procedure through some sort of API, which perhaps believes that there's a limit on how long the string can be? Also, theVAR33
parameter is not used in the procedure, so what's the point of having it there in the first place? – Bob Jarvis - Reinstate Monica