clickingwires has asked for the wisdom of the Perl Monks concerning the following question:

I have been trying to figure out a way to insert data into a MS SQL database with no luck. I cannot use the DBI module because
1. I wouldn't install correctly because I don't have make and a C-compiler on the device (Tried PurePerl as well)
2. I cannot install the unixODBC or EasySoft because I can't cross-compile it and don't have the needed space if I could.

I guess I'm at the point where I need either a new paradigm to my approach or a stern talking to of how to explaining how to accomplish the above.

I am using
Moxa DA-661-LX
Linux 2.6.10
XScale (ARMv5) Processor
Perl 5.10.1

  • Comment on Inserting Data to MS SQL server without DBI

Replies are listed 'Best First'.
Re: Inserting Data to MS SQL server without DBI
by roboticus (Chancellor) on Jul 13, 2011 at 12:19 UTC

    clickingwires:

    If you're just trying to insert data, perhaps you can simply format the data, and then use BCP on the windows box to import the data.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re: Inserting Data to MS SQL server without DBI
by metaperl (Curate) on Jul 12, 2011 at 21:21 UTC
    I have been trying to figure out a way to insert data into a MS SQL database with no luck. I cannot use the DBI module because
    1. I wouldn't install correctly because I don't have make and a C-compiler on the device (Tried PurePerl as well)
    Hmm, have you consulted the DBI mailing list about your problems? Are you using ActiveState or strawberry Perl? Strawberry Perl comes with a c-compiler and dmake for making things.

    What exactly happened when you tried installing DBI::PurePerl? Again the DBI mailing list would appreciate specific details on your architecture, error msgs, etc. 2. I cannot install the unixODBC or EasySoft because I can't cross-compile it and don't have the needed space if I could.

    I guess I'm at the point where I need either a new paradigm to my approach or a stern talking to of how to explaining how to accomplish the above.
    Well, you could always use delimited text files and import the data. There are also other agile languages. I've used SQL Alchemy and Python successfully with MS-SQL.



    The mantra of every experienced web application developer is the same: thou shalt separate business logic from display. Ironically, almost all template engines allow violation of this separation principle, which is the very impetus for HTML template engine development.

    -- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"

      I have been trying to figure out a way to insert data into a MS SQL database with no luck. I cannot use the DBI module because
          1. It wouldn't install correctly because I don't have make and a C-compiler on the device (Tried PurePerl as well)

      Hmm, have you consulted the DBI mailing list about your problems? Are you using ActiveState or strawberry Perl? Strawberry Perl comes with a c-compiler and dmake for making things.

        I haven't consulted the DBI mailing list, but I will be now. I not sure which type of Perl I am using because I did not build it. The company for the device built it. If I had to guess, ActiveState.

      What exactly happened when you tried installing DBI::PurePerl? Again the DBI mailing list would appreciate specific details on your architecture, error msgs, etc.

          The way I went about installing PurePerl was copy and paste. I tried to use the CPAN module to install it but it kept on hanging and quitting. The error that I got from perl in regards to the MySQL, for testing without installing unixODBC or EasySoft, was that it might not have been installed properly. Possibly because I took the copy paste method?

      2. I cannot install the unixODBC or EasySoft because I can't cross-compile it and don't have the needed space if I could.

          I guess I'm at the point where I need either a new paradigm to my approach or a stern talking to of how to explaining how to accomplish the above.

      Well, you could always use delimited text files and import the data. There are also other agile languages. I've used SQL Alchemy and Python successfully with MS-SQL

           I am trying to stay away from having the "Remote" server do anything because we have a server that is local to my building and full permissions. But there is a second server several hundred miles away and only have limited rights to access.

          Also, I am trying to make this device as simple and easy to set up. The end goal is to have a technician level employee, with very limited command line skills, be able to execute a install script to completely install the device. I have been sticking to what comes factory installed on the device. The available memory on the system isn't very much and all my program, and libraries, are located on a compact flash card.
Re: Inserting Data to MS SQL server without DBI
by mje (Curate) on Jul 13, 2011 at 12:23 UTC

    Not that it directly answers your question but Easysoft do have an ARM build of unixODBC and the SQL Server driver. If you msg me I will provide you with contact details.

    From Perl, did you look at DBD::Proxy which I believe is pure Perl and if cannot get a pure Perl version of DBI on ARM try posting to the dbi-users list (see dbi.perl.org and the support link) where I'm sure someone could help.

Re: Inserting Data to MS SQL server without DBI
by Anonymous Monk on Jul 13, 2011 at 08:21 UTC