SQL server 2000 giving error about System Tables

5 messages Options
Embed this post
Permalink
Ascii King

SQL server 2000 giving error about System Tables

Reply Threaded More More options
Print post
Permalink
I am getting an error about the System Tables in MS SQL server 2000 not
having key fields. Is there something special I need to do to get the
DBIX::Class to work with SQL Server 2000?

It works fine on SQL Server 2008, which doesn't have System tables.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Ascii King

Re: SQL server 2000 giving error about System Tables

Reply Threaded More More options
Print post
Permalink
Sorry to be so vague in my least plea. I really am stumped with this and
need the help, so here is more info in case you need it.

I use the following line to set up my Catalyst web app using DBIC on
Windows XP

script\omtsweb_create.pl model DB DBIC::Schema WebApp::Schema
create=static components=TimeStamp,EncodedColumn dbi:ODBC:webapp test01
mypass

This gives me a whole slew of errors, all similair to this one:
DBIx::Class::Schema::Loader::make_schema_at(): syscolumns has no primary
key at C:/Perl/site/lib/Catalyst/Helper/Model/DBIC/Schema.pm line 173

I know what the "no primary key" error is, but since the only tables it
complains about are the System Tables, I don't want to mess with them.  
I don't want it to read those system tables into my schema at all, but
it creates a .pm file for every table including the system tables.

In SQL Server 2005 and 2008 the System Tables have been removed and
replaced with Views. This whole thing works properly in those versions,
but the older version of SQL Server 2000 causes the problem.

Is there some easy way around this? I would rather not have to tell the
boss to upgrade the database if I don't have to.

Thanks for your help.

Ascii King wrote:

> I am getting an error about the System Tables in MS SQL server 2000
> not having key fields. Is there something special I need to do to get
> the DBIX::Class to work with SQL Server 2000?
>
> It works fine on SQL Server 2008, which doesn't have System tables.
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@...
>

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Michael Higgins

Re: SQL server 2000 giving error about System Tables

Reply Threaded More More options
Print post
Permalink
On Thu, 25 Jun 2009 09:41:32 -0400
Ascii King <[hidden email]> wrote:

> I don't want it to read those system tables into my schema at all,
> but it creates a .pm file for every table including the system tables.

So delete them.

The primary key warnings are warnings, not errors... right? You don't care about using the system tables anyway.

Auto-generating the schema on every start is not a good way to go with a production app, so... you even did create=static.

It created a schema for those tables you do want to use. Sounds like you're all set.

What's the problem? ;-)

Cheers,

--
 |\  /|        |   |          ~ ~  
 | \/ |        |---|          `|` ?
 |    |ichael  |   |iggins    \^ /
 michael.higgins[at]evolone[dot]org

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Matt Whipple

Re: SQL server 2000 giving error about System Tables

Reply Threaded More More options
Print post
Permalink
In reply to this post by Ascii King
Ascii King wrote:

> Sorry to be so vague in my least plea. I really am stumped with this
> and need the help, so here is more info in case you need it.
>
> I use the following line to set up my Catalyst web app using DBIC on
> Windows XP
>
> script\omtsweb_create.pl model DB DBIC::Schema WebApp::Schema
> create=static components=TimeStamp,EncodedColumn dbi:ODBC:webapp
> test01 mypass
>
> This gives me a whole slew of errors, all similair to this one:
> DBIx::Class::Schema::Loader::make_schema_at(): syscolumns has no
> primary key at C:/Perl/site/lib/Catalyst/Helper/Model/DBIC/Schema.pm
> line 173
>
> I know what the "no primary key" error is, but since the only tables
> it complains about are the System Tables, I don't want to mess with
> them.  I don't want it to read those system tables into my schema at
> all, but it creates a .pm file for every table including the system
> tables.
>
If you're not going to use them then just remove the classes for them.

> In SQL Server 2005 and 2008 the System Tables have been removed and
> replaced with Views. This whole thing works properly in those
> versions, but the older version of SQL Server 2000 causes the problem.
>
> Is there some easy way around this? I would rather not have to tell
> the boss to upgrade the database if I don't have to.
>
> Thanks for your help.
>
> Ascii King wrote:
>> I am getting an error about the System Tables in MS SQL server 2000
>> not having key fields. Is there something special I need to do to get
>> the DBIX::Class to work with SQL Server 2000?
>>
>> It works fine on SQL Server 2008, which doesn't have System tables.
>>
>> _______________________________________________
>> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
>> IRC: irc.perl.org#dbix-class
>> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
>> Searchable Archive:
>> http://www.grokbase.com/group/dbix-class@...
>>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@...


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Ascii King

Re: SQL server 2000 giving error about System Tables

Reply Threaded More More options
Print post
Permalink
Matt Whipple wrote:
> If you're not going to use them then just remove the classes for them.
>

Thank you both for the help.  I found a work-around at the time, but now
I want to set it up properly. I have learned a little bit, so I think I
am better able to describe my problem.

I get the following errors when I try to automatically load a schema
from a MSSQL 2000 server.

DBIx::Class::Row::get_column(): Can't fetch data as class method at
(eval 1413) line 6
Compilation failed in require at
C:/Perl/site/lib/Class/C3/Componentised.pm line  128.
 at C:/Perl/site/lib/DBIx/Class/Schema/Loader.pm line 137


It works from  MSSQL 2005 or 2008 servers, though.  I also get a whole
slew of warnings as it tries to read the system tables. Those are the
warnings that I posted previously in this thread. I have the most
up-to-date
DBIx::Class and DBIx::Class::Schema::Loader. However, when installing
the Loader, I get an error from the DBD::Sybase module. It wants to know
where my Sybase installation is. Since I need sybase for this, do I have
to install it? It sounds like a dumb question, but I'm not actually sure.

I am installing this on a Windows XP system, with the server located
offsite and I have an ODBC connection to it.

Also, if I copy the tables to a MSSQL 2005 or 2008 dtaabase, it all
works fine. Then I just change my ODBC to point back to the original
database and everything runs. This is a pain, though.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...