oracle11g

How to get comma separated values inside Oracle stored procedure

橙三吉。 提交于 2019-12-14 03:12:00
问题 I have to pass FlightDate , FlightNumbers as parameters to Oracle Stored procedure like below. CREATE OR REPLACE PROCEDURE GetPaxDetails( FlyingDate IN PAX_DETAILS.FlightDate%TYPE, FlightNumbers IN VARCHAR(300)) IS BEGIN -- Assume that we've received **FlightNumbers** as '0620,0712,0154' -- Basically I am trying to select all passenger details (PAX_DETAILS) -- for those flights passed in as a parameter(**FlightNumbers**) -- for the specified dates -- In this procedure the query should be

Foreign Key Constraint in oracle

僤鯓⒐⒋嵵緔 提交于 2019-12-14 03:11:45
问题 I have two tables Cal and EEL I want to use the primary key of cal that is Cal_id as the foreign key for EEl Here's what I tried. Create table ELL (course_code varcahr2(10) Constraints pk_course_code Primary Key, Course_Title varchar2(30), cal2_idnumber not null, Constraint fk_cal2 Foreign Key (cal_id) References cal_id(cal2_id) ) but it shows error at line 6 Ora-00904 "Cal_ID" invalid character can someone tell me how to do this 回答1: ALTER TABLE table_name add CONSTRAINT constraint_name

How to extract data from three tables using SQL object relational statement in oracle 11g

泄露秘密 提交于 2019-12-14 03:01:01
问题 I have three tables Branch, Account_table and customer. I am trying to write a SQL statement for: At each branch find customers who have the highest balance in their savings account. Displaying their names, the balance, the branch ID and the free overdraft limit in their current accounts. I have created three tables and insert data: Branch Table BID BADDRESS.STREET BADDRESS.CITY BADDRESS.P ---------- -------------------- -------------------- ---------- 901 Nicholson Street Edinburgh EH11 5AB

TO_DATE yy,yyyy gives me different results

给你一囗甜甜゛ 提交于 2019-12-14 02:37:51
问题 If I run the below queries select to_char( TO_DATE(SYSDATE-7,'DD/MM/YY') ,'year') from dual The result is twenty seventeen select to_char( TO_DATE(SYSDATE-7,'DD/MM/YYYY') ,'year') from dual The result is seventeen why don't I get twenty seventeen for the second query? 回答1: Because you are doing an unnecessary explicit conversion from string to date, which is doing an implicit conversion from date to string based on your NLS settings. What you should be doing is just: select to_char(sysdate -

Show concatenated values in SQL Query

走远了吗. 提交于 2019-12-14 02:11:49
问题 I want to join my first sql query with table Types showed below by id_pr value.ID_PR values are repeated. I want to show all values from ident_st column concatenated with comma separator for same id_pr and rodz_st values. For example: Show all ident_st values for rodz_st='DZE' and id_pr=13. first query: SELECT NAME, NO FROM ORDERS o LEFT JOIN TYPES t ON t.ID_ZM = o.ID_PR table Orders: ID ID_ZM NAME NO ---------- ---------- ------- -------- 1 12 Dee 333 2 13 Rods 111 table Types: ID ID_PR RODZ

Oracle 11g XE - sudden ORA-01034: ORACLE not available and ORA-27101: shared memory realm does not exist

℡╲_俬逩灬. 提交于 2019-12-14 02:01:32
问题 Windows 7 32 bit laptop Local instance of Oracle 11g XE Firstly I have been researching this myself before asking and while there are many references/suggestions around I've not been able to fix the issue for myself. All of a sudden when i try to login into my local hobbyist instance of Oracle 11g XE i am getting the following: SQL> connect Enter user-name: system Enter password: ERROR: ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Process ID: 0 Session ID: 0

Entity framework Left Outer Joins and Group into throws : ORA-00907: missing right parenthesis

巧了我就是萌 提交于 2019-12-14 01:42:18
问题 I am using Entity framework in a data access based on Entity Framework to target multiple database. we are a team working with Entity Framework, for 2 years now, and the code produced works perfectly with sql server 2008. Now, we are testing the same code after migrating the database to Oracle 11 express r2g2, and all instructions that make left outer join or group into select throw exception showing this Call Stack : System.Data.EntityCommandExecutionException was unhandled by user code

CSV to Oracle via Odo and SQL Alchemy

落爺英雄遲暮 提交于 2019-12-14 01:24:49
问题 I have this code that sends CSVs to Oracle but it's slower than molasses in January. I'd like to use odo but the documentation is scarce for this exact type of situation (data from CSV to Oracle). I'm not married to Pandas, so if it's better to not use it than that's fine with me. import pandas as pd import pandas.io.sql as psql from sqlalchemy import create_engine import cx_Oracle as cx engine = create_engine('oracle+cx_oracle://schema:'+pwd+'@server:port/service_name' ,encoding='latin1')

How to connect Oracle 11G database using SQL developer from another computer in a LAN connection

时光总嘲笑我的痴心妄想 提交于 2019-12-14 00:42:13
问题 I am very new in database and learning Oracle 11G. So, I do not have deep knowledge on it. I have several computers in my lab connected via LAN. Oracle 11G is installed in computer-A(192.18.100.115). Now I want to use the database from other computers in my Lab via SQL Developer that is installed into all Computers. Would you please explain What I need to do in Computer-A for granting access from other Computers? What I need to do in other computers for getting access from computer-A? I will

Can somebody explain dbms_sql.number_table [closed]

≡放荡痞女 提交于 2019-12-14 00:09:30
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I tried to search this but could not get a satisfactory answer hence posting here . somebody please explain 回答1: Better to understand DBMS_SQL itself to some extent, before understanding NUMBER_TABLE . ( I do this for My Learning!) NUMBER_TABLE is Actually, TYPE number_table IS TABLE OF NUMBER