IBM Books

Administrative API Reference

sqlecran - Create Database at Node

Creates a database only on the node that calls the API. This API is not intended for general use. For example, it should be used with sqlurestore - Restore Database if the database partition at a node was damaged and must be recreated. Improper use of this API can cause inconsistencies in the system, so it should only be used with caution.
Note:If this API is used to recreate a database partition that was dropped (because it was damaged), the database at this node will be in the restore-pending state. After recreating the database partition, the database must immediately be restored on this node.

Scope

This API only affects the node on which it is called.

Authorization

One of the following:

Required Connection

Instance. To create a database at another node, it is necessary to first attach to that node. A database connection is temporarily established by this API during processing.

Version

sqlenv.h

C API Syntax



/* File: sqlenv.h */
/* API: Create Database at Node */
/* ... */
SQL_API_RC SQL_API_FN
  sqlecran (
    char * pDbName,
    void * pReserved,
    struct sqlca * pSqlca);
/* ... */
 

Generic API Syntax



/* File: sqlenv.h */
/* API: Create Database at Node */
/* ... */
SQL_API_RC SQL_API_FN
  sqlgcran (
    unsigned short reservedLen,
    unsigned short dbNameLen,
    struct sqlca * pSqlca,
    void * pReserved,
    char * pDbName);
/* ... */
 

API Parameters

reservedLen
Input. Reserved for the length of pReserved.

dbNameLen
Input. A 2-byte unsigned integer representing the length of the database name in bytes.

pSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.

pReserved
Input. A spare pointer that is set to null or points to zero. Reserved for future use.

pDbName
Input. A string containing the name of the database to be created. Must not be NULL.

REXX API Syntax

This API can be called from REXX through the SQLDB2 interface. See How the API Descriptions are Organized, or the Application Development Guide. For a description of the syntax, see the Command Reference.

Usage Notes

When the database is successfully created, it is placed in restore-pending state. The database must be restored on this node before it can be used.

See Also

sqlecrea - Create Database

sqledpan - Drop Database at Node.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]