I want to live in this moment because it’s all I truly own. Once it’s gone, it’s gone forever.
PL/SQL commands to view the table details
In Oracle PL/SQL, you can use the following commands to view table details:
DESCRIBE or DESC
DESC table_name;Displays columns, data types, and constraints.
USER_TAB_COLUMNS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'TABLE_NAME';Shows details about columns for tables owned by the user.
ALL_TAB_COLUMNS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH FROM ALL_TAB_COLUMNS WHERE TABLE_NAME = 'TABLE_NAME';Provides column information for tables accessible to the user.
DBMS_METADATA.GET_DDL
SELECT DBMS_METADATA.GET_DDL('TABLE', 'TABLE_NAME') FROM DUAL;Displays the
CREATE TABLEstatement for table structure details.
To view constraints on the table, you can check here.
Use Flashback Query
If your Oracle database has Flashback enabled, you can query past versions of data within a specified retention period. Here’s how to use Flashback to retrieve a prior state of data:
SELECT *
FROM your_table AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '5' MINUTE)
WHERE your_condition;
Replace SYSTIMESTAMP - INTERVAL '5' MINUTE with the timestamp or interval that reflects when the data was last known to be in its old state.
Note: Flashback must be enabled, and it’s only available within the Flashback retention window, which depends on your database configuration.
References
Favourite movie quotes
How to break columns in Bootstrap
Breaking columns to a new line in flexbox requires a small hack: add an element with width: 100% wherever you want to wrap your columns to a new line.
<div class="container text-center">
<div class="row">
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
<!-- Force next columns to break to new line -->
<div class="w-100"></div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
</div>
</div>
You can also apply this break at specific breakpoints with our responsive display utilities.
<div class="container text-center">
<div class="row">
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
<!-- Force next columns to break to new line at md breakpoint and up -->
<div class="w-100 d-none d-md-block"></div>
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
</div>
</div>
References
Things that make me happy
To generate random value in PL/SQL
To update a column with a random value in PL/SQL, you can use the DBMS_RANDOM package, which provides functions for generating random numbers or strings.
To update random number
BEGIN
UPDATE employees
SET salary = ROUND(DBMS_RANDOM.VALUE(100, 500));
COMMIT;
END;
DBMS_RANDOM.VALUE(100, 500)generates a random decimal number between 100 and 500.- ROUND is used to convert the decimal value to an integer.
To update random string
BEGIN
UPDATE employees
SET password = DBMS_RANDOM.STRING('x', 8); -- 'x' specifies alphanumeric characters
COMMIT;
END;
DBMS_RANDOM.STRING('x', 8)generates an 8-character alphanumeric string.- ‘x’ specifies alphanumeric characters (letters and numbers). Other options include ‘a’ for alphabets and ‘u’ for uppercase only.
