travel from 10g to 11g problems [message #527498] |
Tue, 18 October 2011 06:24 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/165567.jpg) |
mahnazzz
Messages: 98 Registered: July 2011 Location: Iran
|
Member |
|
|
Hi.
I switched from oracle form 10g to 11g.
my form run successfully in 10g but not on 11g(runtime error).
this is the Scenario:
declare
V_ErrorCode number;
v_PRS_STR varchar2(2000);
vRAISE_ERROR BOOLEAN := FALSE;
begin
-------All these codes have no error in 10g,But there are some problems in Application Server 11g:
-- The following code (Code A) runs with no error :
-- Code A :
v_PRS_STR:='begin '||' insert into hrs_prsntemp values(1,1); commit; ' ||' end; ';
-- But when it changes into the following code (Code B), it causes Error Number: ora-24333.
-- Code B :
v_PRS_STR:=
'begin '||' insert into hrs_prsntemp select 1 a,1 b from dual; commit; end;';
ParseSql_P(v_PRS_STR,V_ErrorCode);
message(V_ErrorCode);
-- Furthermore, whenever I copy the code of "ParseSql_P" procedure right here,instead of calling that procedure,
-- It runs correctly with no error!
-- The most interesting matter is that, if I write code of "B" with syntax error,
-- it causes Error Number: ora-24333 again
END;
the comment explain the problem.
procedure ParseSql_P:
PROCEDURE ParseSql_P(P_Sqlstr In VARCHAR2,P_ErrorCode Out NUMBER,vRAISE_ERROR BOOLEAN := FALSE) IS
V_connection_id EXEC_SQL.CONNTYPE;
V_cursorID EXEC_SQL.CURSTYPE;
V_nIgn NUMBER;
P_Result NUMBER;
V_sqlerrm varchar2(2000);
BEGIN
V_connection_id := EXEC_SQL.DEFAULT_CONNECTION;
V_cursorID := EXEC_SQL.OPEN_CURSOR(V_connection_id);
begin
EXEC_SQL.PARSE(V_connection_id,V_cursorID,P_Sqlstr, exec_sql.V7);
V_nIgn := EXEC_SQL.EXECUTE(V_connection_id,V_cursorID);
EXCEPTION
when EXEC_SQL.Package_Error then
P_ErrorCode:=exec_sql.last_error_code(V_connection_id);
V_sqlerrm:=exec_sql.last_error_mesg(V_connection_id);
END;
IF vRAISE_ERROR THEN
MESSAGE(V_sqlerrm);
RAISE FORM_TRIGGER_FAILURE;
END IF;
EXEC_SQL.CLOSE_CURSOR (V_connection_id,V_cursorID);
EXEC_SQL.CLOSE_CONNECTION(V_connection_id);
END;
thanks
[Updated on: Tue, 18 October 2011 06:30] Report message to a moderator
|
|
|
|
Re: travel from 10g to 11g problems [message #527570 is a reply to message #527503] |
Tue, 18 October 2011 23:08 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/165567.jpg) |
mahnazzz
Messages: 98 Registered: July 2011 Location: Iran
|
Member |
|
|
This is the sample of my code.I have to use dynamic code.here I wanted to show a sample of the problem.I could not understand why this code behavior is difference in two version or is it really depends on version or not.
|
|
|