That is, if I describe it as a table. If I describe the view itself, the 
DDL is

CREATE MATERIALIZED VIEW "FOO"."BAR" ("A", "B")
  WITH ROWID USING DEFAULT LOCAL ROLLBACK SEGMENT
  USING ENFORCED CONSTRAINTS DISABLE QUERY REWRITE
  AS SELECT
A,
B
FROM
C.D@E;
  CREATE UNIQUE INDEX "FOO"."I_FOO" ON "FOO"."BAR" ("M_ROW$$") 
  ALTER TABLE "FOO"."BAR" MODIFY ("A" NOT NULL ENABLE);
  ALTER TABLE "FOO"."BAR" MODIFY ("B" NOT NULL ENABLE);
   COMMENT ON MATERIALIZED VIEW "FOO"."BAR"  IS 'foo bar';



On Tuesday, 2 September 2014 09:55:17 UTC+1, Ivan Smirnov wrote:
>
> It looks like it's a materialized view actually, the DDL is something 
> along the lines of:
>
> CREATE TABLE "FOO"."BAR" 
>    ( "M_ROW$$" VARCHAR2(18), 
>  "A" VARCHAR2(32) NOT NULL ENABLE, 
>  "B" FLOAT(126) NOT NULL ENABLE
>    ) ;
>   CREATE UNIQUE INDEX "FOO"."I_FOO" ON "FOO"."BAR" ("M_ROW$$");
>   ALTER TABLE "FOO"."BAR" MODIFY ("A" NOT NULL ENABLE);
>   ALTER TABLE "FOO"."BAR" MODIFY ("B" NOT NULL ENABLE);
>    COMMENT ON MATERIALIZED VIEW "FOO"."BAR"  IS 'foo bar';
>
>
>
> On Monday, 1 September 2014 19:14:14 UTC+1, Michael Bayer wrote:
>>
>> what’s the nature of an index that reports a column with the name 
>> “m_row$$”, is that a column that is present in the related table or is that 
>> some kind of virtual column?
>>
>> test case (e.g. full CREATE TABLE , CREATE INDEX statements please) 
>>  which backend ?  (seems odd that both oracle AND mssql would have the same 
>> odd behavior)
>>
>> this would be an issue to be supported by those dialects.
>>
>>
>>
>> On Sep 1, 2014, at 1:46 PM, Ivan Smirnov <[email protected]> wrote:
>>
>> py27/lib/python2.7/site-packages/sqlalchemy/engine/reflection.pyc in 
>> reflecttable(self, table, include_columns, exclude_columns)
>>     591                 cols_by_orig_name[c] if c in cols_by_orig_name
>>     592                 else table.c[c]
>> --> 593                 for c in columns
>>     594             ],
>>     595                 **dict(unique=unique))
>>
>> py27/lib/python2.7/site-packages/sqlalchemy/util/_collections.pyc in 
>> __getitem__(self, key)
>>     155
>>     156     def __getitem__(self, key):
>> --> 157         return self._data[key]
>>     158
>>     159     def __delitem__(self, key):
>>
>> KeyError: u'm_row$$'
>> > 
>> py27/lib/python2.7/site-packages/sqlalchemy/util/_collections.py(157)__getitem__()
>>     156     def __getitem__(self, key):
>> --> 157         return self._data[key]
>>     158
>>
>>
>> If you have an index containing a column with a non-numeric character 
>> (like 'm_row$$'), reflection would fail as in the example above, since 
>> table.c would not contain it.
>>
>> Is there any way around it?
>>
>> P.S. It seems to be related to this thread from 4 years ago (MS SQL):
>>
>> https://groups.google.com/forum/#!searchin/sqlalchemy/keyerror/sqlalchemy/BcANLqW1D04/sRPMYpDLO8oJ
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sqlalchemy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sqlalchemy.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to