VI. Tóm tắt câc hăm
CHƯƠNG XI I: ÂNH XẠ KIỂU DỮ LIỆU OCI VĂ CÂC HĂM THAO TÂC I.Giới thiệu
I.Giới thiệu
Chương năy giới thiệu câc hăm ânh xạ datatype OCI vă câc hăm thao tâc. Xem thím chương 9
II.Câc hăm ânh xạ datatype vă câc hăm thao tâc
Câc hăm ânh xạ vă câc hăm thao tâc trả về một trong câc giâ trị sau :
Table 15-1 Common Navigational Function Return Values
Return Value Meaning
OCI_SUCCESS The operation succeeded
OCI_ERROR The operation failed. The specific error can be retrieved by calling OCIErrorGet() on the error handle passed to the function.
OCI_INVALID_HANDLE The environment or error handle passed to the function is NULL.
Một số hăm trả về câc giâ trị khâc trong bảng 15-1 . Khi sử dụng những hăm năy phải có một nơi chứa để trả về một giâ trị trực tiếp từ lời gọi hăm hơn lă thông qua một tham số OUT .
• OCICollMax() • OCIRawPtr() • OCIRawSize() • OCIRefHexSize() • OCIRefIsEqual() • OCIRefIsNull() • OCIStringPtr() • OCIStringSize()
III.Giới thiệu câc hăm
Table 15-2 OCI Datatype Mapping and Manipulation Functions Quick Reference
Function Purpose
COLLECTION ITERATOR FUNCTIONS OCICollAppend() Collection append element
OCICollAssignElem() Collection assign element OCICollAssign() Assign collection
OCICollSize() get current size of collection (in number of elements) OCICollTrim() trim elements from the collection
OCICollGetElem() get pointer to an element
OCICollMax() return maximum number of elements in collection OCIIterCreate() Create ITerator to scan the varray elements OCIIterGetCurrent() get CURrent collection element
OCIIterDelete() Delete ITerator
OCIIterInit() Initialize ITerator to scan the given collection OCIIterNext() get NeXT collection element
OCIIterPrev() get PReVious collection element, DATE FUNCTIONS
OCIDateToText() convert date TO String OCIDateAddDays() ADd or subtract Days OCIDateAddMonths() ADd or subtract Months
OCIDateDaysBetween() get number of days BeTWeen two dates OCIDateCheck() CHecK if the given date is valid
OCIDateCompare() CoMPare dates
OCIDateLastDay() get date of LaST day of month OCIDateNextDay() get date of Next DaY
OCIDateFromText () convert String TO Date
OCIDateSysDate() get current SYStem date and time
OCIDateZoneToZone() convert date from one time Zone TO another Zone OCIDateAssign() assign date
OCIDateGetDate() get the date portion of a date OCIDateGetTime() get the time portion of a date OCIDateSetDate() set the date portion of a date OCIDateSetTime() set the time portion of a date
NUMBER FUNCTIONS OCINumberToInt() convert number TO Integer OCINumberToReal() convert number TO Real OCINumberToText() convert number TO String OCINumberAbs() ABSolute value
OCINumberArcCos() Arc COSine OCINumberAdd() ADD numbers OCINumberAssign() ASsiGn number OCINumberArcSin () Arc SINe OCINumberArcTan() Arc TANgent OCINumberArcTan2() Arc TaNgent 2
GVHD :KS.Bùi Hoăi Thắng
OCINumberCeil() CEiling of number OCINumberCmp() CoMPare numbers
OCINumberCos() COSine
OCINumberHypCos() CoSine Hyperbolic OCINumberDiv() DIVide numbers
OCINumberPower() EXPonentiation to base e OCINumberFloor() FLooR of number
OCINumberFromInt() convert Integer TO Number OCINumberIsZero() comparison with ZERo OCINumberLn() Logarithm Natural
OCINumberLog () LOGarithm to arbitrary base OCINumberMod() MODulo division
OCINumberMul() MULtiply numbers OCINumberNeg() NEGate number
OCINumberIntPower() take an arbitrary base to an arbitrary integer PoWeR OCINumberFromReal() convert Real TO Number
OCINumberRound() ROUnd Oracle number to a specified decimal place OCINumberSetZero() INItialize number to zero
OCINumberFromText() convert String TO Number
OCINumberSign() obtains SiGN of an Oracle number
OCINumberSin() SINe
OCINumberHypSin() SiNe Hyperbolic
OCINumberSqrt() SQuare Root of number OCINumberSub() SUBtract numbers
OCINumberTan() tANgent
OCINumberHypTan() TaNgent Hyperbolic
OCINumberTrunc() TRUncate an Oracle number at a specified decimal place REF FUNCTIONS
OCIRefToHex() convert REF to Hexadecimal string OCIRefAssign() ASsiGn one REF to another
OCIRefClear() CLeaR or nullify a REF
OCIRefIsEqual() compare two REFs for EQUality OCIRefFromHex() convert Hexadecimal string to REF OCIRefHexSize() return size of hexadecimal representation OCIRefIsNull() test if a REF is NULl
TABLE FUNCTIONS OCITableDelete() DELete element
OCITableExists() Test whether element EXIsts OCITableFirst() return FirST index of table
OCITableLast() return LaST index of table
OCITableNext() return NeXT available index of table OCITablePrev() return PReVious available index of table OCITableSize() return current size of table
STRING FUNCTIONS OCIStringAssign() Assign String to String
OCIStringAllocSize() get Allocated SiZe of string memory in bytes OCIStringAssignText() Assign Text string to String
OCIStringPtr() Get String Pointer OCIStringSize() Get String siZe
OCIStringResize() ReSiZe string memory RAW FUNCTIONS OCIRawAssignBytes() Assign raw Bytes to Raw OCIRawAssignRaw() Assign Raw to Raw
OCIRawAllocSize() Get Allocated SiZe of raw memory in bytes OCIRawPtr() Get Raw data Pointer
OCIRawSize() Get Raw siZe
OCIRawResize() ReSiZe memory of variable-length raw