oracle-sqldeveloper

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

SQL query in VBA, code stored in several cells in Excel

帅比萌擦擦* 提交于 2019-12-12 04:11:32
问题 I'm trying to write VBA code that allows user input (e.g change date) in Excel before retrieving data through SQL. The code works fine as long as I store the SQL query in a single cell. However, the SQL query includes 62 lines, so editing it inside a single cell is not optimal. I would like to split up the SQL code to 1 line per row in Excel, allowing for easier editing. The SQL code is currently stored in the "SQL" sheet, in cell "A1". Any ideas how to make this work with multiple rows/cells

Importing 360,000 rows into a Global Temporary Table

谁说胖子不能爱 提交于 2019-12-12 04:08:05
问题 I'm having some issues importing a list of numbers into a Global Temporary Table that I created. The Problem: When importing data into a Global Temporary Table, nothing will show up in the desired column even though there is a success message prompt. Previous Effort: I'm currently using the Data Import Wizard method to do this. I tried importing from a .txt, but it gave me a null error. I tried importing from .xlsx but it gives me the Java heap space error. I tried renaming my .txt file into

Oracle SQL first and last day of quarter of any year

随声附和 提交于 2019-12-12 04:05:31
问题 Is there any way i can calculate the first and last day of the three quarters in any year . 2012 , 2013 or 2014 SELECT ADD_MONTHS(TRUNC(SYSDATE, 'Q'), -3) AS First, TRUNC(SYSDATE, 'Q') - 1 AS Last FROM DUAL calculates the first quarter of current year. i want to calculate the first quarter of any year ? 回答1: You could do the following: with q(qtr) as( select add_months( DATE '2013-01-01' , (level-1)*3 ) from dual connect by level <= 4 ) select qtr as first_day , last_day(add_months(qtr, 2))

Cannot create new connection or login to added user?

时光怂恿深爱的人放手 提交于 2019-12-12 03:42:03
问题 I am using Oracle SQL Developer to connect to Oracle Express 11g and create a new user. I keep on getting the same error when I try to create a new connection (and test it) or when I try to login with a newly created username and password (mad by right-clicking "other users" table in default connection "xe") The error- Failure - Test Failed: ORA-01017: invalid username/password; logon denied How can I fix this issue ? 回答1: Seems you're using an user with not enough privilegies, try with

SQL ranking multiple groups

梦想的初衷 提交于 2019-12-12 03:38:01
问题 For a project I was asked to design a DB for a small Olympic games. This is the ER diagram I made for the DB. For one of the required queries, I need to list the sport, event, name, country, and result(medal) for everyone. So far the only problem I am having is ranking(assigning GOLD, SILVER, or BRONZE) each of the results based only on others in the same event. My query so far: SELECT cy.countryname COUNTRY, c.firstname || ' ' || c.lastname "COMPETITOR", s.sportname, e.eventname EVENT, rs

SQL optimization with indexes

杀马特。学长 韩版系。学妹 提交于 2019-12-12 03:36:18
问题 I have been trying hard to optimize below query using indexes in place of where clause. can any one help on the same. Data volume is very high so I want to optimize it using indexing or anyother way? Query goes like this: SELECT * FROM (SELECT a.*, rownum as row_num FROM (SELECT DISTINCT lot.lot_no AS lotNo, lot.sel as sel, lot.C_ARRIVAL_NOTICE_NO AS arrNoticeNo, lot.C_SHIPMENT_DIRECTION AS shipmentDirection, lot.C_SENDERS_REFERENCE_NUM AS externalReference, lot.booking_seq AS bookingNo,lot

Difference between Oracle XE v SQL Developer [closed]

六眼飞鱼酱① 提交于 2019-12-12 02:57:40
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I am confused between Oracle XE and SQL Developer? What is the main difference between the two? I am assuming that Oracle XE is the database while SQL Developer is like an IDE to perform queries ? 回答1: Oracle XE is a database server. SQL Developer is a client. The client (SQL

Vagrant MySQL Access

China☆狼群 提交于 2019-12-12 02:25:17
问题 So I am new to this vagrant vm creation (and am really liking it). I am using puphpet to make the config. Everything is working great. Access to the shared folders, ssh and access to the website (Apache server). The last piece I cannot seem to get figured out is the database part. When using php I can connect but to do the actual development on my database I prefer to use sqldeveloper (I have tried workbench). No matter what I enter I cannot seem to get a connection. No matter the user ip or

Oracle SQL to_date & to_timestamp ORA-01858: a non-numeric character was found where a numeric was expected & ORA-01850: hour must be between 0 and 23

烂漫一生 提交于 2019-12-12 02:18:04
问题 I have a small bit of code: Code SELECT to_date(it.DSTAMP, 'DD/MM/YYYY') AS "Date", to_timestamp(it.DSTAMP, 'HH24:MI:SS') AS Time FROM itable it Errors ORA-01858: a non-numeric character was found where a numeric was expected 01858. 00000 - "a non-numeric character was found where a numeric was expected" *Cause: The input data to be converted using a date format model was incorrect. The input data did not contain a number where a number was required by the format model. *Action: Fix the input