TDM Windows Application Programming Interface 5.5

From ICISWiki

Jump to: navigation, search

Contents

ICIS32 DLL 5.5

Modifications

  • All functions that get the next available primary key are modified. The next ID is now always retrieved from the database.
  • For SQLSTATE = 23000 (Unique Constraint Violation when a record is being added), no error message is shown. The add functions will continually call the getNextID and execute the INSERT statement until it succeeds or the 100 attempts are reached. It is assumed that only the primary keys (GID, NID etc) has the unique constraint or else the statements that trap the error is not anymore applicable.
  • The above changes are done for multi-access of the database. The ICIS.INI should have AUTOCOMMIT=YES in [SETGEN] section for multiple accesses of the database by several users.

[DLL SETTINGS] section of the ICIS.INI

  • SHOW_PREFID - not mandatory; set to YES if the prefered ID (NSTAT=8) needs to be shown with the Preferred Name;

SHOW_PREFID=YES

New Return Value by DLL function

GMS_UNIQUE_CONSTRAINT = -12 //unique constraint violation
GMS_INVALID_DATA=-11,

New Functions

GMS_hasCIDSID

GMS_hasCIDSID will determine if there are SID and CID fields in the GERMPLSM table. It will return GMS_SUCCESS (1) if those fields are present, otherwise it will return GMS_NO_DATA (0)
Syntax
long GMS_hasCIDSID No arguments, No returns
Returns

GMS_SUCCESS, GMS_NO_DATA

GMS_addUDField

GMS_addUDField adds one record to the local UDFLDS table.

Syntax

long GMS_addUDField (data,szDesc, nszDesc)

Arguments
Argument Type Use Description
data GMS_UDField * Input/output Address of a GMS_UDField structure
szDesc char * Input Description of the user defined field
nszDesc long * Input length of the description string
Returns

GMS_SUCCESS, GMS_ERROR

GMS_deleteProgenitorID

GMS_deleteProgenitorID deletes the progenitors of a germplasm in the PROGENITORS table of the local GMS database.

Syntax

long GMS_deleteProgenitorID(gid)

Arguments
Argument Type Use Description
gid long input GID of germplasm for which progenitors have to be deleted
Returns

GMS_SUCCESS, GMS_ERROR

Comments

This function deletes all progenitors of a germplasm from the local database. If gid is positive the function returns GMS_ERROR. Only user with access right greater than 30 is allowed to delete the progenitors.


GMS_deleteOneProgenitor

GMS_deleteOneProgenitor deletes a progenitor of a germplasm in the PROGENITORS table of the local GMS database.

Syntax

long GMS_deleteOneProgenitor(gid, pid)

Arguments
Argument Type Use Description
gid long input GID of germplasm for which progenitors have to be deleted
pid long input the progenitor's GID
Returns

GMS_SUCCESS, GMS_ERROR

Comments

This function deletes only one progenitor of a germplasm from the local database. If gid is positive the function returns GMS_ERROR. The function only allows user with access right greater than 30 to delete a progenitor.


GMS_getNextSequence

GMS_getNextSequence function gets the next sequence number of name type with the specified prefix.

Syntax

long GMS_getNextSequence(ntype, szPrefix, nextSequence)

Arguments
Argument Type Use Description
ntype long input the name type (which is the corresponding FLDNO from the UDFLDS table)
szPrefix char * input Addess of null terminated string which contains the prefix term
nextSequence long output the next number in the sequence
Returns

GMS_SUCCESS, GMS_NO_DATA, GMS_ERROR

GMS_getNextName

GMS_getNextName function provides the next name of a name type having the specified prefix.

Syntax

long GMS_getNextName(ntype, szPrefix, szNextName)

Arguments
Argument Type Use Description
ntype long input the name type (which is the corresponding FLDNO from the UDFLDS table)
szPrefix char * input Addess of null terminated string which contains the prefix term
szNextName char * output Address of NULL terminated string to place the next name.
Returns

GMS_SUCCESS, GMS_NO_DATA, GMS_ERROR

DMS_deleteDataset

DMS_deleteDataset deletes a dataset of a study. The dataset corresponds to a representation of observations. The records in the OINDEX, EFFECT, VEFFECT, DATA_C and DATA_N of the specified representation are deleted. But the information about the factors, levels and variates are not affected.

Syntax

long GMS_deleteDataset(represno)

Arguments
Argument Type Use Description
represno Long input the representation number of the dataset
Returns

GMS_SUCCESS, GMS_ERROR

