oracle-sqldeveloper

How to load JDBC driver for Oracle SQL Developer

半世苍凉 提交于 2019-12-11 12:54:43
问题 My professor asks us to make a java program that asks the user to input the data and the data inputted should automatically be inserted into a table in sql developer . I have a background in Java and database but i'm not familiar with creating JDBC applications. I searched a tutorial online and it said that i need to register the JDBC driver first. I ran the code in my compiler but it outputs Error: unable to load driver class! . What should i do for it to register? I still don't know the

[A]Oracle.ManagedDataAccess.Client.OracleParameter cannot be cast to [B]Oracle.ManagedDataAccess.Client.OracleParameter

旧街凉风 提交于 2019-12-11 10:46:06
问题 I'm the below error while running my code to get data from Oracle DB. [A]Oracle.ManagedDataAccess.Client.OracleParameter cannot be cast to [B]Oracle.ManagedDataAccess.Client.OracleParameter. Type A originates from 'Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342' in the context 'LoadFrom' at location 'd:\Users\mukadfar\AppData\Local\Temp\Temporary ASP.NET Files\vs\02d43168\78988466\assembly\dl3\95159e45\00d2c436_a83bd401\Oracle.ManagedDataAccess

Export a BLOB image from table

扶醉桌前 提交于 2019-12-11 09:57:48
问题 I have table in Oracle 11G R2, named as PERSON_IMAGE with ID (Number) and IMAGE(BLOB) fields. Now without using the application i need to export multiple BLOBs. How can i do this? Do we have any tool/ utility for this? Example will really assist me. 回答1: SQLDeveloper can do it: http://www.thatjeffsmith.com/archive/2014/05/exporting-multiple-blobs-with-oracle-sql-developer/ I just tried it in version 4.0.3 and although the interface was a little unintuitive, it worked fine. I ended up with a

How to create sql constraints in my table

一个人想着一个人 提交于 2019-12-11 09:35:32
问题 i have this table: id | product_group_id | percentage 1 | 1 | 0.2 2 | 1 | 0.3 3 | 1 | 0.5 4 | 2 | 0.4 5 | 2 | 0.6 I want to know if there is a way to create constraints that for each product_group_id the percentage will be equal to 1 ( if product_group_id = 1 so 0.2 + 0.3 + 0.5 = 1). For example if i will change the percentage where id = 2 to 0.8 or 0.1, the update (or insert) will fail because the sum is not 1. Thanks in advanced. 回答1: It would generally make more sense to enforce this sort

ora-12154 could not resolve… with oracle instant client

♀尐吖头ヾ 提交于 2019-12-11 09:19:49
问题 Here are the details: I installed the oracle instant client 11.2.0.2.0 from the OTN download page on a windows 7 64 bit vm (vmware). I am trying to to connect to a remote oracle database, and I can successfully connect with one program using TNS, but not with SQL*Plus and other applications. Trying to connect with SQL*Plus, using schema@servicename, password, etc, gives the above error. To connect via SQL Developer, normally I would use the basic connection info and not rely on tnsnames, but

ORA-24920 but text is shorter than column size

余生颓废 提交于 2019-12-11 08:36:14
问题 I have a varchar2(16000 char) column, for really long texts. I can insert longer than 4000 char texts into this column, but when I try to select it through sqldeveloper I get an ORA-24920 error. If I skip that column from my query, I get some data back, and if I check the length of the column, I get back the correct length of the inserted text. The problem is that it seems that sqldeveloper cannot handle this long text. Any idea? 回答1: Unless you're using Oracle 12c, SQL tables have a limit of

Get Account details in Oracle using function

本秂侑毒 提交于 2019-12-11 07:57:42
问题 we have two tables account and Dept where acocunt level 1 will be coming from acount table and level 2 and level 3 account level coming from dept. table Now based on the input we need to find the accountkey which is in both tables and it should display which accountkey based on source account id, db id and account level. Input: [112].[22].[1],[113].[23].[1],[245].[21].[2],[289].[20].[2],[301].[21].[3], [304].[20].[3] Description: 112 - Account id(level1 accountid or leve2 accountid or level3

ExecuteNonQuery always returns zero. Can i use this 0 value into my code for validation?

蹲街弑〆低调 提交于 2019-12-11 07:47:14
问题 I am creating a oracle user in dba_users table by using the below c# code where i am using oledbcommand and ExecuteNonQuery. User is being successfully created in the dba_users table but ExecuteNonQuery is always retun value as "0" So i am doing validation in my code as (IsUserCreated==0). Am i correct with my coding here? int IsUserCreated= oleCreateUserCommands.ExecuteNonQuery(); if(IsUserCreated==0) { //TBD code Response.write("User Created Successfully"); } else { //TBD Code Response

How to use spool command in sql developer oracle

匆匆过客 提交于 2019-12-11 06:03:57
问题 Dears, I cannot use spool command. It is not working or i am not doing something right. I am trying to save query result in txt file (tried also csv saving with select /*csv*/ * from table but it also did not work). So what i wrote is: set echo off set trimspool on spool 'C:\Users\username\Desktop\clobams\Test1.txt' select pn, serial_number from stock ; spool off; And i am getting error when pressing execute statement ORA-00900:invalid SQL statement . Sql works fine - when i execute only that

Bind variable used in BEGIN/END gets cleared

故事扮演 提交于 2019-12-11 05:48:42
问题 This is a trivialized example so it is easy to reproduce, but the important thing is I need to set a variable based on a query using into :someVariable from sometable where sometable.somecolumn = :y and then leverage both variables after the BEGIN/END block. It seems referencing :y in the where causes it to be cleared. Why does this happen? I am more concerned with why does this happen than how to fix it. I have the work around of setting it with itself, but it seems like an odd side affect.