<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Oracle provides a way to specify a pk for a view.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-indent:.5in'>alter view &lt;viewname&gt; add
constraint &lt;constraintname&gt; primary key (&lt;columnlist&gt;) disable
novalidate;<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>This pk is not enforced but provides information about what
pk makes sense for the data in the view.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I haven&#8217;t tried this with the king oracle provider to
see if it would be recognized.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>It&#8217;s hard to guess a possible pk for a view (in an
automated way) unless the view is a simple select from a single table, and the
select includes the underlying table&#8217;s pk columns. If there is a join
involved, it&#8217;s more complicated.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Thanks,<o:p></o:p></p>

<p class=MsoNormal>Orest.<o:p></o:p></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> fdo-internals-bounces@lists.osgeo.org
[mailto:fdo-internals-bounces@lists.osgeo.org] <b>On Behalf Of </b>Kenneth
Skovhede, GEOGRAF A/S<br>
<b>Sent:</b> Tuesday, July 08, 2008 4:29 AM<br>
<b>To:</b> FDO Internals Mail List<br>
<b>Subject:</b> Re: [fdo-internals] primary key on views for rdbms providers?<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I don't think king.oracle works on views without setup in
the helper table.<br>
<br>
If it is possible to detect/guess the PK in any way, that would the<br>
best solution IMO (less user action required).<br>
<br>
The ability to override and otherwise setup the datasource is nice.<br>
You could put it in a config document rather than a special table.<br>
There are pros and cons for both I think.<br>
<br>
<o:p></o:p></p>

<pre>Regards, Kenneth Skovhede, GEOGRAF A/S<o:p></o:p></pre>

<p class=MsoNormal><br>
<br>
Bruno Scott skrev: <o:p></o:p></p>

<pre>Yes it's true,<o:p></o:p></pre><pre>But king.oracle can also work wihout this helper table!<o:p></o:p></pre><pre>Does it support selection on views without the helper table?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Do you think adding this king of helper table in the PostGIS provider is a<o:p></o:p></pre><pre>good approach?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Bruno<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Kenneth Skovhede, GEOGRAF A/S wrote:<o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>The Oracle provider does this with a special helper table:<o:p></o:p></pre><pre><a
href="http://www.sl-king.com/fdooracle/KingFdoClass.htm">http://www.sl-king.com/fdooracle/KingFdoClass.htm</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Regards, Kenneth Skovhede, GEOGRAF A/S<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Bruno Scott skrev:<o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp; <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>I'm facing a problem in the PostGIS provider when mapping a view to a<o:p></o:p></pre><pre>feature<o:p></o:p></pre><pre>class.<o:p></o:p></pre><pre>How to determine wich column will serves as primary key.<o:p></o:p></pre><pre>Is there a way in PostGIS to know wich one?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>And on a more general perspective, what if there is more than one primary<o:p></o:p></pre><pre>key in the view's based tables? Is there a rule of thumb we could use?<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>How did you manage to resolve this question in providers like<o:p></o:p></pre><pre>Oracle,MySQL,SqlServer???<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>When there is no primary key on a feature class, the selection in<o:p></o:p></pre><pre>mapguide<o:p></o:p></pre><pre>does not work!<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Thanks<o:p></o:p></pre><pre>Bruno<o:p></o:p></pre><pre>&nbsp; <o:p></o:p></pre><pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></pre></blockquote>

<pre>_______________________________________________<o:p></o:p></pre><pre>fdo-internals mailing list<o:p></o:p></pre><pre><a
href="mailto:fdo-internals@lists.osgeo.org">fdo-internals@lists.osgeo.org</a><o:p></o:p></pre><pre><a
href="http://lists.osgeo.org/mailman/listinfo/fdo-internals">http://lists.osgeo.org/mailman/listinfo/fdo-internals</a><o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>&nbsp;&nbsp;&nbsp; <o:p></o:p></pre></blockquote>

<pre><o:p>&nbsp;</o:p></pre><pre>&nbsp; <o:p></o:p></pre></div>

</body>

</html>