Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> A question in pro*C??

A question in pro*C??

From: <simrion_at_263.net>
Date: Tue, 02 Mar 1999 05:07:56 GMT
Message-ID: <7bfrn6$v4d$1@nnrp1.dejanews.com>


  I write a function to get table column infomation,

int ORA_GetColumnInfo(char *tablename)
{
  sql_cursor ColumnCursor;
  EXEC SQL ALLOCATE :ColumnCursor;
  ...

  EXEC ORACLE OPTION(select_error=no);	EXEC SQL SELECT  CURSOR(SELECT
column_name,data_type,data_length FROM all_tab_columns	where
table_name=:tablename)	INTO :ColumnCursor  FROM DUAL;	EXEC ORACLE
OPTION(select_error=yes); ...

}

the function raises an Access Violation error.

Howerver, when I replace :tablename using table name const string, it runs correctly.

Any help will be apprcieated.

Simrion

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Mar 01 1999 - 23:07:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US