Sql updating a table from the same table

SQL is a declarative language that allows database programmers to write a SQL declaration and hand it to the database for execution.As such, SQL cannot be used to execute procedural code with conditional, iterative and sequential statements. PL/SQL is Oracle's Procedural Language extension to SQL.Oracle will still understand and know how to execute the code.Just be careful, there is no "decode" command available. The syntax is: Please note: there is no legal way to unwrap a *binary file.In more recent releases both triggers and procedures are compiled when created (stored p-code) and one can add as much code as one likes in either procedures or triggers.However, it is still considered a best practice to put as much of your program logic as possible into packages, rather than triggers.The following table briefly describes the similarities and difference between these two language environments: PL/SQL: PS: Starting with Oracle 10g, . PS: In earlier releases of Oracle it was better to put as much code as possible in procedures rather than triggers.NET procedures can also be stored within the database (Windows only). At that stage procedures executed faster than triggers as triggers had to be re-compiled every time before executed (unless cached).

This often leads to questions like "Which of the two is the best?

This will allow you to easily revert to previous code should someone make any catastrophic changes.

Look at this example: CREATE TABLE SOURCE_HIST -- Create history table AS SELECT SYSDATE CHANGE_DATE, ALL_SOURCE.* FROM ALL_SOURCE WHERE 1=2; CREATE OR REPLACE TRIGGER change_hist -- Store code in hist table AFTER CREATE ON SCOTT.

The utility use human-readable PL/SQL source code as input, and writes out portable binary object code (somewhat larger than the original).

The binary code can be distributed without fear of exposing your proprietary algorithms and methods.

Leave a Reply