DBD-ODBC

 view release on metacpan or  search on metacpan

ODBC.xs  view on Meta::CPAN

      AV *ds = dbd_data_sources( drh );
      ST(0) = sv_2mortal( newRV_noinc( (SV*)ds ) );
    }


MODULE = DBD::ODBC    PACKAGE = DBD::ODBC::st

void odbc_describe_param(sth, param)
    SV * sth
    SV * param
    PPCODE:
    D_imp_sth(sth);
    D_imp_xxh(sth);
    SQLRETURN rc;
    SQLSMALLINT data_type;
    SQLULEN size;
    SQLSMALLINT dd;
    SQLSMALLINT nullable;

    rc = SQLDescribeParam(imp_sth->hstmt, SvIV(param), &data_type, &size, &dd, &nullable);
    if (SQL_SUCCEEDED(rc)) {

ODBC.xs  view on Meta::CPAN

	if (ret == 0)
	    XST_mPV(0, "0E0");
    else if (ret < -1)	/* Error */
        XST_mUNDEF(0);
    else
       XST_mIV(0, ret);

void odbc_getdiagrec(sth, record)
    SV * sth
    unsigned short record
    PPCODE:
    SQLINTEGER native;
    SQLCHAR state[10];
    SQLCHAR msg[256];
    SQLRETURN rc;
    SQLSMALLINT msg_len;
	D_imp_sth(sth);
    D_imp_xxh(sth);

    rc = SQLGetDiagRec(SQL_HANDLE_STMT, imp_sth->hstmt, record,
                       state, &native, msg, sizeof(msg), &msg_len);

ODBC.xs  view on Meta::CPAN

      DBIh_SET_ERR_CHAR(
                sth, imp_xxh, Nullch, 1,
                "SQLGetDiagField failed",
                "IM008", Nullch);
    }

void odbc_getdiagfield(sth, record, identifier)
    SV * sth
    unsigned short record
    int identifier
    PPCODE:
    SQLCHAR buf[256];
    SQLSMALLINT buf_len;
    SQLLEN len_type = 0;
    SQLINTEGER int_type = 0;
    SQLRETURN ret_type = 0;
    SQLPOINTER info_ptr;
    SQLRETURN rc;
	D_imp_sth(sth);
    D_imp_xxh(sth);

ODBC.xs  view on Meta::CPAN


    CODE:
    ST(0) = dbd_st_statistics(dbh, sth, catalog, schema, table,
                              unique, quick) ? &PL_sv_yes : &PL_sv_no;

 #void
 #DescribeCol(sth, colno)
 #	SV *sth
 #	int colno
 #
 #	PPCODE:
 #
 #	char ColumnName[SQL_MAX_COLUMN_NAME_LEN];
 #	I16 NameLength;
 #	I16 DataType;
 #	U32 ColumnSize;
 #	I16 DecimalDigits;
 #	I16 Nullable;
 #	int rc;
 #
 #	rc = odbc_describe_col(sth, colno, ColumnName, sizeof(ColumnName), &NameLength,

ODBC.xs  view on Meta::CPAN

{
   /*STRLEN lna;*/
   /*char *pstmt = SvOK(stmt) ? SvPV(stmt,lna) : "";*/

   ST(0) = sv_2mortal(newSViv( dbd_db_execdirect( dbh, stmt ) ) );
}

void odbc_getdiagrec(dbh, record)
    SV * dbh
    unsigned short record
    PPCODE:
    SQLINTEGER native;
    SQLCHAR state[10];
    SQLCHAR msg[256];
    SQLRETURN rc;
    SQLSMALLINT msg_len;
	D_imp_dbh(dbh);
    D_imp_xxh(dbh);

    rc = SQLGetDiagRec(SQL_HANDLE_DBC, imp_dbh->hdbc, record,
                           state, &native, msg, sizeof(msg), &msg_len);

ODBC.xs  view on Meta::CPAN

                dbh, imp_xxh, Nullch, 1,
                "SQLGetDiagRec failed",
                "IM008", Nullch);

    }

void odbc_getdiagfield(dbh, record, identifier)
    SV * dbh
    unsigned short record
    int identifier
    PPCODE:
    SQLCHAR buf[256];
    SQLSMALLINT buf_len;
    SQLLEN len_type;
    SQLINTEGER int_type;
    SQLRETURN ret_type;
    SQLPOINTER info_ptr;
    SQLRETURN rc;
	D_imp_dbh(dbh);
    D_imp_xxh(dbh);

ODBC.xs  view on Meta::CPAN

	CODE:
	ST(0) = odbc_get_foreign_keys(dbh, sth, PK_CatalogName, PK_SchemaName, PK_TableName, FK_CatalogName, FK_SchemaName, FK_TableName) ? &PL_sv_yes : &PL_sv_no;

#
# Corresponds to ODBC 2.0.  3.0's SQL_API_ODBC3_ALL_FUNCTIONS is handled also
# scheme
void
GetFunctions(dbh, func)
	SV *	dbh
	unsigned short func
	PPCODE:
	UWORD pfExists[SQL_API_ODBC3_ALL_FUNCTIONS_SIZE];
	RETCODE rc;
	int i;
	int j;
	D_imp_dbh(dbh);
	rc = SQLGetFunctions(imp_dbh->hdbc, func, pfExists);
	if (SQL_ok(rc)) {
	   switch (func) {
	      case SQL_API_ALL_FUNCTIONS:
			for (i = 0; i < 100; i++) {



( run in 0.719 second using v1.01-cache-2.11-cpan-71847e10f99 )