ewdb_api_DeleteSMMessage()

Prototype: |
int ewdb_api_DeleteSMMessage( | EWDBid idSMMessage);
Source File: | ewdb_api_DeleteSMMessage.c
Description: | This function dissassociates a strong motion message with any Events, and then deletes the message.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_SUCCESS | Success.
EWDB_RETURN_FAILURE | Failure. See logfile for details.
PARAMETER INFO
Parameter | Type | Description
idSMMessage | EWDBid | The DB id of the message that the caller wishes to delete.
Group: | EWDB_API_LIB
Sub Group: | STRONG_MOTION_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_GetSMData()

Prototype: |
int ewdb_api_GetSMData( | EWDB_CriteriaStruct * pcsCriteria, char * szSta, char * szComp, char * szNet, char * szLoc, EWDBid idEvent, int iEventAssocFlag, SM_INFO * pSMI, int BufferRecLen, int * pNumRecordsFound, int * pNumRecordsRetrieved);
Source File: | ewdb_api_GetSMData.c
Description: | This function retrieves strong motion messages from the DB that meet the criteria given by the caller.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_SUCCESS | Success.
EWDB_RETURN_FAILURE | Failure. See logfile for details.
EWDB_RETURN_WARNING | Partial Success. The function successfully executed, but either 1)the caller's buffer wasn't large enough to retrieve all of the messages, and/or 2) there was a problem retrieving one or more of the messages. If the value written to pNumRecordsFound at the completion of the function is greater than the iBufferRecLen parameter passed to the function, then more records were found than the caller's buffer could hold. If the value written to pNumRecordsRetrieved is less than the iBufferRecLen parameter passed to the function, then the function failed to retrieve atleast one of the messages that it found.
PARAMETER INFO
Parameter | Type | Description
pcsCriteria | EWDB_CriteriaStruct * | The criteria struct for specifying criteria types and values for the query to retrieve messages. pcsCriteria->Criteria, contains the flags which indicate which criteria to use in searching for messages. NOTE: The Depth criteria is not supported by this function! See EWDB_CriteriaStruct for more detail on criteria.
szSta | char * | The Station name criteria for retrieving messages. This param is only used for criteria if pcsCriteria->Criteria includes the EWDB_CRITERIA_USE_SCNL flag. '*' may be used as a wildcard. This param must always be a valid pointer, the function may fail if it is set to NULL.
szComp | char * | The Component name criteria for retrieving messages. This param is only used for criteria if pcsCriteria->Criteria includes the EWDB_CRITERIA_USE_SCNL flag. '*' may be used as a wildcard. This param must always be a valid pointer, the function may fail if it is set to NULL.
szNet | char * | The Network name criteria for retrieving messages. This param is only used for criteria if pcsCriteria->Criteria includes the EWDB_CRITERIA_USE_SCNL flag. '*' may be used as a wildcard. This param must always be a valid pointer, the function may fail if it is set to NULL.
szLoc | char * | The Location name criteria for retrieving messages. This param is only used for criteria if pcsCriteria->Criteria includes the EWDB_CRITERIA_USE_SCNL flag. '*' may be used as a wildcard. This param must always be a valid pointer, the function may fail if it is set to NULL.
idEvent | EWDBid | The Event criteria for retrieving messages. This param is only used for criteria if pcsCriteria->Criteria includes the EWDB_CRITERIA_USE_IDEVENT flag. This param must be set to a valid(existing) idEvent, if pcsCriteria->Criteria includes the EWDB_CRITERIA_USE_IDEVENT flag, or the function will fail.
iEventAssocFlag | int | A flag indicating how the function should retrieve strong motion messages with respect to event association. If pcsCriteria->Criteria includes the EWDB_CRITERIA_USE_IDEVENT flag, then this parameter is ignored; otherwise, if this parameter is set to EWDB_SM_SEARCH_FOR_ALL_SMMESSAGES, then all messages meeting the criteria will be retrieved, otherwise if this param is set to EWDB_SM_SEARCH_FOR_ALL_UNASSOCIATED_MESSAGES, then only messages (meeting the criteria) that are NOT associated with an event, will be retrieved.
pSMI | SM_INFO * | A buffer allocated by the caller, where the function will place the retrieved messages.
BufferRecLen | int | The length of the buffer(pBuffer) in terms of SM_INFO records.
pNumRecordsFound | int * | A pointer to an int where the function will write the number of messages found to meet the given criteria. NOTE: The number found is not the number retrieved and written to the caller's buffer. That is NumRecordsRetrieved. If the number of messages found is greater than the caller's buffer will hold, then the function will return a warning.
pNumRecordsRetrieved | int * | A pointer to an int where the function will write the number of messages actualy retrieved by the function. This number will be less than or equal to the number found.
Group: | EWDB_API_LIB
Sub Group: | STRONG_MOTION_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_GetSMDataWithChannelInfo()

