473,396 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to execute procedure (sql server) in perl scripts

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. use DBI;
  4.  
  5. use Data::Dumper;
  6. use Asterisk::AGI;
  7.  
  8. my $agi = new Asterisk::AGI;
  9.  
  10. $account_number  ='89746123#';
  11. $call_number ='1234524';
  12. $service_id  =6;
  13.  
  14. my $DSN = q/dbi:ODBC:SQLSERVER/;
  15. my $uid = q/ivr/;
  16. my $pwd = q/ivr/;
  17.  
  18. my $DRIVER = "Freetds";
  19. my $dbh = DBI->connect($DSN,$uid,$pwd) or die "Coudn't Connect SQL";
  20.  
  21.  
  22.              if ($service_id = 6)
  23.                 {
  24.                 $fund_code1 = 115;
  25.                 $sql=(qq{
  26.                         use Cserver
  27.                         declare \@fund_code as varchar(20),\@acc_no  as varchar(20)
  28.                         exec \[192\.168\.14\.5\]\.\[Msmf\]\.\.usp_get_account_confirm \@fund_code=$fund_code1,\@acc_no=$account_number
  29.                         });
  30.                 }
  31.  
  32.          my $sth = $dbh->prepare($sql);
  33.         $sth->extecute();
  34.         $return = $sth->fetchrow();
  35.         $agi->set_variable('result',$return);
  36.         print Dumper($return);
  37.         $sth->finish;
  38.         $dbh->disconnect;
whenever i execute above program i got following error:
Can't locate object method "extecute" via package "DBI::st"

please help me..
Dec 26 '12 #1

✓ answered by RonB

There are several problems with your code, but the one related to your error message is line #33.

As the error message states, it can't find a method called "extecute" and that's because you misspelled it.

$sth->extecute();

should be:
$sth->execute;

1 2976
RonB
589 Expert Mod 512MB
There are several problems with your code, but the one related to your error message is line #33.

As the error message states, it can't find a method called "extecute" and that's because you misspelled it.

$sth->extecute();

should be:
$sth->execute;
Dec 26 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: fumanchu | last post by:
I've got to let end users (really just one person) load billing batch files into a third party app table. They need to specify the billing cycle name, the batch name, and the input file name and...
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
0
by: Sam | last post by:
I had exported MS SQL Server DTS to Visual Basic File (.bas). I wonder how could execute dts.bas via vb.net ? Please advise. Many thanks.
0
by: Alan M Dunsmuir | last post by:
After some early aborted installations and botched de-installations of VS 2005, SQL Server Express no longer wants to install on my desktop machine, and doesn't even get mentioned during the...
4
by: saiprasanthi | last post by:
Hi, I need your help regarding how to time a sql procedure or a trigger to get executed ie., I would like to call the procedure or trigger automatically on a pariticular date and time after...
4
by: fniles | last post by:
I have created a backup maintenance plan in SQL Server 2005. Is there any way to run/execute this SQL Server backup maintenance plan from VB.NET ? Thank you.
0
by: Subrat Das | last post by:
Hi all, I have xmls stored in a TEXT column in a table.I retrieve these xmls as string from the table and pass on to java application. Now i want that before sending the result to java, i need...
4
by: ipez75 | last post by:
Hello everyone, I have a web application written in asp 6.0, my problem is that I execute a sql server store procedure and I get an empty recordset, while executing the same sp on query anlyzer I...
2
by: Dave | last post by:
How can I execute a SQL Server 2005 Job from C# in an ASP Page?
1
by: =?Utf-8?B?aUhhdkFRdWVzdGlvbg==?= | last post by:
I am working on an application where I need to pass 410 parameters (most of them being optiona)l to a stored procedure. I just wanna know will an stored procedure in SQL server 2005 will accept so...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.