in reply to Re: undefined value as a hash reference?
in thread undefined value as a hash reference?

These are the errors I get what could be the problem?
prepare('SELECT ClassSchedule.EventDate AS EventDate,DATEDIFF(Day,{fn +NOW()},ClassSchedule.EventDate) AS Until,,DATEDIFF(Day,ClassRoster.En +rolled, ClassSchedule.EventDate) AS Since,,Classes.Duration AS Durati +on, Classes.Topic AS Topic, Classes.Description AS Description, ClassLocation.Location AS Location, ClassLocation.Address AS Address, ClassLocation.Directions AS Directions, Cl...')= DBI::st=HASH(0x37642dc) at test5.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 test5.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(37641ec))= undef at test5.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(376401c))= undef at test5.pl line 57 !! ERROR: 1 CLEARED by call to disconnect_all method <- disconnect_all= '' at DBI.pm line 715 ! <- DESTROY(DBI::dr=HASH(3763b8c))= undef during global destruction

Replies are listed 'Best First'.
Re^3: undefined value as a hash reference?
by MidLifeXis (Monsignor) on Nov 05, 2008 at 14:40 UTC

    Search for m/,,/, you have Since,,Classes.Doration. I would guess that this would be the cause.

    --MidLifeXis

      I removed the comma and now I get invalid syntax near DATEDIFf, this query is driving me crazy! It works fine on sql server, I have been stuck on this problem for days.

        If this is working on SQLServer, what are you moving it to? If it is SQLServer specific code, it makes sense that extended commands will fail.

        or did I fully misunderstand your comment?

        Anyway, without having full error messages, this might be difficult to resolve.

        --MidLifeXis