On Mon, May 16, 2011 at 10:31 PM, Octavian Rasnita <span dir="ltr">&lt;<a href="mailto:orasnita@gmail.com">orasnita@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">







<div bgcolor="#ffffff">
<div><b>From:</b> <a title="moseley@hank.org" href="mailto:moseley@hank.org" target="_blank">Bill 
Moseley</a> </div>
<blockquote style="padding-right:0px;padding-left:5px;margin-left:5px;border-left:#000000 2px solid;margin-right:0px"><div class="im">
  <div><font face="Arial" size="2"></font><font face="Arial" size="2"></font><br></div>
  <div><font face="Arial" size="2"></font><br></div>I have two databases that are 
  very similar.  For example, the &quot;person&quot; table in one db has an &quot;email&quot; 
  column and the other does not have that column, otherwise the tables are the 
  same.
  <div><font face="Arial" size="2"></font><br></div>
  <div>My application uses the schema with the table that has the &quot;email&quot; 
  column, so there&#39;s places in the application that call $person-&gt;get_column( 
  &#39;email&#39; ), and also $person_rs-&gt;create( { name =&gt; $name, email =&gt; 
  $email } );  </div>
  <div><font face="Arial" size="2"></font><br></div>
  <div>Now, I want to use the second schema with the same application, but as 
  mentioned above does not have an &quot;email&quot; column on the person table. 
   it&#39;s not important that the column does not exist.</div>
  <div><font face="Arial" size="2"></font><br></div>
  <div>My question is what can I do to make get_column and create (and other 
  methods that assume there is an &quot;email&quot; column) work without this column 
  defined in the result class.  Is there any way to have define a column 
  that is never used when constructing database queries?</div>
  <div><font face="Arial" size="2"></font><font face="Arial" size="2"></font><br></div>
  <div><font face="Arial" size="2"></font><font face="Arial" size="2"></font><font face="Arial" size="2"></font><br> </div>
  </div><div><font face="Arial" size="2">Hi,</font></div>
  <div><font face="Arial" size="2"></font> </div>
  <div><font face="Arial" size="2">Use in the Result class:</font></div>
  <div><font face="Arial" size="2"></font> </div>
  <div><font face="Arial" size="2">__PACKAGE__-&gt;mk_group_accessors( simple =&gt; 
  &#39;email&#39; );</font></div></blockquote></div></blockquote><div>No.  Although that makes an accessor (just as my &quot;sub email {}&quot; example would provide) it doesn&#39;t register a column so -&gt;get_column and -&gt;create will still fail.</div>

<div><br></div><div><br></div></div><br>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a><br>