Home » Developer & Programmer » JDeveloper, Java & XML » ora 29531 Why?
ora 29531 Why? [message #536531] Wed, 21 December 2011 06:25 Go to next message
iblazquez
Messages: 26
Registered: June 2007
Junior Member
I've this java source

create or replace and compile java source named "Decodificador" as

public class Decodificador {


public static String decodifica(String codigo){

return codigo;
]

}

and this function

create or replace function F_Decodificador(codigo varchar2) RETURN VARCHAR2 IS
LANGUAGE java NAME 'Decodificador.decodifica(String) return String';

when I execute the function the result is:

ORA-29531: no method decodifica in class Decodificador

I don't know why. can anybody explain it to me
Re: ora 29531 Why? [message #536532 is a reply to message #536531] Wed, 21 December 2011 06:27 Go to previous messageGo to next message
Roachcoach
Messages: 1576
Registered: May 2010
Location: UK
Senior Member
mkr02@ORA11GMK> !oerr ora 29531
29531, 00000, "no method %s in class %s"
// *Cause: An attempt was made to execute a non-existent method in a
//          Java class.
// *Action: Adjust the call or create the specified method.

Re: ora 29531 Why? [message #536533 is a reply to message #536532] Wed, 21 December 2011 06:31 Go to previous messageGo to next message
iblazquez
Messages: 26
Registered: June 2007
Junior Member
But the method exists
Re: ora 29531 Why? [message #536534 is a reply to message #536533] Wed, 21 December 2011 06:33 Go to previous messageGo to next message
Roachcoach
Messages: 1576
Registered: May 2010
Location: UK
Senior Member
Well, that would suggest to me that Oracle thinks it does not - I'd start looking into why it thinks that.

[NB: Not a java person]

[Updated on: Wed, 21 December 2011 06:33]

Report message to a moderator

Re: ora 29531 Why? [message #536540 is a reply to message #536531] Wed, 21 December 2011 06:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
First line 9 should } instead of ].

SQL> create or replace and compile java source named "Decodificador" as
  2  
  3  public class Decodificador {
  4  
  5  
  6  public static String decodifica(String codigo){
  7  
  8  return codigo;
  9  ]
 10  
 11  }
 12  
 13  /
create or replace and compile java source named "Decodificador" as
                                                *
ERROR at line 1:
ORA-29536: badly formed source: Encountered "]" at line 7, column 1.
Was expecting one of:
"#sql" ...
"abstract" ...
"final" ...
"assert" ...
"boolean" ...
"break" ...
"byte" ...
"char" ...
"class" ...
"continue" ...
"do" ...
"double" ...
"false" ...
"float" ...
"for" ...
"if" ...
"int" ...
"long" ...
"new" ...
"null" ...
"return" ...
"short" ...
"super" ...
"switch" ...
"synchronized" ...
"this" ...
"throw" ...
"true" ...
"try" ...
"void" ...
"while" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<CHARACTER_LITERAL> ...
<STRING_LITERAL> ...
<IDENTIFIER> ...
"{" ...
"}" ...
"(" ...
";" ...
"++" ...
"--" ...


Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

Use SQL*Plus and copy and paste your session, the WHOLE session as I did.

Regards
Michel
Re: ora 29531 Why? [message #536541 is a reply to message #536540] Wed, 21 December 2011 07:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Once you fix this it compiles:
SQL> 9
  9* ]
SQL> c:]:}
  9* }
SQL> l
  1  create or replace and compile java source named "Decodificador" as
  2
  3  public class Decodificador {
  4
  5
  6  public static String decodifica(String codigo){
  7
  8  return codigo;
  9  }
 10
 11  }
 12*
SQL> /

Java created.

SQL> create or replace function F_Decodificador(codigo varchar2) RETURN VARCHAR2 IS
  2  LANGUAGE java NAME 'Decodificador.decodifica(String) return String';
  3  
  4  /

Function created.

Regards
Michel

[Updated on: Wed, 21 December 2011 07:02]

Report message to a moderator

Re: ora 29531 Why? [message #536544 is a reply to message #536540] Wed, 21 December 2011 07:05 Go to previous messageGo to next message
iblazquez
Messages: 26
Registered: June 2007
Junior Member
I've copied bad the code

create or replace and compile java source named "Decodificador" as

public class Decodificador {


public static String decodifica(String codigo){

return codigo;
}

}

the error persist
Re: ora 29531 Why? [message #536545 is a reply to message #536541] Wed, 21 December 2011 07:08 Go to previous messageGo to next message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> create or replace function F_Decodificador(codigo varchar2) RETURN VARCHAR2 IS
  2  LANGUAGE java NAME 'Decodificador.decodifica(String) return String';
  3  
  4  /

Function created.

SQL> select F_Decodificador from dual;
select F_Decodificador from dual
       *
ERROR at line 1:
ORA-06553: PLS-306: wrong number or types of arguments in call to 'F_DECODIFICADOR'

SQL> create or replace function F_Decodificador(codigo varchar2) RETURN VARCHAR2 IS
  2  LANGUAGE java NAME 'Decodificador.decodifica(java.lang.String) return java.lang.String';
  3  /

Function created.

SQL> select F_Decodificador('X') from dual;
F_DECODIFICADOR('X')
-----------------------------------------------------------------------------------------------------
X

1 row selected.

See how it is easy to see and fix the error when you correctly post.

Regards
Michel

[Updated on: Wed, 21 December 2011 07:09]

Report message to a moderator

Re: ora 29531 Why? [message #536560 is a reply to message #536545] Wed, 21 December 2011 09:22 Go to previous message
iblazquez
Messages: 26
Registered: June 2007
Junior Member
Thanks.
Previous Topic: updating CLOB value
Next Topic: how to connect oracle 11g from netbeans 7
Goto Forum:
  


Current Time: Tue Apr 16 17:25:10 CDT 2024