Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6905811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:13:48+00:00 2026-05-27T08:13:48+00:00

Porting MSSQL Application to Sybase (ASE 15.0), and experiencing a problem when I call

  • 0

Porting MSSQL Application to Sybase (ASE 15.0), and experiencing a problem when I call GetDeleteCommand.
The error reported is:

Dynamic SQL generation for the DeleteCommand is not supported against
a SelectCommand that does not return any key column information.

The problem only occurs for temporary table, identical non-temporary table works fine.
Table contains a primary key.

Reproduced using test program below.



    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data.OleDb;
    using System.Data;

    namespace DataAdapterTempTable
    {
        class Program
        {
            static void Main(string[] args)
            {
                String ConnectionString = "Provider=ASEOLEDB;Data Source=devsun3:5003;Initial Catalog=ctc;User ID=aigtac12;Password=aigtac12;"; // sybase connection string
                //String ConnectionString = "Provider=SQLOLEDB;Data Source=fiji;Persist Security Info=False;Initial Catalog=nxgn0811;Integrated Security=SSPI"; // mssql connection string

                String TableName = "#alex_temporary_table_test"; // does not work for sybase
                //String TableName = "alex_real_table_test"; // works for sybase + mssql

                String CreateStatement = "create table " + TableName + " (currency_id varchar(4) primary key, rate  decimal(25,6), format   char(1))";

                String SelectStatement = "select * from " + TableName;

                try
                {
                    OleDbConnection con = null;
                    con = new OleDbConnection(ConnectionString);
                    con.Open();

                    OleDbCommand cmd = con.CreateCommand();
                    cmd.CommandType = CommandType.Text;
                    cmd.CommandText = CreateStatement;
                    int count = cmd.ExecuteNonQuery();

                    OleDbCommand cm1 = con.CreateCommand();
                    cm1.CommandType = CommandType.Text;
                    cm1.CommandText = SelectStatement;
                    OleDbDataAdapter DA2 = new OleDbDataAdapter(cm1);
                    DataTable DT2 = new DataTable();
                    DA2.FillSchema(DT2, SchemaType.Mapped);
                    OleDbCommandBuilder cmdbldr = new OleDbCommandBuilder(DA2);
                    DA2.InsertCommand = cmdbldr.GetInsertCommand();

                    DA2.DeleteCommand = cmdbldr.GetDeleteCommand(); // this line fails in sybase for temporary table

                    DA2.UpdateCommand = cmdbldr.GetUpdateCommand();
                    DA2.Fill(DT2);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
        }
    }


  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:13:48+00:00Added an answer on May 27, 2026 at 8:13 am

    Contacted Sybase support, turns out I had to update some system stored procedures. There is a folder that ends with “oledb\sp”, and I had to run a .bat file from the folder. I got the latest ebf and ran the batch file install_oledb_sprocs.bat, the problem went away. Worth mentioning, that sybase 15.5 did not have the issue without patching.

    P.S. Thank you to ‘aF’ for your time looking into the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While porting an application from SQL 2005 to SQL Server Compact Edition, I found
While porting a desktop application to windows mobile I've reached the following error: Error
I have an application I'm porting from MSSQL and .NET to SQLite and Mono.
I am working on porting over a database from a custom MSSQL CMS to
I'm thinking about porting a database from Sql Server 2005 to MySQL. I've become
Porting an application from C# (1.1 framework) to VB.NET (3.5 framework), and I have
I'm working on porting a Visual C++ application to GCC (should build on MingW
We are porting an old application that used a hierarchical database to a relational
Since when did: //echo [$sql][$result][$rows][$e]<BR>; cause an error? The code following this comment gets
We are experiencing a difficult problem which has been puzzling us for some time.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.