Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Desesperate function

Status
Not open for further replies.

jcasas23

IS-IT--Management
Oct 10, 2003
54
MX
When run this query

select devcbs.p_ini(bell.cia, trunc(bell.INIT_DATE)) prueba
from es344.b_empl_line_log bell

CREATE OR REPLACE function p_ini
(
ncia number,
init date
)
return number is
per number;
begin
select bp.period into per
from devcbs.b_periods bp
where bp.cia = ncia
and bp.init_date = to_date(init,'DD/MM/YYYY');
return (per);
end p_ini;

--------------------------------------------------
/

Show me this error:
The following error has occurred:

ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at "DEVCBS.P_INI", line 17
ORA-06512: at line 1

I do not know what is the problem please help me I desesperate

Thanks in advance
 
K'zaz,

(Para el el próximo tiempo, la palabra inglesa para desesperado es 'desperate'.)

The problem with your function is that you are trying to convert a date ("init") into a date. Here is your corrected code:
Code:
CREATE OR REPLACE function p_ini
(
 ncia number,
 init date
)
return number is
   per number;
begin
   select bp.period into per
   from devcbs.b_periods bp
   where bp.cia = ncia
     and bp.init_date = init;
   return (per);
end p_ini;

Let us know if this resolves your need.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 23:27 (18Oct04) UTC (aka "GMT" and "Zulu"), 16:27 (18Oct04) Mountain Time)
 
The function is working now, thank you for your help.

I really appreciate your help.

Do you know any training to use PL-SQL, Oracle Developer Forms and Reports?

This is to learn some mor tips, because I was learning by myself, and it is a very hard way.

thanks for the information.

 
K'zaz,

Among the alternate methods of learning the topics you mention are:

1) Instructor-led training (ILT) classes from Oracle Education (1.800.529.0165 U.S.)

2) Computer-based training (CBT) CDs from Oracle (for more info,
3) Third-party training: both ILT and CBT, usually less expensive than from Oracle. (Google for "Third-party Oracle training providers")

4) Oracle tutorial texts available from Amazon.com (Typically least-expensive alternative).

Regards,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 18:44 (19Oct04) UTC (aka "GMT" and "Zulu"), 11:44 (19Oct04) Mountain Time)
 
You might also try Oracle's On-Line Training (OLT). I think it costs about $250/year to subscribe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top