Check if a Checkbox is Checked in jQuery

AmitDiwan
Updated on 14-Sep-2020 06:34:44

328 Views

To check whether a checkbox is checked in jQuery, use the concept of toggle(). Following is the code −Example Live Demo Document Your name is Adam Smith    $('#selectName').click(function() {       $("#txtName").toggle(this.checked);    }); To run the above program, just save the file name anyName.html(index.html) and right click on the file and select the option open with live server in VS Code editor.OutputThis will produce the following output −When you select the check box, the following will be the output −

Display in Console if Select List Value Contains a Value from an Array in JavaScript

AmitDiwan
Updated on 14-Sep-2020 06:30:59

659 Views

Let’s say the following is our dropdown −    John    David    Chris    Mike    Bob    Carol Following is our array −var listOfNames = ["Chris", "Robert", "Mike"];To check whether the selected list value contains a value in array, use −$(‘select’).on(‘change’).Example Live Demo Document John David Chris Mike Bob Carol    var listOfNames = ["Chris", "Robert", "Mike"];    $('select').on('change', function() {       var name = this.value.split(' ')[0];       if($.inArray(name, listOfNames) > -1) {          console.log('This is present in list ... Read More

Start Specific Tablespace Within DB2 Database

Mandalika
Updated on 12-Sep-2020 16:22:37

160 Views

To start a specific tablespace within a DB2 database we can use below panel command.START DATABASE (DSNDB01) SPACENAM(TABSPAC1)Using the START DATABASE command, we can also start database and indexspace.

Display Components of DB2 Database dsndb01 and Their Status

Mandalika
Updated on 12-Sep-2020 16:21:26

138 Views

A database contains multiple components like tablespace, indexspace, index, tables, etc. We can find out all the components within the database using the below panel command.DIS DB(DSNDB01)

Calculate DB2 Database Size Using DB2 Utility and Other Methods

Mandalika
Updated on 12-Sep-2020 16:17:53

753 Views

There are multiple ways in which we can estimate the size of the DB2 database. Few of them are listed below−By using inbuilt get_dbsize_info function.By using DB2 active transaction logs.The size of the dataset which was used with UNLOAD utility can be checked.Table/Index dataUsing STOSPACE utility in JCL as below//STEP1 EXEC DSNUPROC //SYSIN DD * STOSPACE DATABASE DSNDB01 //*

Repair Pending State of an Index (idx1)

Mandalika
Updated on 12-Sep-2020 16:16:08

482 Views

The pending state is set when the image copy is required for the table space or when the INDEX is in rebuild status. In this case a COPY PENDING/ REBUILD PENDING flag is set. We can repair this state by using the below JCL step.//STEP010 EXEC DSNUPROC REPAIR SET INDEX IDX1 NORBDPENDThis utility can also be used to repair the tablespace. For this we can use the REPAIR SET TABLESPACE statement. This is followed by the name of index or tablespace.

Reorganize DB2 Tablespace Tabspac1 to Reclaim Fragmented Space

Mandalika
Updated on 12-Sep-2020 15:23:19

511 Views

The tablespace reorganization is used to reorganize the data present in the system in order to reclaim the free space. This free space can be utilized to store the new data and therefore reorganization is very useful from a memory utilization point of view. We can reorganize any tablespace using DB2 REORG utility in JCL step as below.//STEP1 EXEC DSNUPROC,UID='IUJLU101.REORG', //UTPRINT DD SYSOUT=* //SYSIN DD * REORG TABLESPACE (DBSET1.TABSPAC1) //*The REORG TABLESPACE statement is followed by the name of the tablespace which needs to be reorganized qualified by dabasebase.

Updating and Sampling of Catalog Statistics for DB2 Tablespace

Mandalika
Updated on 12-Sep-2020 15:14:21

246 Views

The DB2 RUNSTAT utility records the details of tablespace, table, index, etc in the system catalog. The RUNSTAT generates the data like space available in table space, indexes, access paths, etc. We can use the below JCL step to update the catalog statistics of DB2 tablespace TABSPAC2 and to sample 25% of the rows.//STEP1 EXEC DSNUPROC //UTPRINT DD SYSOUT=* //SYSIN DD * RUNSTATS TABLESPACE DBSET1.TABSPAC1    TABLE(ALL) SAMPLE 25    INDEX(ALL)The SYSIN parameter can be used with RUNSTATS TABLESPACE statement followed by tablespace name qualified by database name.

Start DB2 Database DSNDB001 Using Command Panel

Mandalika
Updated on 12-Sep-2020 15:02:20

139 Views

We can start the DB2 database by giving below command in panelDB2 ACTIVATE DSNDB001The DB2 ACTIVATE is followed by the name of the database which needs to be started.

Recover DB2 Table Space TABSPC1 Using Image Copy to Last Copy

Mandalika
Updated on 12-Sep-2020 14:57:10

688 Views

The DB2 provides an utility RECOVER which is used to restore the tablespace. This utility uses image copy and DB2 logs to restore the changes. The following command can be used to recover the tablespace to the last image copy that was taken.RECOVER TABLESPACE DBSET1.TABSPAC1 TOLASTCOPYThe RECOVER TABLESPACE is followed by the name of tablespace qualified by the database in which it resides. The TOLASTCOPY parameter will restore the image copy in the following way. If the most recent image copy is full image copy, then the full image copy is restored in the tablespace. If the most recent image ... Read More

Advertisements