SQL files on Windows installed into share\sql instead of lib\sql
[public/netxms.git] / tools / create_table_list.pl
CommitLineData
29d05345
VK
1#!/usr/bin/perl
2
3use POSIX;
4
5my $inFile = shift || die "Usage : create_table_list.pl <input_file>";
6open(IN, "<$inFile") || die "Cannot open input file: $!";
7
8print "/**\n * automatically generated table list\n * created at " . ctime(time()) . " */\n\n";
9print "#include <nms_common.h>\n\n";
10print "const TCHAR *g_tables[] =\n{\n";
11
12while(<IN>)
13{
14 chomp;
15 $line = $_;
16 if ($line =~ /CREATE TABLE ([A-Za-z0-9_]+).*/)
17 {
18 if ($1 ne "metadata")
19 {
20 print "\t_T(\"$1\"),\n";
21 }
22 }
23}
24
25close IN;
26
27print "\tNULL\n};\n";
28exit 0;