oracle10g

Oracle Query For opening and closing balance [closed]

a 夏天 提交于 2019-12-12 05:24:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . hi i have following table and data to get opening and closing balance of every account opening balance required gdate<02-oct-2013 here is my table create table ledger (account_no varchar2(10),gdate date,debit number(8),credit number(8)) insert into ledger (account_no,gdate,debit,credit) values ('10-0001','01-oct

String splitting in PL/SQL

拟墨画扇 提交于 2019-12-12 05:07:43
问题 I have a table like this in oracle: servername description ObjectState ----------------------------------------------------------------------------------------- vm1 SP LA - W IN S V R S #P19 99 9999 999999 999 QTY 1 0 VM2 S PL A - V R STD #P29-9 9 99 QTY 2 : SPLVRENT #P3 999999 9 QTY 3 1 etc I want the output like this servername description ponumber qty objectstate -------------------------------------------------------------------------------------- vm1 SP LA - W IN S V R S P19 99 9999

Find Records from Different Tables [closed]

柔情痞子 提交于 2019-12-12 04:48:14
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . Requirement Find and display all pilots (employee ID and name) who implemented flights on the planes of 'Commuter' type and ‘Normal’ type. 1st image is

Insert a text file into Oracle with Bulk Insert

和自甴很熟 提交于 2019-12-12 04:39:20
问题 I have a place.file text file; place.file New Hampshire New Jersey New Mexico Nevada New York Ohio Oklahoma .... There are 4000 place names in this file. I will match my my_place table in oracle and place.file . So I want to insert the place.file into the Oracle . Maybe I should use bulk insert, how can I do bulk insert ? 回答1: No mention of an Oracle version. (For the best possible answer, always include Oracle version, Oracle edition, OS, and OS version.) However, you should investigate

Is there any way to keep a track of rows inserted by a oracle function in database

自古美人都是妖i 提交于 2019-12-12 04:32:03
问题 I have a procedure to update the balance from start date to end date and also I want to keep a track of number of records being inserted . I am using dbms_output.put_line to get the number of records inserted but it does not give any output , when the execution completes then the output of the count is being displayed. The code of procedure is as follows : create or replace function updatebal(start_date IN DATE, end_date IN DATE) RETURN NUMBER IS difference number; curr_r number; BEGIN

Alternate of sql server TOP in oracle

為{幸葍}努か 提交于 2019-12-12 03:30:45
问题 How to get top 3 records in oracle pl sql?i am new to oracle,earlier i have used sql server. My requirement is to get distinct top 3 records of Column X. 回答1: Try this to retrieve the Top N records from a query, you can use the following syntax::- SELECT * FROM (your ordered query) alias_name WHERE rownum <= Rows_to_return Example:- SELECT * FROM (select * from suppliers ORDER BY supplier_name) suppliers2 WHERE rownum <= 3 回答2: This may help you SELECT ename, sal FROM ( SELECT ename, sal,

Oracle DB and SecureString

纵然是瞬间 提交于 2019-12-12 03:16:47
问题 I am currently storing the user password in a SecureString . Which is also kept around in case the connection to the DB resets. My problem is, I'm trying to pass this password to an OracleParamater , but I'm not sure if it supports it or not. Does Oracle's Oracle.DataAccess dll support SecureString or BStr ? Since If I have to convert it to a string then that would kinda defeat the purpose of SecureString . --- EDIT I know that SecureString is about reducing the attack surface by keeping as

How to remove duplicate rows in SQL

痞子三分冷 提交于 2019-12-12 02:58:09
问题 I want to remove duplicate rows in the following data. Data: a a a b a c a d a e b a b b b c b d b e c a c b c c c d c e d a d b d c d d d e e a e b e c e d e e The output should be column1 and column2 different. and it should not be the following data. a b a c a d a e b a b c b d b e c a c b c d c e d a d b d c d e e a e b e c e d because a in column 1 and b in column2 is same as b in column1 and a in column2 or else simply i mean to say 1+2 is same as 2+1. So, the output should be a,b a,c a

Unpivot on view is not working in Oracle

妖精的绣舞 提交于 2019-12-12 02:49:31
问题 I have the below query select distinct cd, nm, case when parent=cd then 0 else parent end as parent, lvl from ( select * from mytable unpivot ( (cd, nm, parent) for lvl in ((CD_1, NM_1, CD_1) as 1,(CD_2, NM_2, CD_1) as 2,(CD_3, NM_3, CD_2) as 3,(CD_4, NM_4, CD_3) as 4, (CD_5, NM_5, CD_4) as 5) ) ) order by lvl; If mytable is a table this is working fine. Basically my source is a view , if replace the mytable with my view its throwing an error ORA-00933 : SQL command not properly ended. Any

What happens to existing tables during import using impdp

拥有回忆 提交于 2019-12-12 02:39:44
问题 I want to export and import an entire schema from Prod to Dev, but Dev has already existing tables (that are not there in Prod) which I don't want to be affected. So, the question is during import (impdp) what happens to those existing tables? thanks. 回答1: if you have backuped full database including create database and create tables queries in backup then there occurs error. To solve the problem you needs to remove each line that is intented to create database and new table. if you have