DMS_setRepresName

DMS_setRepresName changes the name of a dataset or representation in a study stored in the local database

Syntax

long DMS_setRepresName(represNo,szName)

Arguments
Argument Type Use Description
represNo long input the representation number of the dataset.
szName Char * input Address of NULL terminated string to place the name. It's size should not exceed 150.
Returns

GMS_SUCCESS, GMS_ERROR


DMS_getRepresName

DMS_getRepresName retrieves the name of a dataset or representation

Syntax

long DMS_getRepresName(represNo,szName)

Arguments
Argument Type Use Description
represNo long input the representation number of the dataset.
szName Char * input Address of NULL terminated string to place the name. It's size should not exceed 150.
Returns

GMS_SUCCESS, GMS_ERROR

DMS_setEffectName

DMS_setEffectName changes the name of an effect of a study stored in the local database

Syntax

long DMS_setEffectName(effectID,szName)

Arguments
Argument Type Use Description
effectID long input the id of an effect to which the name should be set
szName Char * input Address of NULL terminated string to place the name. It's size should not exceed 150.
Returns

DMS_SUCCESS, DMS_ERROR



SUP_addPerson

SUP_addPerson adds record of a person, collaborator or scientist to the local PERSONS table.

Syntax

long SUP_addPerson (data)

Arguments
Argument Type Use Description
data SUP_PERSONS * Input Address of a SUP_PERSONS structure
Returns

GMS_SUCCESS, GMS_ERROR


SUP_addInstitute

SUP_addInstitute adds record of an institute to the local INSTITUT table.

Syntax

long SUP_addInstitute (data)

Arguments
Argument Type Use Description
data SUP_INSTITUTE * Input Address of a SUP_INSTITUTE structure
Returns

GMS_SUCCESS, GMS_ERROR


SUP_getPerson

SUP_getPerson retrieves details of a person from the PERSONS table. The first argument of SUP_getPerson is a pointer to a SUP_PERSONS structure. If the PERSONID element is not zero when the function is called then the details for the corresponding PERSONID are retrieved. If it is zero then the function returns details for the first record if fOpt = FIND_FIRST or for the next available record if fOpt = FIND_NEXT. Any call which fails to find a person information returns DMS_NO_DATA.

Syntax

long SUP_getPerson(data, fOpt)

Arguments
Argument Type Use Description
data SUP_PERSONS* input/
output
Address of a SUP_PERSONS structure to contain persons details
fOpt Long input Either FIND_FIRST or FIND_NEXT
Returns

DMS_SUCCESS, DMS_ERROR, DMS_NO_DATA

Comments

If the function is called and there was a problem accessing the database, the function will return DMS_ERROR.

SUP_getInstittutePrnt

SUP_getInstitutePrnt retrieves details of an institute from the INSTITUT table. It can retrieve institutes under a specific parent institute (PINSID) or all institutes in the table. The first argument of SUP_getInstitutePrnt is a pointer to a SUP_INSTITUTE structure. If the PINSID element is not zero when the function is called then, it retrieves details of the institutes under that parent institute. If PINSID = 0, it retrieves all institutes. If fOpt = FIND_FIRST (0), the function returns details for the first record. If fOpt = FIND_NEXT, the next available record is returned . Any call which fails to find a institute information returns DMS_NO_DATA.

Syntax

long SUP_getInstitutePrnt(data, fOpt)

Arguments
Argument Type Use Description
data SUP_INSTITTUTE* input/
output
Address of a SUP_INSTITUTE structure to contain institute details
fOpt Long input Either FIND_FIRST or FIND_NEXT
Returns

DMS_SUCCESS, DMS_ERROR, DMS_NO_DATA

Comments

If the function is called and there was a problem accessing the database, the function will return DMS_ERROR.

Modified Functions

GMS_findAttribute

- recognizes wild card characters

GMS_listName

- It looks for PreferredID (NSTAT=8) if there is no Preferred Name (NSTAT=1).

GMS_getGermplasm2

- It looks for PreferredID (NSTAT=8) if there is no Preferred Name (NSTAT=1). - It includes the PreferredID with the Preferred Name if SHOW_PREFID=YES in the INI Key

All GMS_add functions

- Reiterates adding the record until there is no Unique Constraint Error or it reaches 100 iteration.

getConsData

-SQL for mySQL/PostGres was corrected

getOunitData

-SQL for mySQL/PostGres was corrected

getPFLevel

-SQL for mySQL/PostGres was corrected

ICIS32.DLL 5.4

Personal tools