Get data type of field in select statement in ORACLE

后端 未结 7 1613
半阙折子戏
半阙折子戏 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条回答
  •  萌比男神i
    2020-12-25 13:18

    If you don't have privileges to create a view in Oracle, a "hack" around it to use MS Access :-(

    In MS Access, create a pass through query with your sql (but add where clause to just select 1 record), create a select query from the view (very important), selecting all *, then create a make table from the select query. When this runs it will create a table with one record, all the data types should "match" oracle. i.e. Passthrough --> Select --> MakeTable --> Table

    I am sure there are other better ways, but if you have limited tools and privileges this will work.

提交回复
热议问题