Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

database-metadata

How to find out when a particular table was created in Oracle?

May 2, 2023 by Tarik

SELECT created FROM dba_objects WHERE object_name = <<your table name>> AND owner = <<owner of the table>> AND object_type=”TABLE” will tell you when a table was created (if you don’t have access to DBA_OBJECTS, you could use ALL_OBJECTS instead assuming you have SELECT privileges on the table). The general answer to getting timestamps from a … Read more

Categories oracle Tags database-metadata, oracle, oracle11g Leave a comment

Get Database Table Name from Entity Framework MetaData

April 7, 2023 by Tarik

I use Nigel’s approach (extracting table name from .ToTraceString()) but with some modifications, because his code won’t work if the table is not in the default SQL Server schema (dbo.{table-name}). I’ve created extension methods for DbContext and ObjectContext objects: public static class ContextExtensions { public static string GetTableName<T>(this DbContext context) where T : class { … Read more

Categories .net Tags .net, database-metadata, entity-framework Leave a comment

How to get all table names from a database?

February 25, 2023 by Tarik

You need to iterate over your ResultSet calling next(). This is an example from java2s.com: DatabaseMetaData md = conn.getMetaData(); ResultSet rs = md.getTables(null, null, “%”, null); while (rs.next()) { System.out.println(rs.getString(3)); } Column 3 is the TABLE_NAME (see documentation of DatabaseMetaData::getTables).

Categories java Tags database-metadata, java, jdbc Leave a comment

List of foreign keys and the tables they reference in Oracle DB

November 13, 2022 by Tarik

The referenced primary key is described in the columns r_owner and r_constraint_name of the table ALL_CONSTRAINTS. This will give you the info you want: SELECT a.table_name, a.column_name, a.constraint_name, c.owner, — referenced pk c.r_owner, c_pk.table_name r_table_name, c_pk.constraint_name r_pk FROM all_cons_columns a JOIN all_constraints c ON a.owner = c.owner AND a.constraint_name = c.constraint_name JOIN all_constraints c_pk ON … Read more

Categories oracle Tags database-metadata, metadata, oracle Leave a comment

How to get all columns’ names for all the tables in MySQL?

October 9, 2022 by Tarik

select column_name from information_schema.columns where table_schema=”your_db” order by table_name,ordinal_position

Categories mysql Tags database-metadata, database-schema, mysql Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa