6 43 LceInsert

LANSA Open Guide

6.43 LceInsert

Inserts a record into the specified file, using the values contained in the fields.

BOOL

LceInsert

(int

iSession,

 

 

 char far *

strFieldList,

 

 

 char far *

strFileName

 

 

 BOOL

fValidate )

  

Parameters

iSession

The session identifier as returned by LceGetSessionId.

strFieldList

A list of fields to be inserted when the record is added. Each field must have been declared using an LceUseField function.

strFileName

The name of the file. This file must have been previously declared using an LceUseFile function.

fValidate

This parameter provides a "check but do not insert" facility.

True = Perform validate only.

False = Perform insert immediately. 

  

Return Values

TRUE is returned if the session can insert or has inserted the record.

FALSE is returned if an error occurs.

Notes

Only the fields specified in the field list will be inserted into the file. Other fields will have their default values assigned, provided the default values are set in the LANSA Repository.

  • This function may only be executed after a session has been opened.

Tip

If you record the appropriate validation rules in the LANSA Repository, LANSA will perform referential integrity checks when inserting new records. For example, LANSA can check that a customer record exists in the customer file before attempting to insert a new order record for that customer in the order file.

Related Functions

6.71 LceUseFile

6.58 LceSetFieldValue

6.59 LceSetFieldValueU

6.67 LceUnicodeToHex

6.10 LceDelete

6.8 LceCheckFor