Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: identifier too long error

by Krambambuli (Deacon)
on Nov 04, 2008 at 20:31 UTC ( #721497=note: print w/ replies, xml ) Need Help??


in reply to Re^2: identifier too long error
in thread identifier too long error

It might not be the problem, but it seems that both the DBI and the DBD::ODBC you use are a bit outdated.

Current versions are DBI-1.607 and DBD::ODBC-1.17.

Can you give them a try ?


Krambambuli
---


Comment on Re^3: identifier too long error
Re^4: identifier too long error
by grashoper (Monk) on Nov 04, 2008 at 20:58 UTC
    will they work with 5.6.1 build 630? this is production and some of our stuff will not work if I upgrade the perl being used, I know I already tried and had to go-back to previous version.
      I don't know... But you'll to have get a way out of this setup one way or another.

      (Hmmm... if it's PROD, why would you make development on that box anyway...?)

      You should be able to try if the problems vanish with some newer Perl and Perl modules even so, by using another development machine (you can have one at Amazon in no time) or by just installing the new modules into your home, even without upgrading Perl.

      I cannot say so, but what would you do if I could: 'Oh, it's a nasty bug that was patched in the latest DBI/DBD::ODBC' ?

      Krambambuli
      ---
        yeah I tried it on my laptop with version 5.10 of perl and no its not the version of dbi I am at 1.601 upgraded to 1.602 but no difference at all, here is my code + my error file.
        use OLE; use DBI; use DBD::ODBC; use Mail::Sender; my $trace_level=1; my $trace_file='tracefile.txt'; DBI->trace($trace_level,$trace_file); #### lnitialization of Global Variables & Arrays #### my $debug =0; my $t = time; (my $sec, my $min, my $hour, my $mday, my $mon, my $year, my $wday, m +y $yday, my $isdst)=localtime($t); $year = $year + "1900"; my $SQLServer = "servername"; my $DB = "dbname"; my $SQLUname = "username"; my $SQLpass="password"; my $field1="ClassSchedule.EventDate AS EventDate"; my $field2="DATEDIFF(Day,{fn NOW()},ClassSchedule.EventDate) A +S Until,"; my $field3="DATEDIFF(Day,ClassRoster.Enrolled, ClassSchedule.EventDat +e) AS Since,"; my $field4="Classes.Duration AS Duration, Classes.Topic AS Topic, Cla +sses.Description AS Description, ClassLocation.Location AS Location, ClassLocation.Address AS Address, ClassLocation.Directions AS Directions, ClassLocation.Map AS Map, ClassRoster.idEnrollee AS idEnrollee, ClassRoster.System AS System, ClassRoster.Account AS Account, ClassRoster.PublicID AS PublicID, ClassRoster.Name AS Name, ClassRoster.Email AS emailAddress"; my $field5="ClassSchedule"; my $field6="Classes ON ClassSchedule.id_Class = Classes.idClass"; my $field7="ClassRoster ON ClassSchedule.idEvent = ClassRoster.id_Eve +nt"; my $field8="ClassLocation ON ClassSchedule.id_Location = ClassLocatio +n.idLocation"; my $field9condition="ClassSchedule.EventDate > { fn NOW() }) A +ND (ClassRoster.Cancelled IS NULL) AND (ClassRoster.Reminded IS NULL) AND (DATEDIFF(dd, ClassRoster.Enrolled, ClassSchedule.EventD +ate) > 7) AND (NOT (DATEPART(dw, { fn NOW() }) IN (1, 7))) AND (DATEDIFF(dd, { fn NOW() }, ClassSchedule.EventDate) < 7 +)"; # Connect to the database # See footnote my $dbh = DBI->connect("dbi:ODBC:driver=SQL Server;Server=VASVCSSQL;da +tabase=MLXhelp;uid=$SQLUname;pwd=$SQLpass;") or die "Couldn't open d +atabase: $DBI::errstr; stopped"; print "connected finally\n"; # Prepare the SQL query for execution my $sth=$dbh->prepare("SELECT $field1,$field2,$field3,$field4 from $fi +eld5 INNER JOIN $field6 INNER JOIN $field7 INNER JOIN $field8 WHERE $ +field9condition"); # Execute the query $sth->execute() or die "Couldn't execute statement: $DBI::errstr; stop +ped"; while (my ($field1)=$sth->fetchrow_array()) { print "Field 1: $field1 \n"; } $sth->finish(); $dbh->disconnect(); DBI 1.602-ithread default trace level set to 0x0/1 (pid 5692) at t +est3.pl line 12 -> DBI->connect(dbi:ODBC:driver=SQL Server;Server=VASVCSSQL;databa +se=MLXhelp;uid=Frank;pwd=fu3go;, , ****) -> DBI->install_driver(ODBC) for MSWin32 perl=5.010000 pid=5692 ru +id=0 euid=0 install_driver: DBD::ODBC version 1.15 loaded from C:/Perl/site +/lib/DBD/ODBC.pm <- install_driver= DBI::dr=HASH(0x3376c8c) !! warn: 0 CLEARED by call to default_user method <- default_user(undef, undef, ...)= ( undef undef ) [2 items] at D +BI.pm line 625 <- connect('driver=SQL Server;Server=VASVCSSQL;database=MLXhelp;ui +d=Frank;pwd=fu3go;', undef, ...)= DBI::db=HASH(0x33771ac) at DBI.pm l +ine 637 info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change +d database context to 'MLXhelp'. (SQL-01000) [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin +g to us_english. (SQL-01000)' (err#0) <- STORE('PrintError', 1)= 1 at DBI.pm line 689 info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change +d database context to 'MLXhelp'. (SQL-01000) [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin +g to us_english. (SQL-01000)' (err#0) <- STORE('AutoCommit', 1)= 1 at DBI.pm line 689 info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change +d database context to 'MLXhelp'. (SQL-01000) [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin +g to us_english. (SQL-01000)' (err#0) <- STORE('Username', undef)= 1 at DBI.pm line 692 info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change +d database context to 'MLXhelp'. (SQL-01000) [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin +g to us_english. (SQL-01000)' (err#0) <> FETCH('Username')= undef ('Username' from cache) at DBI.pm line + 692 info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change +d database context to 'MLXhelp'. (SQL-01000) [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin +g to us_english. (SQL-01000)' (err#0) #removed connectstring for security <- connected('dbi:ODBC:driver=SQL;')= undef at DBI.pm line 698 <- connect= DBI::db=HASH(0x33771ac) info: '' '[Microsoft][ODBC SQL Server Driver][SQL Server]Change +d database context to 'MLXhelp'. (SQL-01000) [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language settin +g to us_english. (SQL-01000)' (err#0) <- STORE('dbi_connect_closure', CODE(0x3376bdc))= 1 at DBI.pm line + 707 !! info: '' CLEARED by call to prepare method <- prepare('SELECT ClassSchedule.EventDate AS EventDate,DATEDIFF(D +ay,{fn NOW()},ClassSchedule.EventDate) AS Until,,DATEDIFF(Day,ClassRo +ster.Enrolled, ClassSchedule.EventDate) AS Since,,Classes.Duration AS + Duration, Classes.Topic AS Topic, Classes.Description AS Description +, ClassLocation.Location AS Location, ClassLocation.Address AS Address, ClassLocation.Directions AS Directions, Cl...')= DBI::st=HASH(0x33773dc) at test3.pl line 55 !! ERROR: 1 '[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1 +: Incorrect syntax near ','. (SQL-42000) [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not +be prepared. (SQL-42000)' (err#2) <- execute= undef at test3.pl line 57 ERROR: 1 '[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1 +: Incorrect syntax near ','. (SQL-42000) [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not +be prepared. (SQL-42000)' (err#2) <- DESTROY(DBI::st=HASH(33772ec))= undef at test3.pl line 57 ERROR: 1 '[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1 +: Incorrect syntax near ','. (SQL-42000) [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not +be prepared. (SQL-42000)' (err#0) <- DESTROY(DBI::db=HASH(337711c))= undef at test3.pl line 57 !! ERROR: 1 CLEARED by call to disconnect_all method <- disconnect_all= '' at DBI.pm line 715 ! <- DESTROY(DBI::dr=HASH(3376c8c))= undef during global destruction
      No. The latest DBI needs at least 5.8.1 (see DBI's Makefile.PL). The number of changes in DBI and DBD::ODBC since the versions you are using is huge.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://721497]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-11-21 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (104 votes), past polls