Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server -- Oracle
Message
From
03/09/2001 04:37:20
 
 
To
03/09/2001 04:22:43
General information
Forum:
Oracle
Category:
Other
Miscellaneous
Thread ID:
00551717
Message ID:
00551724
Views:
14
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform