oracle

Usage of Oracle binding variables with LIKE in C#

As part of an effort to stop using dynamic SQL generation and encourage use of bind variables, I am running into some problems. I am querying an Oracle 9i database from an ASP.NET page using Oracle Data Providers for .NET The query is sql = "SELECT somedata FROM sometable WHERE machine = :machineName "; I define the Oracle Paramete...

What does "%Type" mean in Oracle sql?

I'm getting my first experience with Oracle and TOAD (I know SSMS). I came across this "%Type" next to an input parameter in an update procedure and I have no idea what it is or what it means. I found links on Google related to "%Rowtype". Is the same thing or something entirely different? If this is vague, I apologize. As always, thank...

Where I can get oracle from builder 6?

I need Oracle form builder 6.0.(report also) would you help me where I can find it? ...

Why does Hibernate re-implement functionality that databases already have?

For example: @Table(name = "stock", catalog = "mkyong", uniqueConstraints = { @UniqueConstraint(columnNames = "STOCK_NAME"), @UniqueConstraint(columnNames = "STOCK_CODE") }) or @Column(name = "STOCK_NAME", unique = true, nullable = false, length = 20) Constraints like 'unique', 'nullable', even field length are core database featu...

how to apply parameters in this procedure?

How do I apply IN parameter as my_email and OUT as my_salary in this procedure: CREATE OR REPLACE PROCEDURE FYI_CENTER AS my_email employees.email%TYPE; -- **IN Parameter** my_salary employees.salary%TYPE; -- **OUT Parameter** BEGIN SELECT email, salary INTO my_email, my_salary FROM employees WHERE employee_id = 101; ...

Wrong types while executing UPDATE in Oracle db via pyodbc

I'm using pyODBS to connect to Oracle database. Connection and executing SELECT query works fine. The only problem is error on UPDATE query executing. I have table: CREATE TABLE stud (num NUMBER(6) NOT NULL, fname NVARCHAR2(70), year NUMBER(4), bday DATE, plata NUMBER(1) DEFAULT 0 CHECK(plata IN (0,1)), mb NUMBER...

Best practices for huge volumes of data load/unload?

My question applies to ETL scenarios, where transformation is performed outside of database (completely). If you were to Extract, Transform, and Load huge volumes of data (20+ million records or more) and the databases involved are : Oracle and MSSQL Server, what would be the best way to: Effectively read from the source database : I...

How to SELECT whole table with OTL, and save it to file?

Here is the problem, I dont know how many attributes or which type are the attributes in table and I need simple select statment like: SELECT * FROM TABLE1; to write down to file. And this need to be done with otlv4 wrapper. Please help. otl_stream i(50, // buffer size "select * from test_tab where f1>=:f<int> and f1...

Oracle - AURORA$JIS$UTILITY$

Doing some archiving/deleting of some uncommonly used databases on an Oracle server. Has anyone heard of AURORA$JIS$UTILITY$ and what is its purppose? ...

Oracle - emulating a trigger on SELECT

(I had already written this question out when I figured out the answer, so I'll post it anyway since Google didn't give me any useful answers). I'm looking to create something much like a trigger which fires on an Oracle SELECT. The goal is remove specific rows from the result of the SELECT depending which user is doing the SELECT. Th...

Global Variable affected by threads

Hi, How can global variables be use thread safe in oracle? My scenario is simultaneous user can access a oracle package/procedure which contain global variable, I need to have separate copy of global variable values for each user. Each user belongs to different java session which intern invokes this db package Does oracle spawn thread...

Base64 encoding and decoding in oracle

How can I do Base64 encode/decode a value in Oracle? ...

Erroneous ORA-01427: single-row subquery returns more than one row

I'm getting the error [ORA-01427: single-row subquery returns more than one row] when I execute a query. I have a query structured like so: SELECT LV.PRICE, (SELECT C.MODEL_NAME FROM CARS C WHERE C.MODEL_ID = LV.MODEL_ID) as MODEL_NAME FROM LEDGER_VIEW LV WHERE LV.PRICE < 500 It's breaking on the nested select. I know the logic bot...

Problem with UTL_SMTP package (sending emails from ORACLE)

Everything's been working fine and haven't made any changes to our mail packages. But i just noticed that our unsent_emails table has been filling up, and when i tried to manually sent the unsent emails (a periodic job set up in user_jobs) i get the following errors; Error with main mail package: ORA-29279: SMTP permanent error: 501 5.5...

What's the Oracle equivalent of System.Data.Linq.DataContext?

I am implementing the IRepository interface against an Oracle database. public interface IDinnerRepository { IQueryable<Dinner> FindAllDinners(); IQueryable<Dinner> FindByLocation(float latitude, float longitude); IQueryable<Dinner> FindUpcomingDinners(); Dinner GetDinner(int id); void Add(Dinner dinner...

Sharing rules between javascript and SQL

I'm mostly looking for ideas here. The odds of my group purchasing something to solve the problem is incredibly low, but go ahead and suggest any commercial products that would help. The basic problem stems from the following scenario: Users input data into a form, which auto-populates some values based on existing data. This data is...

Can authlogic-oid be configured to use a tablename other than session?

I'm working on a rails3 login using Authlogic and Authlogic-oid, with activerecord-oracle_enhanced-adapter, and user/session code pretty much like Holden's demo on github. When I have a session table, I get this error, because there are no quotes around "session": ActiveRecord::StatementInvalid (OCIError: ORA-00903: invalid table name...

How do I select a static string in a SQL query and ensure its type is VARCHAR2?

I have a query that is executed on a remote database: select /*+ DRIVING_SITE(rd) */ 'test' as tst, rd.id from mytable@remotedb rd When I execute this query I get: ORA-22992: cannot use LOB locators selected from remote tables Every column in mytable@remotedb is either INTEGER or VARCHAR2. If I remove 'test' as tst there is no pro...

NULL Value Substitution on constant

For fun I been playing with the built-in Optimizer for Oracle in Toad today. One of the optimizations it suggests is the following AND emp.pay_type = NVL('FT', UID) Instead of AND emp.pay_type = 'FT' I'm confused on what is happening here and because of it, confused on also on why this would improve performance. Since FT is a strin...

System.OutOfMemoryException when binding a gridview to a datatable having more then 400000 records

Dear, I am facing system.outofmemmory exception when binding a gridview with a datatable having more then 400000 records please find the below sample code for the same GridView gv = new GridView(); this.EnableViewState = false; gv.DataSource = (DataTable)dt; gv.DataBind(); Kindly help me to overcome in this situation is there any lim...