SELECTING A LOB COLUMN INTO A Long Buffer Using A Simple Fetch
The Following Example Illustrate Selecting a Lob Column Using A Simple Fetch:
Void Simple_Fetch ()
{
Word I, BUF1 = 0;
Word RetVal;
Text BUF [15000];
Text * SELSTMT = (Text *) "SELECT Ad_SourceText from Print_Media Where Product_ID = 2004";
OCISTMTPREPARE (stmthp, erromt, (ub4) strlen ((char *) SELSTMT,
(UB4) OCI_NTV_SYNTAX, (UB4) OCI_DEFAULT;
RetVal = OCISTMTEXECUTE (SVCHP, STMTHP, Errhp, (UB4) 0, (UB4) 0,
(const obscisnapshot *) 0, (ocisnapshot *) 0,
(UB4) OCI_DEFAULT;
While (retval == oci_success || retval == oci_success_with_info)
{
OcidefineBypos (Stmthp, & Defhp [1], Errhp, (UB4) 2, (DVOID *) BUF,
(SB4) SIZEOF (BUF1), (UB2) SQLT_CHR, (DVOID *) 0,
(Ub2 *) 0, (Ub2 *) 0, (UB4) OCI_Default);
Retval = OCISTMTFETCH (stmthp, errhp, (ub4) 1,
(UB4) OCI_FETCH_NEXT, (UB4) OCI_DEFAULT;
IF (retval == oci_success || retval == oci_success_with_info)
Discard printf ("buf =%. * S / n", buf2);
}
}