Insert values into a table using function [message #264015] |
Fri, 31 August 2007 09:12  |
nagaraj42
Messages: 8 Registered: August 2007 Location: chennai
|
Junior Member |
|
|
Can anyone please help in writing a function which will insert the values into table when we give the input values.
And it has to display the result as "PASS" if the inserted value is a number and it is "Fail" if inserted value is not number
I have written the function like this... Can you please help me in goin further
I am inserting upto 100 values at present....
CREATE OR REPLACE FUNCTION FN_INSERT ( I NUMBER )
RETURN VARCHAR2 ;
BEGIN
LOOP
INSERT INTO T1 VALUES(I,I);
I := I+1;
EXIT WHEN I>100;
END LOOP;
RETURN ('PASS');
EXCEPTION WHEN OTHERS THEN
RETURN ('FAIL');
END;
|
|
|
|
|
|
|
Re: Insert values into a table using function [message #264174 is a reply to message #264062] |
Sat, 01 September 2007 07:23   |
nagaraj42
Messages: 8 Registered: August 2007 Location: chennai
|
Junior Member |
|
|
Can you please correct that function ?? Is the parameter of data type number is wrong??
Please suggest me where I am going wrong.
The concept is this " writing a function which will insert the values into table when we give the input values.
And it has to display the result as "PASS" if the inserted value is a number and it is "Fail" if inserted value is not number " T1 is any table which is created to insert values into table.
Regards,
Raju
[Updated on: Sat, 01 September 2007 07:24] Report message to a moderator
|
|
|
|
|
|
|