Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Loading data from Oracle Database to pandas DataFrames

import pandas as pd
import cx_Oracle
import sqlalchemy
from sqlalchemy.exc import SQLAlchemyError
try:
   engine = sqlalchemy.create_engine("oracle+cx_oracle://usr:pswd@localhost/?service_name=orclpdb1", arraysize=1000)
   orders_sql = """SELECT * FROM orders"""; 
   df_orders = pd.read_sql(orders_sql, engine)
   details_sql = """SELECT * FROM details""";
   df_details = pd.read_sql(details_sql, engine)
   print(df_orders) 
   print(df_details) 
except SQLAlchemyError as e:
   print(e)
Comment

Loading data from Oracle Database to pandas DataFrames

import pandas as pd
import cx_Oracle
import sqlalchemy
from sqlalchemy.exc import SQLAlchemyError
try:
   engine = sqlalchemy.create_engine("oracle+cx_oracle://usr:pswd@localhost/?service_name=orclpdb1", arraysize=1000)
   orders_sql = """SELECT * FROM orders"""; 
   df_orders = pd.read_sql(orders_sql, engine)
   details_sql = """SELECT * FROM details""";
   df_details = pd.read_sql(details_sql, engine)
   print(df_orders) 
   print(df_details) 
except SQLAlchemyError as e:
   print(e)
Comment

Loading data from Oracle Database to pandas DataFrames

pip install pandas
pip install SQLAlchemy
pip install cx_Oracle
Comment

PREVIOUS NEXT
Code Example
Python :: how to dinamically create the Q query in django 
Python :: pandas iloc stack overflow 
Python :: Find meta tag of a website in python 
Python :: docker python run subprocess python run docker interactively subprocess 
Python :: Broadcasting with NumPy Arrays Example 
Python :: Python NumPy atleast_1d Function Example when inputs are in high dimension 
Python :: Python NumPy Shape function example Printing the shape of the multidimensional array 
Python :: how to shuffle list in djnago 
Python :: pypi autopep8 
Python :: Python3: Deleting even and only showing uneven numbers from, set list. 
Python :: Python NumPy asarray_chkfinite Function Syntax 
Python :: Python NumPy dstack Function Example 02 
Python :: gdal split bog image to small python 
Python :: python os.listdir attributes 
Python :: python __sub__ 
Python :: modles en django 
Python :: use every character with python to get probabilities 
Python :: NumPy bitwise_xor Code When inputs are Boolean 
Python :: make a dict from td scrape 
Python :: simple tower of hanoi project python with gui 
Python :: geopandas gdf or df to file 
Python :: list python !g 
Python :: pygame borders on window 
Python :: create multiple marks python for python 
Python :: long armstrong numbers 
Python :: How do I pre-select specific values from a dynamically populated dropdown list for HTML form 
Python :: Express + Jade : Ensuring url paths are correct via controllers, orphaned links 
Python :: python for loop skip iteration if condition not met jinja 
Python :: dictionary, accepting similar words solution 
Python :: gfxdraw circle weight 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =