chuntoon has asked for the wisdom of the Perl Monks concerning the following question:
Thanks for any help.#!/usr/bin/perl -w use strict; my $schema = shift(@ARGV); my $infile = "./".$schema."_tables.out"; my $outfile = "./gen_rep_support_".$schema."_tables.sql"; my $table; open (INFILE, "< $infile") or die "Couldn't open $infile: $!"; my @tables = <INFILE>; close (INFILE); open (OUTFILE, "> $outfile") or die "Couldn't open $outfile: $!"; foreach $table (@tables) { print OUTFILE "BEGIN\n"; print OUTFILE " DBMS_REPCAT.CREATE_MASTER_REPOBJECT (\n"; print OUTFILE " gname => 'beastdb_mstr_grp',\n"; print OUTFILE " type => 'TABLE',\n"; print OUTFILE " oname => '$table',\n"; print OUTFILE " sname => '$schema',\n"; print OUTFILE " use_existing_object => TRUE,\n"; print OUTFILE " copy_rows => FALSE);\n"; print OUTFILE "END;\n"; print OUTFILE "/\n\n"; } close (OUTFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting wierd results when looping through file contents
by mfriedman (Monk) on Jun 26, 2002 at 16:16 UTC | |
|
Re: Getting wierd results when looping through file contents
by Aristotle (Chancellor) on Jun 26, 2002 at 16:27 UTC | |
by Anonymous Monk on Jun 26, 2002 at 16:41 UTC | |
|