oracle10g

How to get database notification to C++ application

大憨熊 提交于 2019-12-13 06:03:46
问题 We are developing a C++ server which will process based on time based events. For example if a particular user has configured a particular task that has to be processed at a particular time, then an event or notification needs to be sent to the C++ server from the database, to initiate the task. The timming configuration is stored in the database, and the C++ server shouldnt poll the database at an interval, but event should be notified from the database at the configured timming. We are

Check Values in sys_refcursor

社会主义新天地 提交于 2019-12-13 06:03:45
问题 I have the following code in a function CREATE OR REPLACE FUNCTION my_func ( v_dt events.raised_date%TYPE ) RETURN SYS_REFCURSOR IS p_events SYS_REFCURSOR; OPEN p_events FOR SELECT event_id FROM events WHERE raised_date = v_dt; RETURN p_events; END; I would like to check whether 100 exists in p_events cursor or not. How can I do this inside my function. Any help is highly appreciable. 回答1: It is not good idea to check it inside of the function. You are missing why the cursor is returned.

FRM-50026 date must be entered in a format like DD-MON-YYYY

耗尽温柔 提交于 2019-12-13 05:26:49
问题 I am creating form in which user select "CSV" File and import "CSV" Data into oracle forms Data Block.I have date column when I import date column values into data block then getting following error "FRM-50026 date must be entered in a format like DD-MON-YYYY" My Date Column format in "CSV" File: My Form: Code: DECLARE application Client_OLE2.Obj_Type; workbooks Client_OLE2.Obj_Type; workbook Client_OLE2.Obj_Type; worksheets Client_OLE2.Obj_Type; worksheet Client_OLE2.Obj_Type; worksheet2

Why is my SQL failing? (ORA-00933: SQL command not properly ended)

别说谁变了你拦得住时间么 提交于 2019-12-13 05:19:25
问题 Why is my SQL failing? I think it s formatted correctly, but it throws an error at me. INSERT INTO NBOT_USERS (ID,LAST_NAME,FIRST_NAME) VALUES (1002, 'Smith', 'John') WHERE 1002 NOT IN (SELECT IT_ID FROM NBOT_USERS); 回答1: Inserting Values with a Subquery: Example INSERT INTO bonuses SELECT employee_id, salary*1.1 FROM employees WHERE commission_pct > 0.25 * salary; With your schema: INSERT INTO NBOT_USERS (ID,LAST_NAME,FIRST_NAME) Select 1002, 'Smith', 'John' From dual WHERE 1002 NOT IN

Column Not Allowed error while inserting rows using sequence values

ぐ巨炮叔叔 提交于 2019-12-13 04:43:18
问题 I've already successfully created a Sequence for the criminal_id column in the criminals table, but when I try to insert a new row, I get a "column not allowed" error. Here's the statement I run: INSERT INTO criminals (criminal_id, last, first) VALUES (criminals_criminal_id_seq.NEXTVAL, Capps, Johnny); The error message I get back says my error is in the second line, and states: "column not allowed here." What am I doing wrong? 回答1: You missed some quotes, otherwise it thought those unquoted

Oracle 10g: ORA-12154 when connect to database with newly created user

五迷三道 提交于 2019-12-13 04:39:54
问题 This is the continue topic with this topic: Oracle 10g: Error when creating database manually by scripts Basically, I had created an Oracle database named "testdb" using only batch scripts and SQL scripts. After successfully creating a database using script, I create a script to create user for client connect to the database. CreateUser.bat sqlplus sys/test as sysdba @D:\Script\CreateUser.sql CreateUser.sql shutdown immediate; startup; CREATE USER usr1 IDENTIFIED BY usr1 DEFAULT TABLESPACE

(text + images ) files in Oracle

…衆ロ難τιáo~ 提交于 2019-12-13 04:34:12
问题 I am using Oracle 10g. My Java program gets some files having huge text contents + images. I want to Store Data (having text files with Images) in oracle. What is the best way to to insert and retrieve the data from Oracle DB. Should i use BLOBs or CLOBS? Should i use XML data types? Should i use Oracle Text datatype? Please suggest the best practice. Its pretty urgent. 回答1: If the values may include binary data such as images, then BLOB is your best bet. If the values only contain text, then

Deleting large number of rows of an Oracle table

笑着哭i 提交于 2019-12-13 04:07:54
问题 I have a data table from company which is of 250Gb having 35 columns. I need to delete around 215Gb of data which is obviously large number of rows to delete from the table. This table has no primary key. What could be the fastest method to delete data from this table ? Are there any tools in Oracle for such large deletion processes? Please suggest me the fastest way to do this with using Oracle. 回答1: As it is said in the answer above it's better to move the rows to be retained into a

Oracle to_char subquery in Trigger

拈花ヽ惹草 提交于 2019-12-13 03:35:33
问题 I have a table (Meeting) with date type attribute (MeetDate) and another varchar2 type attribute (WorkWeek). I'm trying to do an After trigger to fill in the WorkWeek field based on the MeetDate value using the to_char function. Tried the following codes separately and they compile without errors but when I try to insert a row with Null for WorkWeek, it gives me a 'mutating trigger/function may not see it' error. What am I doing wrong here? thanks in advance to any help. --Code 1 Create or

Oracle query for getting particular Date

僤鯓⒐⒋嵵緔 提交于 2019-12-13 02:49:05
问题 I have an oracle query which returns next mont first sunday. now i have a condition here to check if the date which has passed is first sunday of current month, then we need second sunday in current month. Else, next month first sunday. My query: DEF startDate = to_date('somedate', 'dd/mm/yyyy'); Select next_day(last_day(&startDate),'Sunday' ) from dual ; Expected output: if we input 1st july 2018, it has to return 8th july 2018(second sunday) else, any other day apart from first sunday like,