Jump to content

Search the Community

Showing results for tags 'pl/sql'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type



Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 2 results

  1. My function does not return the date. I will publish the package body and call the function Can you tell me where the error is? My function in package body looks like this: SQL> CREATE OR REPLACE PACKAGE BODY account_api AS 2 PROCEDURE add_new_account 3 ( p_acc_id accounts.acc_id%type 4 , p_acc_name accounts.acc_name%type 5 , p_acc_amount accounts.acc_amount%type 6 , p_acc_date accounts.acc_date%type) 7 IS 8 BEGIN 9 INSERT INTO accounts(acc_id, acc_name, acc_amount, acc_date) 10 VALUES (p_acc_id, p_acc_name, p_acc_amount, p_acc_date); 11 COMMIT; 12 EXCEPTION 13 WHEN OTHERS THEN 14 ROLLBACK; 15 RAISE; 16 END; 17 PROCEDURE upd_account 18 (p_acc_id accounts.acc_id%type 19 , p_acc_name accounts.acc_name%type 20 , p_acc_amount accounts.acc_amount%type 21 , p_acc_date accounts.acc_date%type 22 ) 23 IS 24 BEGIN 25 UPDATE accounts 26 set acc_name = p_acc_name 27 , acc_amount = p_acc_amount 28 , acc_date = p_acc_date 29 WHERE acc_id = p_acc_id; 30 COMMIT; 31 END; 32 PROCEDURE del_accounts 33 (p_acc_id accounts.acc_id%type) 34 IS 35 BEGIN 36 DELETE FROM accounts WHERE acc_id = p_acc_id; 37 COMMIT; 38 EXCEPTION 39 WHEN OTHERS THEN 40 ROLLBACK; 41 RAISE; 42 END; 43 FUNCTION get_amount 44 (p_acc_id accounts.acc_id%type) 45 return Number is res number; 46 begin 47 select acc_amount into res 48 from accounts where acc_id =p_acc_id; 49 return res; 50 end; 51 FUNCTION get_date 52 (p_acc_id accounts.acc_id%type) 53 RETURN date IS res1 date; 54 BEGIN 55 SELECT acc_date INTO res1 56 FROM accounts WHERE acc_id = p_acc_id; 57 RETURN res1; 58 end; 59 end account_api; 60 / The function is executed but does not return the data. SQL> set serveroutput on SQL> declare 2 res1 date; 3 begin 4 res1 := account_api.get_date(1); 5 end; 6 / PL/SQL procedure successfully completed.
  2. A+++500+read++ I want the occurence of last '+' or in other words,total count of '+' before last value 'read' through PL/SQL at which value occurs.First value is 'A',Second value is '500' , third value is 'read'.Here last value is 'read' and position of '+' at which last value 'read' occurs is 4.I want this output 4 through query.Just want occurence of Highlighted '+' or in other words,total count of '+' before last value 'read'.Max position of '+' at which last value is there.Here output should be 4. Second i want total number of values that occurs between '+'..Here three values namely A,500,read is there.I want count of values means how many values exist between '+'.Output should be 3.
×