SQLColumnInformation

SQLColumnInformation[conn]
returns a list of information about the columns in an SQL connection.

DetailsDetails

  • To use SQLColumnInformation, you first need to load DatabaseLink using Needs["DatabaseLink`"].
  • The following options can be given:
  • "Catalog"Nonedatabase catalog to use
    "Schema"Nonedatabase schema to use
    "ShowColumnHeadings"Falsewhether to return headings with the results

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

In[1]:=
Click for copyable input

If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the package, as described in Using the Example Databases.

Open a connection:

In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]//Short=

Get information for all columns from tables whose names start with "SA":

In[4]:=
Click for copyable input
Out[4]//TableForm=

Get information for all columns from a particular table:

In[5]:=
Click for copyable input
Out[5]//TableForm=

Here is another way:

In[6]:=
Click for copyable input
Out[6]//TableForm=

Get information for columns whose names begin with "V" from all tables:

In[7]:=
Click for copyable input
Out[7]//TableForm=

Here is another way:

In[8]:=
Click for copyable input
Out[8]//TableForm=
In[9]:=
Click for copyable input

If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the package, as described in Using the Example Databases.

New to Mathematica? Find your learning path »
Have a question? Ask support »