Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Oracle 12.2 ODBC driver installation on MacOS with unixodbc

dseverskiFeb 9 2018 — edited Feb 23 2018

I've had a devil of a time figuring out how to get the 12.2 Oracle Instant Client (Basic Lite) and ODBC drivers working under MacOS Sierra. Repeating some content from https://stackoverflow.com/questions/48635297/how-to-get-macos-oracle-odbc-client-working-with-unixodbc , I've extracted the Basic Lite client and ODBC file to /opt/ora12/ and setup the symlinks to /usr/local/lib, but when I point a DSN to the libsqora library, the connections always fail. Looking at the lib with `otool -L` it looks like some of the dependencies are not being followed, specifically all those linked with `@rpath`. If I pull down the 12.2 SQLPlus client, extract that into /opt/ora12, that is able to find all the libraries fine, but I don't know how to get unixODBC to do the same when it's @rpath doesn't know about my /opt/ora12 location.

Any pointers/docs on where I'm going wrong would be super appreciated. I'm not very familiar with DYLIB loading under MacOS so I'm likely misunderstanding something basic here.

David

This post has been answered by Sdhamoth-Oracle on Feb 20 2018
Jump to Answer

Comments

KarK
Answer

Your query has syntax error apart from the logic:

Try the below:

select * from

(

select dept,sales,

--activemonth,

rtrim(to_char(activemonth,'Month')) as currentM,

length(rtrim(to_char(activemonth,'Month'))) as length1

from dateorder

)

pivot

(

  sum(sales) as total

  for currentM in ('March')

);

OUTPUT:

DEPT           LENGTH1 'March'_TOTAL

----------- ---------- -------------

Stationery           7

Books                8

Toys                 7

Toys                 8

Toys                 3

Stationery           4

China                7

Books                5         82.34

Books                7

Toys                 4

China                3

DEPT           LENGTH1 'March'_TOTAL

----------- ---------- -------------

Stationery           8

Stationery           3

13 rows selected.

Marked as Answer by user8167598 · Sep 27 2020
Partha Sarathy S

Try this.

select * from (

select dept,sales,

--activemonth,

rtrim(to_char(activemonth,'Month')) as currentM,

length(rtrim(to_char(activemonth,'Month'))) as length1

from dateorder)

pivot

(

  sum(sales) as total

  for currentM in ('March')

);


Don't know what you are trying to achieve, but it would be better to do like this.

select DEPT,

       LENGTH1,

       NVL("'March'_TOTAL",0)

from (

select dept,sales,

--activemonth,

rtrim(to_char(activemonth,'Month')) as currentM,

length(rtrim(to_char(activemonth,'Month'))) as length1

from dateorder)

pivot

(

  sum(sales) as total

  for currentM in ('March')

);

AnnEdmund

You mean this?

SELECT dept,

       SUM(DECODE(currentM,'March',sales)) Total,

       currentM

FROM(SELECT dept,

       sales,

       to_char(activemonth,'fmMonth') AS currentM

FROM DATEORDER)

WHERE currentM = 'March'

GROUP BY dept,currentM;


OUTPUT:-

DEPT         TOTAL CURRENTM

----------- ---------- ---------

Books        82.34 March
AnnEdmund

Like this with PIVOT? If this is not your requirement then tell your requirement and expected output

SELECT *

FROM(SELECT dept,

       sales,

       to_char(activemonth,'fmMonth') AS currentM

FROM DATEORDER)

PIVOT(SUM(sales) Total FOR currentM IN('March'))


OUTPUT:-

-------

DEPT    'March'_TOTAL

----------- -------------

Stationery

China

Books           82.34

Toys

user8167598

Thanks ! I should have gone to spec savers !

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 23 2018
Added on Feb 9 2018
11 comments
7,589 views