Oracle

Call to undefined function ocilogon() - IIS 7.5 - Windows 2008 R2 x64 - PHP 7.2.7

跟風遠走 提交于 2021-01-28 11:12:52
问题 I am migrating a website from a development environment (Angular 4 - WAMP Server - PHP 5.6.35) to a production environment. In development, the Angular 4 application was successfully able to connect to a PHP script and run an Oracle stored procedure so there are no issues with the code. In production, I've had to install PHP using the Web Platform Installer to successfully run a PHP site with phpinfo() showing 'PHP Version 7.2.7'. I run the application and when it attempts to run the PHP

cx_Oracle.DatabaseError: ORA-12170: TNS:Connect timeout occurred

依然范特西╮ 提交于 2021-01-28 11:11:53
问题 I am getting cx_Oracle.DatabaseError: ORA-12170: TNS:Connect timeout occurred error while connecting oracle from python. I have installed python 3.7.0 and instantclient_11_2. Below are the process i am doing, import cx_Oracle dsn_tns = cx_Oracle.makedsn( '<ip>', 1521, service_name = '<given service name>') connection = cx_Oracle.connect('user', 'pwd', dsn_tns) I have set system veriable PATH where oci.dll is present. What could be wrong? 回答1: Try: connection = cx_Oracle.connect('user', 'pwd',

Oracle SQL conditional ranking

断了今生、忘了曾经 提交于 2021-01-28 09:51:14
问题 In my query, I am doing multiple types of ranking and for one of ranking types, I want to rank the row only if certain column is not null. Else I don't want ranking to happen. For example here's a sample table: +------+------------+------------+--------+--------+ | col1 | col2 | col3 | rank 1 | rank 2 | +------+------------+------------+--------+--------+ | a | 2018-01-20 | 2018-03-04 | 2 | 2 | | a | 2018-01-24 | 2018-04-04 | 1 | 1 | | b | 2018-01-02 | 2018-05-03 | 1 | 1 | | c | 2017-01-02 |

Oracle SQL conditional ranking

泪湿孤枕 提交于 2021-01-28 09:46:43
问题 In my query, I am doing multiple types of ranking and for one of ranking types, I want to rank the row only if certain column is not null. Else I don't want ranking to happen. For example here's a sample table: +------+------------+------------+--------+--------+ | col1 | col2 | col3 | rank 1 | rank 2 | +------+------------+------------+--------+--------+ | a | 2018-01-20 | 2018-03-04 | 2 | 2 | | a | 2018-01-24 | 2018-04-04 | 1 | 1 | | b | 2018-01-02 | 2018-05-03 | 1 | 1 | | c | 2017-01-02 |

Implementing Type 2 SCD in Oracle

时光怂恿深爱的人放手 提交于 2021-01-28 07:28:29
问题 First I would like to say that I am new to the stackoverflow community and relatively new to SQL itself and so please pardon me If I didn't format my question right or didn't state my requirements clearly. I am trying to implement a type 2 SCD in Oracle. The structure of the source table ( customer_records ) is given below. CREATE TABLE customer_records( day date, snapshot_day number, vendor_id number, customer_id number, rank number ); INSERT INTO customer_records (day,snapshot_day,vendor_id

Use like '%' and match NULL values with NUMBER columns

感情迁移 提交于 2021-01-28 07:09:45
问题 This question is almost exactly like mine but none of the answers work with my case. If it was my question I'd slightly edit it to make it a different question. This question is thus different from the linked one. Here's the problem: I want a way to match any non-null value ( '%' ) AND null values. The thing is: I'm using oracle so I can't use IsNull Some columns are NUMBER s, which means I can't use COALESCE(column, ' ') . ( ORA-00932: inconsistent datatypes: expected NUMBER got CHAR ).

“Invalid connection string format” error when trying to connect to Oracle using TNS alias that contains dot character

匆匆过客 提交于 2021-01-28 06:56:46
问题 I am trying to connect to Oracle database using TNS. The problem is that TNS alias contains dot, so when I am specifying url like this: jdbc:oracle:thin:@TNS.ALIAS I've got... oracle.net.ns.NetException: Invalid connection string format, a valid format is: "host:port:sid" ...during creation of connection. I know that dot character is a problem, because after removing it from tnsnames.ora file connection to database works. My question is - is it possible to escape dot character somehow? Maybe

Getting date in oracle from timestamp without trailing o's?

狂风中的少年 提交于 2021-01-28 06:48:58
问题 I have been scouring stack and google to find a way to extract a date from timestamp w/o the trailing zero's still being a date and NOT a VARCHAR variable- for example: SELECT TRUNC(to_date('2012-07-18 13:27:18', 'YYYY-MM-DD HH24:MI:SS')) FROM DUAL gives: 18-JUL-12 00:00:00 I want it in '18/07/2012' date format in the end. TIA in advance if this is possible. 回答1: I have been scouring stack and google to find a way to extract a date from timestamp w/o the trailing zero's still being a date and

Java Catch and Display SqlExceptionHelper

二次信任 提交于 2021-01-28 06:45:00
问题 Using Hibernate JPA to execute native queries in Oracle DB due to their complexity, I want to catch an exception like " ORA-01722: Nombre non valide " thrown from SqlExceptionHelper class, but what was catching is: class javax.persistence.PersistenceException: could not extract ResultSet The logger error trace me that but not catched : jdbc.spi.SqlExceptionHelper : ORA-01722: Nombre non valide BigDecimal customerId = null; try { Query q = entityManager.createNativeQuery( "select acc.account

How can i get first value of each hours? ORACLE

不想你离开。 提交于 2021-01-28 06:29:32
问题 id date value 1 08.03.2015 20:01:47 1383322 2 08.03.2015 20:14:01 1383382 3 08.03.2015 20:19:17 1383412 4 08.03.2015 20:22:45 1383441 5 08.03.2015 20:35:55 1383551 6 08.03.2015 20:42:43 1383604 7 08.03.2015 20:44:56 1383630 8 08.03.2015 21:08:17 1383880 9 08.03.2015 21:16:36 1383959 10 08.03.2015 22:37:48 1384613 11 08.03.2015 22:40:12 1384642 12 08.03.2015 22:42:25 1384667 13 08.03.2015 22:44:38 1384696 14 08.03.2015 22:46:51 1384721 15 08.03.2015 22:49:58 1384752 16 08.03.2015 22:52:17