Get data type of field in select statement in ORACLE

后端 未结 7 1486
半阙折子戏
半阙折子戏 2020-12-25 13:04

Can I get data types of each column I selected instead of the values, using a select statement?

FOR EXAMPLE:

SELECT a.name, a.surname, b.ordernum 
FR         


        
7条回答
  •  醉梦人生
    2020-12-25 13:31

    I usually create a view and use the DESC command:

    CREATE VIEW tmp_view AS 
    SELECT 
          a.name
        , a.surname
        , b.ordernum 
    FROM customer a
      JOIN orders b
        ON a.id = b.id
    

    Then, the DESC command will show the type of each field.

    DESC tmp_view

提交回复
热议问题