Re: Describe table from Pro*C Applications

From: <NeedaHoliday>
Date: Thu, 29 Oct 1998 19:24:48 GMT
Message-ID: <3638bd7d.91291840_at_news.pwgsc.gc.ca>


You can use the following logic.

As long as you have a predefined view.

  strcpy(hc_dym_stmt, "CREATE TABLE tablename \n");
  strcat(hc_dym_stmt, "TABLESPACE WORK1 PCTFREE 0 PCTUSED 99 \n");
  strcat(hc_dym_stmt, "STORAGE(INITIAL 50M NEXT 10M PCTINCREASE
0)\n");
  strcat(hc_dym_stmt, " AS (SELECT * FROM VW_CCT_DTL_RPT \n");
  strcat(hc_dym_stmt, "      WHERE FK_INV_PER = '");
  strcat(hc_dym_stmt,  inv_per );
  strcat(hc_dym_stmt, "' \n");
  strcat(hc_dym_stmt, "        AND FK_PRJ_ID  = ");
  strcat(hc_dym_stmt, prj_id);
  strcat(hc_dym_stmt, "\n");
  strcat(hc_dym_stmt, "        AND FK_CUST_ID IN (");
  strcat(hc_dym_stmt, gc_cust_list);
  strcat(hc_dym_stmt, ")) \n");
  strcpy(hc_idx_stmt, "CREATE INDEX tablename_IDX_1 ON CCT_DTL_RPT
\n");
  strcat(hc_idx_stmt, "(FK_INV_PER, FK_PRJ_ID, FK_CUST_ID, \n");
  strcat(hc_idx_stmt, "FK_BILL_CD, SPLR_SRL_NO ) \n");
  strcat(hc_idx_stmt, "TABLESPACE WORK1 PCTFREE 0 \n");
  strcat(hc_idx_stmt, "STORAGE (INITIAL 1M NEXT 500K PCTINCREASE 0)
\n");

On Thu, 29 Oct 1998 18:41:43 GMT, matthew_at_mattshouse.com wrote:

>Is there a way to do a 'describe <tablename>' from pro*c and populate a
>structure with the results? If not, is there a way to retrieve the same
>information using another method from pro*c?
>
>Matthew
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Thu Oct 29 1998 - 20:24:48 CET

Original text of this message