Prototype: |
int ewdb_api_GetSMDataWithChannelInfo( | EWDB_CriteriaStruct * pcsCriteria, char * szSta, char * szComp, char * szNet, char * szLoc, EWDBid idEvent, int iEventAssocFlag, EWDB_SMChanAllStruct * pSMCAS, int BufferRecLen, int * pNumRecordsFound, int * pNumRecordsRetrieved);
Source File: | ewdb_api_GetSMDataWithChannelInfo.c
Description: | This function retrieves strong motion messages and associated info from the DB, for all messages that meet the criteria given by the caller. This function retrieves the strong motion messages and Channel and Event association information for each message.
Note: | This function is the same as ewdb_api_GetSMData(), except where noted above. Please see ewdb_api_GetSMData() for better documentation on each of the parameters.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_SUCCESS | Success.
EWDB_RETURN_FAILURE | Failure. See logfile for details.
EWDB_RETURN_WARNING | Partial Success. See ewdb_api_GetSMData().
PARAMETER INFO
Parameter | Type | Description
pcsCriteria | EWDB_CriteriaStruct * |
szSta | char * |
szComp | char * |
szNet | char * |
szLoc | char * |
idEvent | EWDBid |
iEventAssocFlag | int |
pSMCAS | EWDB_SMChanAllStruct * | A buffer allocated by the caller, where the function will place the retrieved messages.
BufferRecLen | int |
pNumRecordsFound | int * |
pNumRecordsRetrieved | int * |
Group: | EWDB_API_LIB
Sub Group: | STRONG_MOTION_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h

ewdb_api_PutSMMessage()

Prototype: |
int ewdb_api_PutSMMessage( | SM_INFO * pMessage, EWDBid idEvent);
Source File: | ewdb_api_PutSMMessage.c
Description: | This function stores a strong motion message in the DB and returns the idSMMessage of the new record. If idEvent is a positive number, then the function will attempt to bind the new SMMessage to the Event identified by idEvent.
Note: | Be sure to properly initialize idEvent. If a seemingly valid idEvent is passed, and no such Event exists, the function will fail, even though it can create the SMMessage without problems. If you do not have an idEvent, but have an author and an author's EventID, then you can use ewdb_api_CreateEvent() to get an idEvent from an author and author's EventID.
RETURN CODE INFO
Return Type: | int
Return Value | Description
EWDB_RETURN_SUCCESS | Success.
EWDB_RETURN_FAILURE | Failure. See logfile for details.
EWDB_RETURN_WARNING | Warning. The message was not inserted because the DB had no record of the channel or else the Lat/Lon of the component from which the channel came. The channel check is done based on the SCNL from the message. See the logfile for the contents of the message, and for more info on why the message was not inserted.
PARAMETER INFO
Parameter | Type | Description
pMessage | SM_INFO * | A pointer to a RW_STRONGMOTIONII message (in SM_INFO form), that the caller wishes to insert into the EW DBMS.
idEvent | EWDBid | DB Identifier of the event(that already exists in the DB) that this strong motion message should be associated with. The caller should set idEvent to 0 if they do not want this message associated with an Event.
Group: | EWDB_API_LIB
Sub Group: | STRONG_MOTION_API
Language: | C
Location: | ./src/oracle/schema-working/src/include/ewdb_ora_api.h