PLS-00363: expression 'P_HANDLE_I' cannot be used as an assignment target [message #428844] |
Fri, 30 October 2009 05:37  |
 |
delna.sexy
Messages: 941 Registered: December 2008 Location: Surat, The Diamond City
|
Senior Member |
|
|
Hi all,
I have some doubts in using FSEEK procedure of UTL_FILE package.
SQL>select banner from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 64-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
5 rows selected.
In FSEEK procedure, first parameter is file_handle, which is of IN type parameter.
I am passing file handle as shown in below code.
SQL>R
1 CREATE OR REPLACE FUNCTION COUNT_LINKS(P_HANDLE_I IN UTL_FILE.FILE_TYPE)
2 RETURN INTEGER
3 AS
4 V_COUNT INTEGER;
5 V_BUFFER VARCHAR2(32000);
6 V_SQLERRM VARCHAR2(500);
7 BEGIN
8 UTL_FILE.FSEEK(P_HANDLE_I, 1, NULL);
9 BEGIN
10 LOOP
11 UTL_FILE.GET_LINE(P_HANDLE_I, V_BUFFER, 32000);
12 IF (INSTR(V_BUFFER, '<!--#') > 0) THEN
13 V_COUNT := V_COUNT + 1;
14 END IF;
15 END LOOP;
16 EXCEPTION
17 WHEN NO_DATA_FOUND THEN
18 NULL;
19 WHEN OTHERS THEN
20 V_SQLERRM := SQLERRM;
21 INSERT INTO TRACE_TABLE VALUES('Error in SEO_AUTO_EXCHANGE.COUNT_LINKS => ' ||
V_SQLERRM, SYSTIMESTAMP);
22 END;
23 RETURN V_COUNT;
24* END;
Warning: Function created with compilation errors.
And as P_HANDLE_I is neither on the RHS of the expression nor OUT or IO OUT parameter, it should work properly.
But it gives me error as...
SQL>SHOW ERROR
Errors for FUNCTION COUNT_LINKS:
LINE/COL ERROR
-------- -----------------------------------------------------------------
8/9 PL/SQL: Statement ignored
8/24 PLS-00363: expression 'P_HANDLE_I' cannot be used as an
assignment target
What can be the cause and its solution?
regards,
Delna.
[Updated on: Fri, 30 October 2009 06:29] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: PLS-00363: expression 'P_HANDLE_I' cannot be used as an assignment target [message #428854 is a reply to message #428852] |
Fri, 30 October 2009 06:06   |
cookiemonster
Messages: 13967 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
delna.sexy wrote on Fri, 30 October 2009 10:58Quote:When WHEN OTHERS is not followed by RAISE its always almost a bug.It hides the real error.
This is not the solution of my problem, I have described in OP.
Don't post anything, irrelavent.
See that, I have captured that error in one table.
regards,
Delna
You should know by now that we always pick up on stuff like that even if it isn't the source of the error.
If you'll going to insert information into a log table from an exception handler you should create a procedure to do so and make it an autonomous_transaction.
That way you can commit it without messing with anything else.
And you should still have a raise otherwise the calling program won't know that anything went wrong.
|
|
|
|
|
|
Re: PLS-00363: expression 'P_HANDLE_I' cannot be used as an assignment target [message #428864 is a reply to message #428852] |
Fri, 30 October 2009 06:31  |
 |
Michel Cadot
Messages: 68767 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
delna.sexy wrote on Fri, 30 October 2009 11:58Quote:When WHEN OTHERS is not followed by RAISE its always almost a bug.It hides the real error.
This is not the solution of my problem, I have described in OP.
Don't post anything, irrelavent.
See that, I have captured that error in one table.
regards,
Delna
Don't post something we repeated you it is STUPID.
YES, it is a REAL BUG.
Regards
Michel
[Updated on: Fri, 30 October 2009 06:32] Report message to a moderator
|
|
|