oracle

Am I even connecting to Oracle?

When I attempt this query: $query = "SELECT * FROM user_objects WHERE object_type = 'TABLE'"; ... I get an empty result set. I have error_reporting() set to E_ALL, so I would assume that if it wasn't connecting correctly, I would be getting an error... right? I'm using a class given to me by a higher-up that they use for everything,...

Migrating and Backing up Schemas (complex database structures)

Hey guys, I need to figure out a way to back up and also migrate our Oracle database from our production schema to the dev schema and the other way around. We have bunch of config tables that drive how systems on our platform run, and when setting up new systems or doing maintenance, we need to update our config tables. We want to be ab...

How to use tnsnames.ora in Grails DataSource?

I'm trying to connect to a load-balanced virtual host specified in tnsnames.ora in my Grails application in DataSource.groovy, with no luck - it (obviously) throws an "Unknown Host Specified" exception. The tnsnames entry looks like this someServiceName = (DESCRIPTION_LIST = (FAILOVER=ON) (LOAD_BALANCE=ON) (DESCRIPTION = ...

Oracle XMLTABLE syntax error

I've created a simple example of a table with a xmltype column --set up the able CREATE TABLE dept (name varchar2(20), employees XMLTYPE); --insert a test row INSERT INTO dept VALUES ( 'Sales', XMLTYPE.createxml( '<?xml version="1.0" encoding="UTF-8"?> <People> <Person> ...

How do I create an ODBC connection to OracleXE using sp_addlinkedserver in MSSQL using a DSN-LESS connection string?

How do I create an ODBC connection using sp_addlinkedserver in SQL using a DSN-LESS connection string? I assume I am doing something wrong with syntax, here is how I set up the connection: EXEC master.dbo.sp_addlinkedserver @server = N'SERVER_NAME', @srvproduct=N'Oracle', @provider=N'MSDASQL', @provstr=N'DataSource=(DESCRIPTION=(AD...

ODP .NET TNS:no listener

I'm currently trying to connect to an Oracle database. I can connect fine on my development machine, but when I deploy to my Win2k3 sp2 server I get the following error. Faile to open connection... Oracle.DataAccess.Client.OracleException ORA-12541: TNS:no liestener at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 err...

Using an if statment into a cursor declaration.

Hi. Im using a cursor to go over some data but I need to declare diferents sql statments according to a parameter. The problem seems to be that Im no able to use if statmets into this declaratios: DECLARE CURSOR c IS SELECT * FROM TRAFICO IF TipoConsulta = 'mes' then BEGIN WHERE TO_CHAR(FECHA...

Getting started with Oracle Database

I've been assigned the task of making our Java web application work with Oracle Database. I am not sure where to start. I was hoping for an experience similar to working with MySQL or PostgreSQL, but no such luck. The answer to this question will be list of steps for installing and deploying an Oracle Database for development use, basic...

Oracle Synonyms issue

My Scenario: Schema name: schema1 Package name: pkg_system procedure name: proc1 Now I am trying to create a synonyms for my proc1 as below CREATE PUBLIC SYNONYM call_proc FOR schema1.pkg_system.proc1; ...but it gave me syntax error. ORA-00933: SQL command not properly ended I changed the code as below: CREATE PUBLIC SYNONYM c...

subquery considered as table

how can do assume sub query as table in mssql? ...

How do I insert data into object tables that have refs to others?

I'm new in Oracle and I really don't have a clear idea how to do this. The database is this one... CREATE OR REPLACE TYPE personUdt4 AS OBJECT( pid varchar(11), firstName varchar(20), lastName varchar(20), dob date) NOT FINAL; / CREATE OR REPLACE TYPE locationUdt4 AS OBJECT( street varchar(30), bldg varchar(5), room varchar(5)...

update same record which fires a trigger

I want to update the same record using the trigger which fires due to insertion of that record. When I try to do that using the following code it gives an error DROP TRIGGER CONTROLLER_UPLOADER; CREATE OR REPLACE TRIGGER CONTROLLER_UPLOADER after insert ON CONTROLLER for each row begin UPDATE CONTROLLER SET STATUS = 'STARTED' W...

comparing 2 consecutive rows in a recordset

Hi, Currently,I have this objective to meet. I need to query the database for certain results. After done so, I will need to compare the records: For example: the query return me with 10 rows of records, I then need to compare: row 1 with 2, row 2 with 3, row 3 with 4 ... row 9 with 10. The final result that I wish to have is 10 or less...

Oracle mutiple session for an application

Hi ! I have a problem. Well, I have an VB6 app that connects to an oracle database. Normally it uses just one session to connect to the database, but after running an update query on a table, it opens another one, on wich it runs just one query : SELECT VALUE FROM SYS.NLS_DATABASE_PARAMETERS WHERE PARAMETER = 'NLS_NCHAR_CHARACTERSET'...

Oracle SQL Developer. Find referenced views of synonyms

Hello in the PL/SQL Developer beneath the category synonyms there is a tab (referenced by), which displays referenced views of a synonym. On my system there is no PL/SQL Developer installed. So is there any function in the normal Oracle SQL Developer or a query how I can retrieve the same information as in the PL/SQL Developer ? Thanks...

How should I deal with null parameters in a PL/SQL stored procedure when I want to use them in comparisons?

I have a stored procedure with a parameter name which I want to use in a where clause to match the value of a column i.e. something like where col1 = name Now of course this fails to match null to null because of the way null works. Do I need to do where ((name is null and col1 is null) or col1 = name) in situations like this or i...

Problem when backing up Oracle 10g

I've just started a job and have identified an issue in which the database isn't currently being backed up properly so to speak. We are doing one back up every 6 hours that uses the Oracle native backup utility, but we were also sold a process by a company in which they stated that they could in essence perform "warm" backups of our dat...

Is it possible to run a SAS or R script from PL/SQL?

Any idea to run those kind of scripts from Oracle PL/SQL? Any solution would be appreciated. Thanks! ...

how to check if a ref cursor returns data from a pl/sql procedure

I would like to know how to check if a ref cursor returns data. Let's say I have the following code in a PL/SQL package: type refcursor is ref cursor; procedure Foo(cursorresult out refcursor) is begin open cursorresult for select * from table t inner join t2 on t.id = t2.id where t.column1 is null; end; proced...

Oracle Job not been executed for no reason

Im programing a job in oracle in order to execute a store procedure, but when the time comes it just does not happend any thing for no reason. Is there some kind of log where I can see if an error happend or something? Im using the dbms_job package to create the job Tnks. ...