Discussion:
Cannot prepare/execute SELECT ... INTO #temptable ?
(too old to reply)
sebflaesch
2010-07-05 13:56:37 UTC
Permalink
Hi all,

Using Sybase ASE 15.5 developer edition:

It appears that the ODBC driver does not support execution of
SELECT ... INTO #temptable?

rcode = SQLPrepare(m_hstmt, (SQLCHAR *) "select * into #tt from
mytab1", SQL_NTS);
rcode = SQLExecute(m_hstmt);

I get this error:

SQL State: ZZZZZ
SQL code : 3803
Message : [Sybase][ODBC Driver][Adaptive Server Enterprise]The
statement used to define the cursor 'SQL_CUR_1' is neither a SELECT
nor an EXECUTE.

I guess the driver is trying to identify the SQL statement, but fails
because of the special INTO #temptable syntax.

Is someone from Sybase reading this group? (I hope so)

Seb
sebflaesch
2010-07-21 09:15:04 UTC
Permalink
Seems that ODBC parameter UseCursor = 0 solves the issue, but then you
lose scrollable cursors.
Seb

Loading...