Returning column names from table in SQLite using Java GUI

后端 未结 1 1202
Happy的楠姐
Happy的楠姐 2020-12-22 12:13

I need to get column names from table, only difference is that I made a function that makes new column depending on users entry in txtbox. So for example if a user enters \"

1条回答
  •  隐瞒了意图╮
    2020-12-22 12:46

    Actually Pragma can help you to get all columns name with type etc etc.PRAGMA_SQL

      PRAGMA table_info(table_name);
    

    Alternatively you may use another way like ;

    SELECT sql FROM sqlite_master
    WHERE tbl_name = 'table_name' AND type = 'table'
    

    0 讨论(0)
提交回复
热议问题