Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I want to point out that the problem is more subtle than you may think
Indeed. The difference between two versions of a table can be missing columns, which is fairly easy to manage, or more subtle things like NULL/NOT NULL, primary key, constraints, and a host of other things.

Consider Sybase's CREATE TABLE syntax:

create table [database .[owner ].]table_name (column_name datatype [default {constant_expression | user | null}] {[{identity | null | not null}] [off row | [ in row [ (size_in_bytes) ] ] [[constraint constraint_name ] {{unique | primary key} [clustered | nonclustered] [asc | desc] [with { fillfactor = pct, max_rows_per_page = num_rows, } reservepagegap = num_pages }] [on segment_name] | references [[database .]owner .]ref_table [(ref_column )] [match full] | check (search_condition)}]} [match full]... | [constraint constraint_name] {{unique | primary key} [clustered | nonclustered] (column_name [asc | desc] [{, column_name [asc | desc]}...]) [with { fillfactor = pct, max_rows_per_page = num_rows , reservepagegap = num_pages } ] [on segment_name] |foreign key (column_name [{,column_name}...]) references [[database.]owner.]ref_table [(ref_column [{, ref_column}...])] [match full] | check (search_condition) ... } [{, {next_column | next_constraint}}...]) [lock {datarows | datapages | allpages }] [with { max_rows_per_page = num_rows, exp_row_size = num_bytes, reservepagegap = num_pages, identity_gap = value } ] [on segment_name ] [ [ external table ] at pathname ]
Obviously, creating an UPDATE TABLE request that will automatically make the two versions of a table identical becomes non-trivial if all of these syntax elements need to be handled.

In reply to Re: Re: Automatically altering tables from different schema's by mpeppler
in thread Automatically altering tables from different schema's by liz

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [LanX]: Oh I see, userDict should have been declared in n outer scope ...
    [LanX]: an
    [LanX]: strange python accepts this?
    [LanX]: no previous userDict?

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (13)
    As of 2018-03-20 18:17 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (257 votes). Check out past polls.