- 论坛徽章:
- 0
|
[b]pro*c 问题[/b]
仔细看看:
/*
* sample1.pc
*
* Prompts the user for an employee number,
* then queries the emp table for the employee's
* name, salary and commission. Uses indicator
* variables (in an indicator struct) to determine
* if the commission is NULL.
*
*/
#include <stdio.h>;
#include <string.h>;
#include <stdlib.h>;
#include <sqlda.h>;
#include <sqlcpr.h>;
/* Define constants for VARCHAR lengths. */
#define UNAME_LEN 20
#define PWD_LEN 40
/* Declare variables. No declare section is
needed if MODE=ORACLE. */
VARCHAR username[UNAME_LEN]; /* VARCHAR is an Oracle-supplied struct */
varchar password[PWD_LEN]; /* varchar can be in lower case also. */
/* Define a host structure for the output values of
a SELECT statement. */
struct
{
VARCHAR emp_name[UNAME_LEN];
float salary;
float commission;
} emprec;
/* Define an indicator struct to correspond
to the host output struct. */
struct
{
short emp_name_ind;
short sal_ind;
short comm_ind;
} emprec_ind;
。。。。。。。。。。。。。。。
如果你装了Oralce 客户端pro*C的话在你的硬盘里有 |
|