none
Q: How to connect to non-default database schema using OraOLEDB.Oracle or the Microsoft provider for Oracle? RRS feed

  • Question

  • I'm trying to connect to a non-default schema. I connect just fine, but can't seem to switch to a different schema.

    Currently trying

    // Switch schama
    OleDbCommand cmd = new OleDbCommand();
    cmd.Connection = conn;
    cmd.CommandType = CommandType.Text;
    cmd.CommandText = "ALTER SESSION SET CURRENT_SCHEMA = OLPSDB-DEV";
    cmd.ExecuteNonQuery();

    but Oracle errors and my code throws an exception

    Message "ORA-00922: missing or invalid option" string

    Anyone? Thanks in advance!

    Sincerely,
    Adam
    Monday, February 28, 2011 2:28 AM

Answers

All replies