in reply to Re: convert bigint to int
in thread convert bigint to int

my $SQL= "SELECT TOP 1000 [name_software] ,[first_term] ,[term_sofi] ,[max_term] FROM [ADM_SHARED].[dbo].[mida_rights]"; my $Select = $dbh->prepare($SQL); $Select->execute(); while(my $Row=$Select->fetchrow_hashref) { print "$Row->{name_software}\t $Row->{first_term}\t $Row->{term_sofi +}\t"; print "\n"; } $dbh->disconnect;
$Row->{first_term} is in bigint and i want it to be int (sql server 2008).

Replies are listed 'Best First'.
Re^3: convert bigint to int
by huck (Prior) on Apr 05, 2017 at 08:43 UTC

    What does your $dbh->connect look like. We need to know what sort of driver you are using

    What error do you get back from what you are trying.

    Are you 64bit perl on a 64bit machine?

      im not getting any errors, i get the correct value which is bigint in the sql column. i need to convert the value from bigint to int. that has nothing to do with the sql connection.

        The connect tells us what driver you are using. is it dbi:ODBC?

        if you are getting the correct value of a bigint from your select then what is your problem?

        do you mean you want to make a new table with a int column rather than a bigint column? That is not a perl problem