>1. How to count newly inserted records in a table of oracle, as in SQL Server
>
>SELECT COUNT(*) FROM inserted
There is no easy way. I am assuming you want to do this in a trigger.
Perhaps provide more details of what you want this for and I can give a better
solution, as there is no inserted and deleted tables for use in triggers like
SQL SERVER. The triggers fire per row. So you can log the number of inserts in
an insert trigger and store them in a table but lets see what you are trying to achieve first.
>How the similar can be obtained in Oracle.
>
>
>2. How to call a stored proc. from 'SQL>' prompt. For example I have a procedure defined as,
>
>CREATE OR REPLACE PROCEDURE mytest (var IN OUT varchar2)
>AS
>BEGIN
>INSERT INTO TEST (Name, Age)
>VALUES ('aaa',25);
>END;
>/
>
>Now i want to execute this from the sql prompt.
>
>
>Thanks in advance.
SET SERVEROUTPUT ON
DECLARE
myout varchar2(100);
BEGIN
MyTest(myout);
DBMS_OUTPUT.PUT_LINE(myout);
END;
But you don't use this variable in the procedure. so why do you need it
pass it in to the procedure. If you don't want to see the output parameter you can just do:
EXECUTE MyTest('1');
HTH