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?
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 ...
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?
...
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.
...
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...
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?
...
Any oracle10g driver is available for QT3
...
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.
...
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...
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...
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-...
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 ...
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(...
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,...
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...
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...
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
...
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 ...
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...
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.
...