Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot prepare/execute SELECT ... INTO #temptable ?

260 views
Skip to first unread message

sebflaesch

unread,
Jul 5, 2010, 9:56:37 AM7/5/10
to s...@4js.com
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

unread,
Jul 21, 2010, 5:15:04 AM7/21/10
to
Seems that ODBC parameter UseCursor = 0 solves the issue, but then you
lose scrollable cursors.
Seb
0 new messages