(Fwd) DBI Related Query

(Fwd) DBI Related Query

am 02.08.2007 20:35:10 von Tim.Bunce

----- Forwarded message from Sathish Kumar -----

Date: Thu, 02 Aug 2007 17:21:47 +0530
From: Sathish Kumar
Organization: NewBreak
To: Tim.Bunce@pobox.com
Subject: DBI Related Query

Hi Tim,
I got a query for u.... Is it possible to source a sql file through DBI in perl? If yes
How? I need this to automated my scripts for a long run process.... I would be thank full if i get my
result ASAP...

--
Regards,
Sathish Kumar S
------------------------------
ph : +91 44 42061700
Extn : 130
[1]www.riskspan.com
________________________________________ This email has been Scanned for Viruses! www.newbreak.com
------------------------------------------------------------ - This email has been Scanned for Viruses!
www.riskspan.com !

References

Visible links
1. http://www.riskspan.com/

----- End forwarded message -----
----- Forwarded message from Sathish Kumar -----

Date: Thu, 02 Aug 2007 17:42:24 +0530
From: Sathish Kumar
Organization: NewBreak
To: Tim.Bunce@pobox.com
Subject: Fwd:DBI Related Query

Hi Tim,
FYI, My Datadase is MySql... and i want to execute this sql statement "SOURCE
/home/sathish/test.sql" query via DBI... is it possible???? and also is it possible to set a delimiter
via DBI for mysql database????

Regards,
Sathish Kumar S
------------------------------
ph : +91 44 42061700
Extn : 130
[1]www.riskspan.com

Sathish Kumar wrote:

Hi Tim,
I got a query for u.... Is it possible to source a sql file through DBI in perl? If yes
How? I need this to automated my scripts for a long run process.... I would be thank full if i get my
result ASAP...

--
Regards,
Sathish Kumar S
------------------------------
ph : +91 44 42061700
Extn : 130
[2]www.riskspan.com

________________________________________ This email has been Scanned for Viruses! www.newbreak.com
------------------------------------------------------------ - This email has been Scanned for Viruses!
www.riskspan.com !

References

Visible links
1. http://www.riskspan.com/
2. http://www.riskspan.com/

----- End forwarded message -----

Re: (Fwd) DBI Related Query

am 03.08.2007 02:42:05 von Owen

> ----- Forwarded message from Sathish Kumar -----
>
> Date: Thu, 02 Aug 2007 17:21:47 +0530
> From: Sathish Kumar
> Organization: NewBreak
> To: Tim.Bunce@pobox.com
> Subject: DBI Related Query
>
> Hi Tim,
> I got a query for u.... Is it possible to source a sql
> file through DBI in perl? If yes
> How? I need this to automated my scripts for a long run process.... I
> would be thank full if i get my
> result ASAP...


First of all I suggest you read the documentation

perldoc DBI

For automation you are looking at a cron job.



Owen

Re: (Fwd) DBI Related Query

am 03.08.2007 15:49:21 von henri

>
> Hi Tim,
> I got a query for u.... Is it possible to source a
> sql file through DBI in perl? If yes
> How? I need this to automated my scripts for a long run
> process.... I would be thank full if i get my
> result ASAP...
>
>
> Hi Tim,
> FYI, My Datadase is MySql... and i want to execute this sql
> statement "SOURCE
> /home/sathish/test.sql" query via DBI... is it possible???? and
> also is it possible to set a delimiter
> via DBI for mysql database????


I think that the only way to do it with DBI is to read the sql file
and split it into its component sql queries (either via regex or
something like SQL::Statement), then execute each one of them
independently.


But there's a much easier way:

`cat file1.sql file2.sql | mysql -u USERNAME -p`