oracle11g

Convert LDAP Date in SQL (milliseconds to nanoseconds)

时光怂恿深爱的人放手 提交于 2019-12-11 11:43:36
问题 I am getting date in milliseconds format. i.e.: 1427342400000 is essentially 3/26/2015 . Now I want to further convert date in nanoseconds and pass this value in accountexpires attribute in Active Directory. What is the query to convert milliseconds date to nanoseconds date? Any help would be greatly appreciated. 回答1: Now I want to further convert date in nanoseconds Ok, but convert to nano seconds since when? Looking at your example, I assume the start point to be '01-JAN-1970' . If I want

can oci driver for 11g (odbc5.jar) work with 10g client?

我的未来我决定 提交于 2019-12-11 11:36:49
问题 I need to connect to Oracle9,10 and 11 in my java application.The client will always be present where the app will be run and I want the app to just work with username,password and instance (specified in tnsnames.ora).Hence I would like oci drivers with a connection string of type : jdbc:oracle:oci:@testora .Im using the driver: oracle.jdbc.driver.OracleDriver. I have a 10g client and am using jdk1.5. When I use the ojdbc14 jar from client lib path the app runs. But if I use the ojdbc5 driver

splitting comma separated list into a temp table

本秂侑毒 提交于 2019-12-11 11:18:54
问题 I want to convert the following IN query into inner join query : select country, name, rank from table person_details where country in ('india','USA','australia') and name in ('tom', 'jill', 'jack') and rank in ('first', 'third', 'fifith'); I have two questions: this table is big so will changing this IN query into inner join will speed up things. What will be best way to split this comma separated list to a column in some temp table. I have see many regex examples but they seem too complex

split string based on character position in ORACLE 11g SQL

∥☆過路亽.° 提交于 2019-12-11 11:16:15
问题 I'm using oracle 11g sql developer I have a varchar2 column with dates as 0523 (mmDD). I want to convert them to a date column and have them look like 23-05 (dd-mm).. Any ideas? 回答1: Well, you can do string operations directly to get the format you want: substring(c, 3, 2)||'-'||substring(c, 1, 2) To convert to a date, you can use: to_date('2012'||c, 'YYYYMMDD') To convert a date back to the form you want: to_char(<date>, 'DD-MM') 来源: https://stackoverflow.com/questions/11231161/split-string

How to get details for rows that do not exists in the table ? Caught up with an strange situation

China☆狼群 提交于 2019-12-11 11:06:51
问题 I was caught up with an strange situation. Here it is, We have table with 2 million records where MSISDN is of type string ,unique and not null. I was requested to get details of 300 known MSISDN's and so the query used is, select * from table_name where msisdn in ('msisdn1','msisdn2',......'msisdn300') but unfortunately the above query returns only 200 count. How to find out those 100 that do no exists from 300 given in the query? I can use only select query due to limited privileges. Please

Does oracle provide a built-in currency table for me to use as constraints?

若如初见. 提交于 2019-12-11 10:42:43
问题 I'm creating a table in Oracle 11g like this: CREATE TABLE EXAMPLE ( ID VARCHAR2(10) PRIMARY KEY, NAME VARCHAR2(100), SHORT VARCHAR2(50), CURRENCY CHAR(3) ); Is it possible to create a foreign key constraint or even a check constraint on CURRENCY to a built-in Oracle table that contains the ISO currencies? Not having a great understanding of databases I also take as input other solutions that might be out there, however I do not want to maintain my own table for this, if it's too much work, I

Oracle 11g - Running PL/SQL Cursors

淺唱寂寞╮ 提交于 2019-12-11 10:37:13
问题 I'm trying to run this code on Oracle 11g and it's giving me the error below. I can't seem to get it right. DECLARE CURSOR bookcursor IS SELECT btName, BookCopy.Isbn, pubName, dateDestroyed FROM booktitle bt JOIN publisher p ON bt.pubId = p.pubId JOIN bookcopy bc ON bt.Isbn = bc.Isbn WHERE datedestroyed IS NULL ; bookcursorrec bookcursor%ROWTYPE; BEGIN OPEN bookcursor; LOOP FETCH bookcursor INTO bookcursorrer; EXIT WHEN bookcursor%NOTFOUND; dbms_output.put_line( 'ISBN: ' ||bookcursorrec.isbn

ORA-01830 - date format picture ends… - but only in where clause - not in select

大兔子大兔子 提交于 2019-12-11 10:24:30
问题 I created an easier to test post here: ORA-01847 day of month must be between 1 and last day of month - but data is OK Problem solution described there It took me hours to search for a comparable issue in the web - finally i think only you out there can help me. I send my Query to Oracle 11 via SQL developer. You may ignore the complete subselect (its in pastebin) - i added a dump of each column to see details. I got big Problems when comparing timestamps in where clause: here my basic sql

PLSQL: Alternative to Stored Procedure for optimal performance

南笙酒味 提交于 2019-12-11 10:16:40
问题 I have been asked to provide an optimal approach to perform following task, We have a view which extract data from multiple tables and we have to perform some business logic to these extracted data and then insert the processed data into an another table. Problem here is that the View is very complicated and on execution extracts 40 Millions of records which itself takes a lots of time in execution. But out of these many records we have to perform logic on approx 25 millions of records. For

Oracle 11g configuration with Enterprise manager on windows 2008 standard R2

杀马特。学长 韩版系。学妹 提交于 2019-12-11 10:11:20
问题 I am trying to install Oracle 11g on windows 2008 standard server R2 (as standalone). I get successful installation as I can connect to sqlplus. But when I try to run the "Enterprise manager" through the EM url on https I see a login page...I try to enter "SYS" then password then select role as SysDBA" and then I get the following error. "Internal Error has occurred. Check the log file for details." I have been searching forums like crazy since last one week and tried all solutions but no