title: SQLAlchemy oracle connect
body: <p>Most of the connections I see don't resemble the type of SQLAlchemy connection I am using. I am wondering if there is a way of mirroring this style or if it has to be used within create_engine.  Here is an example of my connection and a class of I am using to connect to a specific table:</p>
  
  <pre><code>from flask_sqlalchemy import SQLAlchemy
  from flask import Flask
  from flask_restful import Api
  from flask_cors import CORS
  from flask_jwt_extended import JWTManager
  import os
  from dotenv import load_dotenv
  load_dotenv(verbose=True)
  
  app = Flask(__name__)
  CORS(app)
  app.config['SECRET_KEY'] = os.getenv('SECRET_KEY')
  app.config['JWT_SECRET_KEY'] = os.getenv('SECRET_KEY')
  app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('SQLALCHEMY_DATABASE_URI')
  app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
  app.config['JWT_BLACKLIST_ENABLED'] = True
  app.config['JWT_BLACKLIST_TOKEN_CHECKS'] = ['access', 'refresh']
  db = SQLAlchemy(app)
  api = Api(app)
  jwt = JWTManager(app)
  </code></pre>
  
  <p>My DB URI string looks like this:</p>
  
  <pre><code>SQLALCHEMY_DATABASE_URI="oracle+cx_oracle://username:password@db_url/dbName"
  </code></pre>
  
  <p>This is stored in an environment variable and I don't use string formatting to fill in those portions of username, password, etc (I have them hard coded I just removed them for security reasons)</p>
  
  <p>And now the class I am trying to create the connection with:</p>
  
  <pre><code>from App import db
  
  
  class EventModel(db.Model):
      __tablename__ = 'SCHEMA_NAME.TABLE_NAME'
  
      RC_ID = db.Column(db.Integer, primary_key=True)
      PRODUCT_ID = db.Column(db.Integer)
      RELEASE_ID = db.Column(db.Integer)
      RCPM_ID = db.Column(db.Integer)
      FIT_DTTM = db.Column(db.String(25))
      DATACTR_ID = db.Column(db.String(10))
      COMMENT_TXT = db.Column(db.String(500))
      DESCR_TXT = db.Column(db.String(300))
      EVENTCMPLT_FLG = db.Column(db.String(1))
      EVENTCMPLTONTM_FLG = db.Column(db.String(1))
      ATTACHMENTS_FLG = db.Column(db.String(1))
      UUID = db.Column(db.Integer)
      URLS = db.Column(db.String(4000))
  </code></pre>
  
  <p>again the table portion I renamed for security reasons.</p>
  
  <p>I attempted to attach the schema name also to the DB URI I store in my environment variable. I always get this error:</p>
  
  <pre><code>sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) ORA-12505: TNS:listener does not currently know of
          SID given in connect descriptor
  </code></pre>
  
  <p>I appreciate everyone's assistance. I normally work with postgres and the project I am converting my normal method to is using an oracle db.</p>