Would love to see an Ecto adapter for Oracle

Can someone please please please create an adapter for oracle :041:

1 Like

Ive been using this:

Works pretty well.

7 Likes

The above jamdb_oracle is great, but I’ve actually been using the oracle foreign data wrapper for PostgreSQL (it lets you access an oracle system ‘through’ postgresql just like they are native postgresql tables ^.^).

4 Likes

DO you have a few samples of jamdb that you would share.

Thanks
Bryan

I don’t use it currently as I just use the PostgreSQL foreign data wrapper instead (I bring in a few databases, and talking with one is sooo much easier when you need to join across them). ^.^;

Is there something that their docs or code isn’t making clear though?

Thanks for the help,

I have a few queries with lots of where clause baggage.

I am not sure the best way to build the select and use variables for the endtime , timername,

sample:

SELECT TRUNC(t.endtime)+FLOOR(TO_CHAR(t.endtime,‘sssss’)/300)300/86400 AS time
, AVG(t.elapsedtime) AS avg__value, median(t.elapsedtime) AS med_value, count(
) as rcount
FROM uabrtms t
WHERE t.endtime IS NOT NULL and

(endtime > to_date(‘2019-07-09 06’, ‘YYYY-MM-DD HH24:MI:SS’)
and endtime < to_date(‘2019-07-09 20’, ‘YYYY-MM-DD HH24:MI:SS’))

  and timername like '%APPLICATION STARTUP%'
  GROUP BY TRUNC(t.endtime)+FLOOR(TO_CHAR(t.endtime,'sssss')/300)*300/86400

ORDER BY TRUNC(t.endtime)+FLOOR(TO_CHAR(t.endtime,‘sssss’)/300)*300/8640

I’m guessing you meant this SQL?

SELECT
  TRUNC(t.endtime)+FLOOR(TO_CHAR(t.endtime,‘sssss’)/300)300/86400 AS time,
  AVG(t.elapsedtime) AS avg__value,
  median(t.elapsedtime) AS med_value,
  count() as rcount
FROM uabrtms t
WHERE
  t.endtime IS NOT NULL and
  ( endtime > to_date(‘2019-07-09 06’, ‘YYYY-MM-DD HH24:MI:SS’)
    and endtime < to_date(‘2019-07-09 20’, ‘YYYY-MM-DD HH24:MI:SS’)
  )
  and timername like '%APPLICATION STARTUP%'
GROUP BY TRUNC(t.endtime)+FLOOR(TO_CHAR(t.endtime,'sssss')/300)*300/86400
ORDER BY TRUNC(t.endtime)+FLOOR(TO_CHAR(t.endtime,‘sssss’)/300)*300/8640

What code have you tried so far and what error are you getting? You should be able to just query as normal:

:jamdb_oracle.sql_query(db_conn, {"<put your SQL here>",[args]})

And in your SQL you just replace the parts with the parameters you want to feed in with things like :1 and :2 and so forth for the indexed entries (1 indexed), then pass the args into it with the list. Seeing what you’ve tried so far and with what input in and what you expect out would help in wanting to know what you are actually wanting. :slight_smile:

2 Likes

We’ve found the pain of having people install the FDW to be so much that jamdb_oracle and ETLing the data into our postgres is a more maintainable solution. YMMV

2 Likes

The author of oranif

is currently working on an Elixir Ecto Adapter for Oracle. He’s just started, and has been informing us of his progress on this thread:

4 Likes

Bad URL?

3 Likes

Thank you. Corrected above

2 Likes