in reply to convert bigint to int

What code do you use to access and get the data from the sql server.

What sql server is it?

Replies are listed 'Best First'.
Re^2: convert bigint to int
by Anonymous Monk on Apr 05, 2017 at 08:23 UTC
    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).

      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.