oracle11g

Convert Number into Words in the Indian Numbering System

六月ゝ 毕业季﹏ 提交于 2019-12-11 15:47:18
问题 I am converting numbers to words with this code select to_char(to_date(:number,'j'),'jsp') from dual; when I enter value 100000 then output is One Hundred Thousand but I want output show: One Lac How to handle it? 回答1: SQL Fiddle Oracle 11g R2 Schema Setup : CREATE TABLE numbers ( value ) AS SELECT 0 FROM DUAL UNION ALL SELECT 123456 FROM DUAL UNION ALL SELECT 12345678 FROM DUAL UNION ALL SELECT 1234567890123 FROM DUAL UNION ALL SELECT 123456789012345 FROM DUAL UNION ALL SELECT

php oci8 ext not loading Unable to load dynamic library

我的梦境 提交于 2019-12-11 15:44:37
问题 I am trying to connect my PHP 7.0 with Oracle database(11g release 2) for that I download dll files of oci8 extension from https://pecl.php.net/package/oci8/2.1.7/windows and copy php_oci8.dll and php_oci8_11g.dll in my xampp/php/ext after that I restart my xampp server. My System type is: 64bit operating system x64 based processor when using 7.0 Non Thread Safe (NTS) x64 extension getting this error on cmd when using 7.0 Non Thread Safe (NTS) x84 extension getting this error on cmd why these

Convert wkt to oracle geometry

﹥>﹥吖頭↗ 提交于 2019-12-11 15:33:52
问题 How to convert wkt to oracle sql I am using: SELECT SDO_GEOMETRY('POINT(-121.909315288067 37.3618668002592)',4326) as station_geom_oracle FROM dual i got MDSYS.SDO_GEOMETRY Run on: Java(TM) Platform 1.8.0_151 Oracle IDE 19.1.0.094.2042 Versioning Support 19.1.0.094.2042 回答1: I came here from your other question, and you've done it right. The query result is just telling you that you've created a geometry object. There's no way of showing a geometry object in a table so it just gives the data

Calculate the difference between the value in different rows and columns

回眸只為那壹抹淺笑 提交于 2019-12-11 15:33:20
问题 Please help me in solving the below query. Suppose if I have a table name as Data with 3 rows: Date1, Date2 and visit window. I need to calculate Visit window value. It should be the difference of (n+1)th row of date 1 and nth row of date2. For ex: Difference of 2nd row value of Date1 and 1st row of date2 value divided by 7. Please help. Table: Data ------------ Date1 Date2 VW 13-DEC-2011 15-DEC-2011 ? 18-DEC-2011 16-DEC-2011 ? 21-DEC-2011 24-DEC-2011 ? Thanks 回答1: select Date1, Date2, lead

How to select the column names of a table where column data contains '%' in the values?

你离开我真会死。 提交于 2019-12-11 15:31:24
问题 How to select the column names of a table where column data contains '%' in the values? Eg: In the table COMP there are two columns(Addr, Comp_Name) which has data containing '%' in its string. So my query should return those column_names(Addr, Comp_Name) 回答1: I dont get you right but i thing this will help you You can use the escape identifier --Queries -- for % select * from test_a where col1 like '%\%%' escape '\'; --for _ select * from test_a where col1 like '%\_%' escape '\'; 来源: https:/

CompositeItemWriter by using delegates insert(JdbcBatchItemWriter) into 2 tables with FK relation

左心房为你撑大大i 提交于 2019-12-11 15:29:02
问题 I'm using spring batch with java annotation. This batch is required read file, process and insert into table. Basically I have done itemReader , itemProcessor and userItemWriter with commit-interval equal to 1. My question is: How to insert PK of User table to UserDetail table? @Bean public UserItemWriter userItemWriter() { UserItemWriter itemWriter = new UserItemWriter(); List<ItemWriter<? super UserBO>> delegates = new ArrayList<>(); delegates.add( userDelegates() ); delegates.add(

Oracle - Get data from past year (Dynamic)

最后都变了- 提交于 2019-12-11 15:25:36
问题 i have some question regarding about get data from database which need to fetch from past year ( dynamic , not hard-coded ) Table: BookingTable bookingID userID Timebooked 1 0003 10-May-2016 2 0001 10-May-2018 3 0001 10-Apr-2017 4 0001 10-Apr-2017 5 0003 10-Jan-2011 6 0006 10-Apr-2018 7 0003 10-Apr-2016 8 0006 10-Apr-2015 9 0001 10-Apr-2017 This is my code below SELECT userID, COUNT(userID) AS count FROM BookingTable GROUP BY userID HAVING COUNT(userID) >2 Here is the result from my query

How to get a specific record from a table as the last record? [duplicate]

拥有回忆 提交于 2019-12-11 15:19:24
问题 This question already has answers here : Sliding certain records to the end of a run of the same date (3 answers) Closed 2 years ago . For example, I have a table in Oracle db where the values in a column are: A B C D I would like to fetch the following output from the table(here, B,C,D are in alphabetical order and A is put to the last): B C D A Note: They have a unique key with the column if that helps. 回答1: Have a case expression in the ORDER BY to put A rows at the end: order by case when

Regex: Get nth character between two delimiters

ぐ巨炮叔叔 提交于 2019-12-11 15:17:44
问题 I have an example string 1836248_NNY_01.pdf but it can also be 18362481_YYN_102.pdf And I need to get the nth character between the two underscores. So far my regex is \_(.*?)\_ to get the characters between the underscores. But following up I can't figure out how to get the 2nd N for example. https://regex101.com/r/XUMKyf/1/ 回答1: You could use \_.{1}(.).*\_ and replace the 1 with whatever you want. So 0 would be the first char, 1 the second, and so on. Example: https://regex101.com/r/XUMKyf

Bulk insert using FORALL in Oracle

僤鯓⒐⒋嵵緔 提交于 2019-12-11 15:14:50
问题 I am currently using the following code to do a bulk insert of 50 million rows: declare cnt number; BEGIN select max(run_ver_issue_id) into cnt from "ABHINAV"."MV_RUN_VER_ISSUE"; FOR x IN 1 .. 50000000 LOOP INSERT INTO "ABHINAV"."MV_RUN_VER_ISSUE" NOLOGGING ("RUN_VER_ISSUE_ID","CUST_ISSUE_ID","TITLE","ORIGINAL_ISSUE_ID","SOURCE_FILE_LINE","DISPLAY_TEXT","RUN_VER_ID","SANDBOX_SRC_FILE_ID","ACCOUNT_ID","ISSUE_STATE","CURRENT_SEVERITY","INSERT_TS","MODIFIED_TS","CWE_ID","TEMPLATE_FILE_ID",