Table of Contents
晚上时,师弟yangyu说他有一个表,里面有90多个字段,需要把所有字段都列出来,如果手动一个一个复制出来的话,太麻烦了,就写了个小脚本." >晚上时,师弟yangyu说他有一个表,里面有90多个字段,需要把所有字段都列出来,如果手动一个一个复制出来的话,太麻烦了,就写了个小脚本.
Home Database Mysql Tutorial 列出指定表的所有字段

列出指定表的所有字段

Jun 07, 2016 pm 02:56 PM
list Field designation

晚上时,师弟yangyu说他有一个表,里面有90多个字段,需要把所有字段都列出来,如果手动一个一个复制出来的话,太麻烦了,就写了个小脚本. 无 /* 列出指定表的所有字段, 使用时将 SYS_TABLE 换成具体表名即可[Oracle 10g下运行通过]*/declare cursor c is select a

晚上时,师弟yangyu说他有一个表,里面有90多个字段,需要把所有字段都列出来,如果手动一个一个复制出来的话,太麻烦了,就写了个小脚本.

/*
 列出指定表的所有字段, 使用时将 SYS_TABLE 换成具体表名即可[Oracle 10g下运行通过]
*/
declare
  cursor c is 
  select a.COLUMN_NAME||' ' from user_tab_columns a
  where a.TABLE_NAME = 'SYS_TABLE';
  
  col user_tab_columns.COLUMN_NAME%type;
  cols varchar2(4000);
begin
  open c;
  loop
    fetch c into col;
    exit when c%notfound;
    cols := cols || col;
  end loop;
  close c;
  
  dbms_output.put_line(cols);
end;
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to fix missing MSVCP140D.dll issue on Windows How to fix missing MSVCP140D.dll issue on Windows Dec 22, 2023 am 10:51 AM

MSVCP140D.dll is a very important resource file. If an error occurs when running the program that MSVCP140D.dll is not specified to run on Windows, then you need to take it seriously, because if you do not handle it properly, the program will not be able to run. MSVCP140D.dll is not specified to run on Windows. Solution: Method 1: First download the msvcp140.dll file, decompress it and copy it to the corresponding system directory (the different directory addresses below correspond to different systems and cannot be mistaken) 1. For Windows95/98/Me system, copy it to the C:\Windows\System directory. 2.Window

NoSuchFieldError in Java - Solution to field not found NoSuchFieldError in Java - Solution to field not found Jun 25, 2023 am 11:33 AM

NoSuchFieldError in Java - Solution to field not found Java is a high-level programming language that is widely used in enterprise-level applications and large-scale data processing. During the development process of Java, errors such as NoSuchFieldError may occur. This error means that the JVM cannot find the required field at runtime. In this article, we will take a deeper look at NoSuchFieldError and how to resolve it. What is NoSuchFieldE

How to determine if a field is empty in PHP? How to determine if a field is empty in PHP? Mar 20, 2024 pm 03:09 PM

PHP is a scripting language widely used in website development. For developers, it is often necessary to determine whether a field is empty. In PHP, determining whether a field is empty can be achieved through some simple methods. This article will introduce how to determine whether a field is empty in PHP, and provide specific code examples for your reference. In PHP, you can usually use the empty() function or isset() function to determine whether a field is empty. Next, we introduce the usage of these two functions respectively. Use the empty() function

What does mysql field mean? What does mysql field mean? Jul 10, 2023 pm 02:14 PM

A mysql field is a column of a specific type and length in a mysql database table that is used to store data. In MySQL, each field must have a specific data type. Common data types include integers, floating point numbers, strings, dates, and times. These data types determine the data that MySQL can store in each field.

xlive.dll is not specified to run on Windows xlive.dll is not specified to run on Windows Jan 06, 2024 pm 07:29 PM

When many friends are playing games, the system suddenly prompts that the program cannot be started because xlive.dll is missing from the computer. Try reinstalling this program to solve this problem. What's going on? It's because the file is missing or not registered. Let's take a look at the specific solutions below. xlive.dll is not specified to run in Windows Solution 1. Start-Run Enter CMD, click OK or press the Enter key on the keyboard to open the administrator command prompt window. 2. Copy: for%1in(%windir%\system32\*.dll)doregsvr32.exe/s%1 command, open the administrator command prompt

How to add fields to the database table How to add fields to the database table Mar 18, 2021 pm 02:13 PM

Methods to add fields in the table: 1. Use the "ALTER TABLE table name ADD new field name data type;" statement to add fields at the end; 2. Use the "ALTER TABLE table name ADD new field name data type FIRST;" statement to add it at the beginning Field; 3. Use the "ALTER TABLE table name ADD new field name data type [constraints] AFTER existing field name;" statement to add a field in the middle.

How to add fields in dedecms How to add fields in dedecms Feb 17, 2023 am 10:50 AM

How to add fields to dedecms: 1. Enter the dedecms backend and find the "Common Article Model" in "Core-Channel Model"; 2. Click "Field Management" to enter the field management interface and click Add New Field; 3. Add a new field In the field interface, just fill in the form prompt text, field name and other information in sequence.

How to use Vue form processing to hide and display elements of form fields How to use Vue form processing to hide and display elements of form fields Aug 10, 2023 pm 07:51 PM

How to use Vue form processing to hide and display elements of form fields Introduction: In front-end development, processing forms is a common and important task. Sometimes we need to hide and display form field elements based on user selection or other conditions. It is very simple to implement this function in Vue. This article will introduce how to use Vue form processing to hide and display elements of form fields, and attach code examples for reference. 1. Use the v-if instruction to hide and display the v-if instruction in Vue according to

See all articles