Please someone help me with this procedure

create or replace procedure do_withdrawal

(

p_cust_id in varchar2,

p_acc_id number,

p_amount number

)

as

unathurozied exception;

Start

If get_authority (p_cust_id, p_acc_id) = 0 then

raise unathurozied;

on the other

Insert indent

(

wit_id,

cust_id,

acc_id,

amount,

Date_Time

)

values

(

pk_seq.nextval,

p_cust_id,

p_acc_id,

p_amount,

SYSDATE

);

commit;

dbms_output.put_line (' Dear customer: your balance is ' (p_acc_id) get_balance | p_amount);

end if;

exception

When unathurozied then

raise_application_error (-20010, "Unathorized user");

......................................................................................................

I get the following error when you try to insert into the table of withdrawal

..................................................................................................

Start

exec do_withdrawal ('650707-1111', ' 123 ', ' 0.0');

end;

Error from the 74 in the command line:

exec do_withdrawal ('650707-1111', ' 123 ', ' 0.0')

Error report:

ORA-06502: PL/SQL: digital or value error: character of number conversion error

ORA-06512: at "SYSTEM. DO_WITHDRAWAL', line 19

ORA-06512: at line 1

06502 00000 - "PL/SQL: digital error or the value of %s.

* Cause:

* Action:

out of this get_authority (p_cust_id, p_acc_id) is not a digital .output get_authority this varchar2 which is always a string.

You can't compare if get_authority (p_cust_id, p_acc_id) = 0 then in the do_withdrawal procedure.

If you want you want changed in the do_withdrawal procedure.

Of

If get_authority (p_cust_id, p_acc_id) = 0 then

TO

If get_authority (p_cust_id, p_acc_id) = '0' then

Now, it will work

Tags: Database

Similar Questions

Maybe you are looking for

  • Install the link Dropbox with Terminal mpkg file

    Hello I'm looking at the best way to install a mpkg on multiple Macs in our society.  With our MDM solution limited, it will be via a script/Terminal command.  I wonder if someone would be able to help the best way to do it.  I placed the file in a l

  • Lower FCPX using third file .psd

    I try to create a lower third to be used for FCPX, using a locked .psd file provided by a customer. I can't make it work - can anyone help me? Thank you.

  • PowerPoint on MacBook Pro

    I have a MacBook Pro 15 "2112. I'm doing a presentation of Powerpoint tomorrow. I need to connect to a TV that has an HDMI port. I also need a remote clicker. All are adaptable for Mac or I have to buy a special? Is there a resource on how to impleme

  • I backed up my PC - all my photos and Skype chat history appear?

    Hello According to the title? I read earlier that the photos and the cat were stored in program files that they would not be saved? Is this true? Kind regards Taylor

  • Problem with WLC2112 wireless

    Hello I'm looking for suggestions on what to do in this case: Have a wireless controller: WLC2112 and points of access 8, but im having problems with disconnections of ap´s, sometimes I can see the 8 ap´s and sometimes only 5 ap´s. I ran the command