oracle

ora-00933:SQL command not properly ended

I have the following code: begin for i in 1..2 loop insert into dba_xy.despatch select desp_id_seq.nextval, dbms_random.string('U',5), trunc(dbms_random.value(0000,9999)), prod_id from dba_xy.product prod_name from dba_xy.product; end loop; end; When I run it, oracle gives me the following error messag...

Is it possible to set a unique constraint as a foreign key in another table?

Is it possible to set a unique constraint as a foreign key in another table? If yes, how would you go about declaring it? How would you go about assigning a candidate key? Is it possible? Sorry, I'm a real noob at oracle. Example: I have a product table that consists of: prod_id, prod_name, prod_price, QOH Where I want prod_name to ...

MySQL equivalent of ORACLES rank()

Oracle has 2 functions - rank() and dense_rank() - which i've found very useful for some applications. I am doing something in mysql now and was wondering if they have something equivalent to those? ...

before INSERT or Update trigger plsql

can anyone help me write a trigger to disallow particular entry into a table (for e.g. location = 'chicago' not allowed).The table schema is as follows department(deptno,deptname,location).I am using oracle 10g. ...

JDBC Thin Oracle 11g

Hi all, I am using oracle 11g. I write code to connect oracle database with java 1.6, but I can't connect to it. When configure the guide line to below: I have ojdbc6.jar,orai18n.jar, and class12.jar I set: Class_Path: %ORACLE_HOME%\jlib\orai18n.jar;r;%Oracle_home%\jdbc\ojdbc6.jar After that I run sample java code connect to oracl...

What are the essential dba skills a developer should learn?

Creation of objects like tables and indexes are fairly essential, even if the code has to be authorized or created by the dba. What other areas normally carried out by dbas should the accomplished developer be aware of? ...

Oracle Driver for Qt

Any oracle10g driver is available for QT3 ...

How to pass Map to Oracle PL/SQL function?

Hi, I would like to create an equivalent if this Java method as PL/SQL function in Oracle 10g: String myMethod(int par1, Map<String, Object> par2); Is it possible to pass a Map (or some simillar structure) to Oracle PL/SQL function? I have to be able to call this function from Java somehow. ...

ORACLE : Materialized view- change START WITH CLAUSE

I created a Materialized view using the following code: CREATE MATERIALIZED VIEW M_USER_HIERARCHY BUILD IMMEDIATE REFRESH COMPLETE START WITH TO_DATE('25-Aug-2009 10:34:24','dd-mon-yyyy hh24:mi:ss') NEXT SYSDATE + 1 WITH PRIMARY KEY AS SELECT * FROM V_USER_HIERARCHY; However, I want to be able to change the START WITH date A...

best place for data processing logic with .NET/Oracle architecture

I'm a .NET programmer, and I'm developing a system that collects real time production data and stores it in an Oracle database. The data will need to undergo extensive processing: essentially digital signal processing stuff--looking for mins and maxes of various fields in a datastream and categorizing "chunks" of time accordingly. Appa...

Oracle ASCII Character Set - .Net Extensions

Hello, I am trying to extract data out an Oracle table. The column is defined as char(40) and contains extended ASCII values. Currently in SQL*Plus, the extended characters are displaying as an "upside-down" question mark. I need to be able to extract the ASCII characters that have a decimal value > 128 and display in the extended or 8-...

What do I need to know about using non-portable datatypes on SQL*Loader?

I read the section in the SQL*Loader reference manual and it's a bit over my head. Our clients are all running x86, so I'm assuming we won't have to worry about byte ordering. However, we do have some customers running on 32-bit and others running on 64-bit OSes. What exactly do I need to do to make sure I don't run into any problems ...

Oracle SQL use Coalesce

I have this query that works in Oracle but I want to convert it to use Coalesce because of some problems I'm having with Visual Studio. SELECT * FROM a Left Join b on b.institution_code=a.institution_code WHERE (upper(a.Login_Name)=UPPER('%' || :Login_Name || '%') OR :Login_Name IS NULL) AND (upper(a.Display_Name) Like UPPER(...

Obtaining an inserted recordid on Oracle db

I'm using Oracle on database server, from an XP client, using VB6 and ADO. In one transaction, I'm inserting one record into a parent table, which has a trigger and sequence to create a unique recordid, then that recordid is used for the relationship to a child table for a variable number of inserts to the child table. For performance,...

Copy data between tables in different databases without PK's ( like synchronizing )

I have a table ( A ) in a database that doesn't have PK's it has about 300 k records. I have a subset copy ( B ) of that table in other database, this has only 50k and contains a backup for a given time range ( july data ). I want to copy from the table B the missing records into table A without duplicating existing records of course...

Synchronize Data in Oracle with PHP

Hi Folks, the following "problem" : 2 Oracle Databases , Servers identified by their Names. If one attribute of the Server from Table X is different to Server in Table Y -> Update Table X. What is the best solution ? Fetch all Servers from both Databases and compare change them in an array ? Get first Server from Table X , get Serve...

please let me know the issue with following sql query

SELECT pd_end_dt,nrx_cnt FROM wkly_lnd.lnd_wkly_plan_rx_summary WHERE pd_end_dt >TO_DATE('01/01/2009') It is giving error ORA-01843: not a valid month i ran the following it did fine SELECT pd_end_dt,nrx_cnt FROM wkly_lnd.lnd_wkly_plan_rx_summary WHERE pd_end_dt > '01-Jan-09' but if i want to have week wise data how to do dat ...

a sql query to compare results of follwing queries

SELECT pd_end_dt,SUM(nrx_cnt) Total_Count FROM wkly_lnd.lnd_wkly_plan_rx_summary WHERE pd_end_dt >= '01-Sep-08' AND pd_end_dt < '30-Sep-08' GROUP BY pd_end_dt SELECT pd_end_dt,SUM(nrx_cnt) Total_Count FROM wkly_lnd.lnd_wkly_plan_rx_summary WHERE pd_end_dt >= '01-Sep-07' AND pd_end_dt < '30-Sep-07' GROUP BY pd_end_dt the result set on ...

Oracle : Use two different versions of EXP on the same machine ?

Hi, i have a server (HP-UX) installed with Oracle 10g and several databases on it. I've been asked to make dumps from these tables for a Oracle 8i database. In order to do this, i need to use the 8i version of the EXP (export) tool of Oracle. It is still installed on my server but when i want to use it, i get the following error : EX...

oracle delete query taking too much time

I have a query like DELETE from tablename where colname = value; which takes awfully long time to execute. What could be the reason? I have an index on colname. ...