HiveSQL
  • Introduction
  • Register your HiveSQL account
  • Support
  • Technical informations
    • Database Diagram
    • Operations
      • TxAccountClaims
      • TxAccountCreates
      • TxAccountRecoveryChanges
      • TxAccountRecoveryRequests
      • TxAccountRecoveryConfirms
      • TxAccountUpdates
      • TxAccountUpdates2
      • TxAccountWitnessProxies
      • TxAccountWitnessVotes
      • TxClaimRewardBalances
      • TxCollateralizedConverts
      • TxComments
      • TxCommentsOptions
      • TxConverts
      • TxCustoms
      • TxDeclineVotingRights
      • TxDelegateVestingShares
      • TxDeleteComments
      • TxEscrowApproves
      • TxEscrowDisputes
      • TxEscrowReleases
      • TxEscrowTransfers
      • TxFeeds
      • TxLimitOrdersCancels
      • TxLimitOrdersCreates
      • TxPows
      • TxProposalCreates
      • TxProposalRemoves
      • TxProposalUpdates
      • TxProposalVoteUpdates
      • TxRecurrentTransfers
      • TxTransfers
      • TxVotes
      • TxWithdraws
      • TxWithdrawVestingRoutes
      • TxWitnessSetProperties
      • TxWitnessUpdates
    • Virtual Operations
      • VOAccountCreateds
      • VOAuthorRewards
      • VOChangedRecoveryAccounts
      • VOClearNullAccountBalances
      • VOCollateralizedConvertImmediateConversions
      • VOCommentBenefactorRewards
      • VOCommentPayoutUpdates
      • VOCommentRewards
      • VOCommentsVotes
      • VOConsolidateTreasuryBalances
      • VOCurationRewards
      • VODelayedVotings
      • VODHFConversions
      • VODHFFundings
      • VOExpiredAccountNotifications
      • VOFailedRecurrentTransfers
      • VOFillCollateralizedConvertRequests
      • VOFillConvertRequests
      • VOFillOrders
      • VOFillRecurrentTransfers
      • VOFillTransferFromSavings
      • VOFillVestingWithdraws
      • VOHardforkHiveRestores
      • VOHardforkHives
      • VOHardforks
      • VOInterests
      • VOLimitOrderCancelleds
      • VOLiquidityRewards
      • VOPowRewards
      • VOProducerMisseds
      • VOProducerRewards
      • VOProposalFees
      • VOProposalPays
      • VOReturnVestingDelegations
      • VOShutdownWitnesses
      • VOSPSConverts
      • VOSPSFunds
      • VOTransferToVestingCompleteds
    • State tables
      • DynamicGlobalProperties
      • Accounts
      • Blacklists
      • BlacklistsFollows
      • Comments
      • Communities
      • CommunitiesRoles
      • CommunitiesSubscribers
      • Delegations
      • Followers
      • Mutes
      • MutesFollows
      • Proposals
      • ProposalsApprovals
      • RCDelegations
      • Reblogs
      • Tags
      • Witnesses
    • Full Text Search
    • Language detection
  • Tutorials
    • HiveSQL for Python developers
    • HiveSQL for PHP developers
    • HiveSQL for Ruby developers
    • HiveSQL for Microsoft Excel
  • HiveSQL Status
  • Resources
Powered by GitBook
On this page
  1. Tutorials

HiveSQL for Python developers

Use the following code to connect to HiveSQL using Python:

import pypyodbc
connection = pypyodbc.connect('Driver={ODBC Driver 13 for SQL Server};'
                              'Server=vip.hivesql.io;'
                              'Database=DBHive;'
                              'uid=[your_hivesql_account];'
                              'pwd=[your_hivesql_password]')
cursor = connection.cursor() 
SQLCommand = ("YOUR SQL QUERY”)
cursor.execute(SQLCommand)
# do whatever you want with the retrieved data
connection.close()

Remember you need to have ODBC drivers installed on your computer.

How to install the Microsoft ODBC Driver for SQL Server on Linux and macOS

On Debian 9

sudo curl https://ift.tt/2OlWDWn > /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17

Optional for bcp and sqlcmd

sudo ACCEPT_EULA=Y apt-get install mssql-tools
echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ >> ~/.bash_profile
echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”‘ >> ~/.bashrc
source ~/.bashrc

Optional for unixODBC development headers

sudo apt-get install unixodbc-dev
PreviousLanguage detectionNextHiveSQL for PHP developers

Last updated 2 years ago

For more details on how to install Microsoft SQL ODBC drivers, you can read published by @geekgirl

this post