New answers tagged plsql
Replace select portfoliono into mportfoliono from sipholder where accno=:new.accno; with mportfoliono := new.portfoliono; no need to use a SELECT for values of the updated row.
Your analysis is correct. You don't need the trigger because the constraint is doing the same job. Anyway, to drop the constraint use: Alter table train drop constraint train_len;
Global temporary tables in Oracle are very different, as they have a permanent logical definition and transient storage, so practically the reverse of your situation. I would look at trying to avoid temporary tables at all, in favour of Common Table Expressions (WITH clauses). They are very powerful stuff and can transiently use temporary disk space if it ...
You can use UNION [ALL] to combine rows from multiple queries, as long as the number of columns are the same and the columns are compatible, if not of the exact same types. SELECT 'Driver' as SourceTable, Driver_No, Name, Available FROM Driver WHERE Available = 'Y' UNION ALL SELECT 'Freight', Freight_No, Freight_Wagon_Type_Name, Available FROM ...
Oracle will provide a read-consistent view of the data. Assuming that you're using the default transaction isolation level of read committed, the data that a query will return is fixed at the point in time that the cursor is opened (whether the cursor is implicit or explicit is irrelevant). The only exception to this is that PL/SQL that is called by the ...
You'll need to execute your SQL statement. Use execute immediate for this. And because you're selecting a value you'll need to execute immediate ... into it, something like this (replacing 3 > 2 with your own where condition: CREATE OR REPLACE PROCEDURE test(p_table IN varchar2) IS v_sqltxt varchar2(4000); v_count integer; BEGIN v_sqltxt:='select ...
Top 50 recent answers are included