Retrieving Information from LNP Database Fields

The LNP database is in table format. Following are the characteristics of the table rows and columns:

  1. Start the mysql command-line utility on the query server using the following command:

    # cd /opt/mysql/mysql/bin

    # mysql -u root -p

    Enter password:

    <Query Server’s MySQL user root password>

  2. List the names of the databases on the query server using the following command:

    mysql> SHOWDATABASES;
    mysql> SHOW DATABASES;
    +-----------+
    | Database  |
    +-----------+
    | ResyncDB  |
    | WesternDB |
    | mysql     |
    | supDB     |
    +-----------+
    4 rows in set (0.09 sec)
    

  3. Select the name of the database that contains tables from which you want to retrieve information using the following command:

    mysql> USE <database>;

    where <database> is one of the following: supDB, CanadaDB, MidAtlanticDB, MidwestDB, NortheastDB, SoutheastDB, SouthwestDB, WestCoastDB, WesternDB

    mysql> USE WesternDB
    Database changed
    

  4. List the names of the tables in the selected database using the following command:

    mysql> SHOW TABLES;
    mysql> SHOW TABLES;
    +----------------------+
    | Tables_in_WesternDB  |
    +----------------------+
    | NumberPoolBlock      |
    | ServiceProvLRN       |
    | ServiceProvNPA_NXX   |
    | ServiceProvNPA_NXX_X |
    | ServiceProvNetwork   |
    | SubscriptionVersion  |
    +----------------------+
    6 rows in set (0.01 sec)
    

  5. Retrieve column and field information of a database table using the following command:

    mysql> DESCRIBE <table>;

    where <table> is the name of the database table from the list of tables displayed in 4

    mysql> describe SubscriptionVersion;
    
    Field                Type                Null Key Default      Extra 
    --------------------------------------------------------------------                  
    versionId            int(11)             NO   PRI
    tn                   char(10)            NO   UNI     
    lrn                  char(10)            NO   MUL     
    newCurrentSp         char(4)             NO   MUL 0000 
    activationTimestamp  char(14)            NO       00000000000000      classDPC             char(9)             NO   
    classSSN             char(3)             NO
    lidbDPC              char(9)             NO
    lidbSSN              char(3)             NO
    isvmDPC              char(9)             NO
    isvmSSN              char(3)             NO
    cnamDPC              char(9)             NO
    cnamSSN              char(3)             NO
    endUserLocationValue char(12)            NO
    endUserLocationType  char(2)             NO
    billingId            char(4)             NO
    lnpType              tinyint(3) unsigned NO       0 
    downloadReason       tinyint(3) unsigned NO       0         
    wsmscDPC             char(9)             NO 
    wsmscSSN             char(3)             NO 
    svType               tinyint(4)          NO       -1 
    alternativeSPID      char(4)             NO
    
    22 rows in set (0.00 sec)