ODP.NET :: Insert Into Oracle Database Using C#?

Mar 8, 2013

I am trying to take data from text box and list box and then insert them to Oracle database:

Text box data:
Oracle = EMPLOYEE_NAME
C# = tbEmployeeName

List box data:
Oracle = EMPLOYEE_GENDER
C# = lbEmployeeGender

Here is my code in C#, with insert statement:

string oradb = "Data Source= oraDB;User Id=sm;Password=mypassword;";
OracleConnection conn = new OracleConnection(oradb);
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;

[code]...

View 1 Replies


ADVERTISEMENT

SQL & PL/SQL :: How To Insert PDF Into Oracle Database

Mar 8, 2013

how can i insert .pdf file into my oracle database.

insert statement how can i insert this pdf file into my oracle database using insert statement.

View 24 Replies View Related

SQL & PL/SQL :: Insert PDF Files Into Oracle Database

Mar 2, 2006

Here I am explaining the process of how I am trying to insert pdf file into oracle database.

create or replace directory files as 'c:/welcome/';

(physical directory is created in the system also., both in server and client machine)

Create or replace PROCEDURE procloadMetaPdf (Filename IN VARCHAR2) is
temp_blob blob:=empty_blob();
location BFILE;
Bytes_To_Load Integer:=0;
auto_Id number;
Begin

[Code]...

procudure creating successfully

but when executing

exec procloadMetaPdf('help.pdf');

displaying the following error:

ERROR at line 1:
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 605
ORA-06512: at "SCOTT.PROCLOADMETAPDF", line 14
ORA-06512: at line 1

(line 14 is : DBMS_LOB.OPEN(location , DBMS_LOB.LOB_READONLY)

View 8 Replies View Related

SQL & PL/SQL :: Oracle 10g Database - Building Dynamic Insert Statement?

Aug 23, 2012

i'm working in an Oracle 10g database on an IBM AIX server.

I have 3 tables (tables A, B and C).

Table A has columns -- product, rate and expiration date.

Table B has columns -- product, rate and deductible.

Table C has columns -- product, rider, gender, age and rate.

I also have a Master table which is used to store the data from Tables A, B and C via the insert statement.

I'm trying to create a dynamic SQL insert statement using a shell script to insert data from the columns in Tables A, B and C into my Master table. Master table does contains all columns from Tables A, B and C, although a column name could be spelled differently. For example, Master table contains a column named "deduct", while Table B has the same column spelled as "deductible".

I build the dynamic query using a for loop in my shell script (see below).

The problem is that i can't get the correct columns in the Master table in the dynamic SQL for the insert because depending on the table i'm selection from, the columns are different. So how do i get the correct columns in the SQL for the Master table?

Example Shell Script

--Archive_Rates.txt contains: Table A, Table B, Table C (but the next time my process runs, Archive_Rates might contain Table D, Table E and Table F -- each which have different column...but all columns are still in the Master table)

for tbl in `more Archive_Rates.txt`
do
echo 'BEGIN WORK; ' > rc1.sql
echo ' ' >> rc1.sql
echo 'insert into Master' >> rc1.sql
echo '(prod, rate, rate_exp) ' >> rc1.sql

[code].....

View 5 Replies View Related

Server Administration :: Unable To See / Insert Chinese Characters In Oracle Database

Jun 14, 2013

We are getting problem with the Chinese character set. My current character set is as follows.

PARAMETER VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
[code]....

My column description for the table product is as follows.

PART_NBRVARCHAR2 (30 Byte)
PART_DESCNVARCHAR2 (2000)

when trying to insert Chinese character using the insert command below

insert into product(part_nbr,part_desc,cust_name) values('322341',unistr('功'),'test');

I am getting the value when selecting the same record using the select command

select a.part_nbr,a.part_desc,a.cust_name from product a where a.part_nbr='322341'322341¿test

When I running this command on TOAD

select a.rowid,a.part_nbr,a.part_desc,a.cust_name from product a where a.part_nbr='322341'

and manually editing/inserting '功' character in output from select command above. After that I am able to get the same Chinese character when I am running select next time.

View 7 Replies View Related

Server Utilities :: Insert Data Without Writing Insert Statement In Oracle?

May 15, 2010

how to insert data in oracle table without writing insert statement in oracle 9i or above. i am not going to write insert all, merge, sqlloder and import data.

View 2 Replies View Related

Forms :: Map Excel Columns On Oracle Forms And Insert It Into Database

Apr 12, 2013

I have task. I am using oracle forms 6i. I want to import excel data to oracle forms(its common task using ole2 package). But this time I want to map the columns i.e my database table having 5 columns. and the excel file is having 2 or 3 columns then i suppose to map those columns and accordingly insert it to my table.

So far i have import column heading of excel to oracle forms, then i've provide list item for mapping each column. so that user can map excel column to database columns. Now I am confuse how to write the code so that selected columns should get inserted into database.

-more details

I have table with columns id, name, location, address, plan. in those columns i need to insert records form excel. user having a excel with 3 columns col1, col2, col3. on the form i've fetch column headers of excel and in front of that i've provide database column list , so user can match excel column with database column. e.g.

COL1 --> list value of database column
COL2 -->list value of database column
COL3 -->list value of database column

Once user map those column i want to insert those values into my database table (table with columns id, name, location, address, plan). and i am confuse about this code.

View 1 Replies View Related

Retrieve Info From Multiple Databases / Insert Into Central Database Via Database LINKS

Jun 10, 2013

I am trying to retrieve info from multiple DBs and insert into a central DB via DB LINKS.The links are retrieved via a cursor.

However I keep coming up against 'PL/SQL: ORA-00942: table or view does not exist'..how to handle db_links using a cursor in a pl/sql block? The code is as follows:

DECLARE
db_link_rec VARCHAR2(30);
CURSOR db_link_cur IS
SELECT DB_LINK
from MESSAGING_PROD_LIST;
BEGIN
OPEN db_link_cur;
LOOP
FETCH db_link_cur INTO db_link_rec;
EXIT when db_link_cur%NOTFOUND;
[code]....

View 1 Replies View Related

How To Insert Values In Database

Dec 10, 2006

i want to create database. i have created the schema & done all activity like decide foreign & primary key of table all things on paper? when i open oracle 8i & what should i write at front of sql prompt. For enter the value into database should i give the set path? How to store value into particular directory or folder in hard disk? should i directly start with create database?

I know proper syntax. Suppose i want to store the database & values in folder " D:apurva " what should i do. After entering oracle 8i it show sql> so what i do to store database in D:apurva . should i directly start with create table command in front of sql>

View 1 Replies View Related

SQL & PL/SQL :: How To Insert Database Function Value

Dec 19, 2011

I have following procedure

CREATE OR REPLACE PROCEDURE peter."GET_RANDOMDATE"
AS
V_CNTR number(5);
V_PKDATE VARCHAR2(20);
BEGIN

[code].....

My objective is to insert the random date value returned by datamask.get_random_date database function into peter.date_ random table.

I need the exact syntax to compile this procedure.

View 3 Replies View Related

Forms :: Insert Into Database

Jul 21, 2010

I have a form and 2 blocks(master-detail) and try to add a new record when I press "insert record" button from toolbar. But there occurs a problem. If I don't write 'CLEAR_FORM' just after calling "button_proc" procedure, record is not added into database.I couldn't understand why.

View 8 Replies View Related

SQL & PL/SQL :: INSERT Data Into Database

Nov 22, 2011

I have a question how to do this.

I'm using JAVA class. I'm try to put "data" to database(INSERT data to database - PL/SQL).

I have simple JDBC problem:

Steps.
1) SELECT table_seq.NEXTVAL FROM DUAL;
(Question: How can I make sequence to table ? I see lot of examples on google but all is just to create sequence but not for table. Maybe sequence can be put on table ?)

2) INSERT table_seq.....

3) INSERT table (values) values ('data')

Tables look like this:

table1 [Where I need to take `id`]
------------
id .....
------------

table2 [Where I need this sequence to be taken]
------------
seq_id .....
------------

table2 [Where I need to put `seq_id` into table2.id and data]
------------
id data
------------

I don't get it why can't I just do this ?:
INSERT table2 (data) values ("this is data");

View 6 Replies View Related

Data Insert In Database

Jul 12, 2013

I have a database rac with two nodes. While inserting a row in the database, I am getting the following error: Error starting at line 1 in command:

INSERT INTO DocMeta(dID,xComments,xExternalDataSet,xIdcProfile,xPartitionId,xWebFlag,xStorageRule,xCpdIsTemplateEnabled,.........,xPageID,xNDDate) VALUES(7897,'','','WebStyle','','','default',0,.........,'',null)

Error report:SQL Error: ORA-29875: failed in the execution of the ODCIINDEXINSERT routineORA-20000: Oracle Text error:DRG-50857: oracle error in textindexmethods.ODCIIndexInsertORA-00604:

error occurred at recursive SQL level 1ORA-01950: no privileges on tablespace 'SYSAUX'ORA-06512: at "CTXSYS.DRUE", line 160ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 75129875. 00000 -  "failed in the execution of the ODCIINDEXINSERT routine"*Cause:   

Failed to successfully execute the ODCIIndexInsert routine.*Action:   Check to see if the routine has been coded correctly. If I try inserting in the nodes individually, sometimes it gets inserted in one node. The other node gives above error. And at times, both nodes give the same error.

View 0 Replies View Related

Insert Special Character In Database?

May 5, 2008

I am trying to insert data into table through SQL.

However my table has a column by name "User Name". Now I have a user name " x,yz" (see there is comma b/w x and y).

how do I escape and insert this data(x,yz) into the table.I need data as it is in DB for my application.

View 1 Replies View Related

SQL & PL/SQL :: Getting Error When Try To Insert Values Into Database

Nov 25, 2011

I am trying to insert values into my database but it keeps coming up with the same error message: 'not enough values'

Here's what am I trying to do:

This is the insert I am having trouble with.

INSERT INTO Customers
VALUES (000120, 'Andy', 'Finnigan', 'M', '23/JUL/1978',
Address_varray_type
(Address_type('Home', 76, 'Fun Way', 'Semilong', 'NORTHAMPTON', 'NN3 8YF'),
Address_type('Work', 54, 'Region Street', 'Halfache', 'OXFORDSHIRE', 'OX4 7EG'),
Contact_table_type
(Contact_type('Non_work hours', '07659485743', '02084731131', 'AFinnigan@yahoo.com'),
Contact_type('Work_hours', '07795052846', '0768543323', NULL))));

Here are the Object tables.

CREATE TYPE Address_type AS OBJECT(
Location VARCHAR2(20),
House_number NUMBER(6),
Street_name VARCHAR2(30),
Town VARCHAR2(20),
County VARCHAR2(20),
Postcode VARCHAR2(20));
/

CREATE TYPE Contact_type AS OBJECT(
Contact_type VARCHAR2(30),
Home_no VARCHAR2(20),
Mobile_no VARCHAR2(20),
Email VARCHAR2(50));
/

CREATE TABLE Customers(
Customer_id NUMBER(6) NOT NULL,
Firstname VARCHAR2(20),
Familyname VARCHAR2(20),
Gender CHAR DEFAULT 'M',
DOB DATE,
Address address_varray_type,
Contact_details contact_table_type)
NESTED TABLE Contact_details
STORE AS customer_contact_table;

View 1 Replies View Related

SQL & PL/SQL :: Data Insert Fails From Web Form To Database?

Mar 24, 2011

I have a pl/sql package called advisory_form. It has 3 procs. First one asks for the term it calls another web form to get it then asks for student id. Post id to second procedure and web form shows students course information with a cursor also three empty items. When advisor fills this items for each course the data should be inserted into a table.I try to do this with a loop but it didn't work properly. The data which I get from cursor is inserted properyl but when it comes to filled text boxes and select list it does not work. Some data is lost. I am adding screenshot of my web form and the data inserted to table and of course my package code.

This is what I want to insert.

CREATE OR REPLACE package body advisory_form is

countc number;
pidm number;

procedure p_sel_tid(term in term.term_code%type default null) is

hold_term varchar2(30);
begin
if not tmain.F_Vuser(pidm) then return;
end if;

if term is null then

hold_term := tmain.f_getp(pidm, 'term');
else
tmain.p_setp(pidm, 'term', term);
hold_term := term;
end if;

if hold_term is null then

bmain.p_fsterm(calling_proc_name => 'advisory_form.p_sel_tid');
return;
end if;
tmain.P_Open('advisory_form.p_sel_tid');
tmain.P_Disp('advisory_form.p_sel_tid');

[code].....

View 1 Replies View Related

Performance Tuning :: Database Is Slow On Insert

Mar 23, 2012

we are using oracle 9i on AIX Server. When Customer were accessing the database, accidentally power was shut down. we restarted the Server,and Oracle database. all resumed successfully.

However while doing "Payments by the customer" it takes a lot of time to insert even a single payment record on database.The database is Live and our customer are very much frustrated,

View 1 Replies View Related

Forms :: To Insert Image In Database Using Browse Button

Mar 10, 2011

i want to insert a image in database using form(using browse button), when i use commit_form,all text data are saved but image file is not save & form has also not given any error.

View 5 Replies View Related

Forms :: Insert DATA In Database In Uppercase Format

Mar 19, 2013

I have a datablock based , I used commit_form(); to insert data in my DB .But,I want to insert data into my DB on uppercase format!!

View 3 Replies View Related

PL/SQL :: Insert Multiple Records On A Database Using Stored Procedure

Mar 25, 2013

I want to insert multiple records on a database using a stored procedure.

View 11 Replies View Related

Forms :: How To Insert Value Of Selected Radio Button In Database Table

May 10, 2010

Suppose There are Four options in a Radio Group. From this whichever option I select using the Mouse that option must be Inserted in the Database table field.

How to do this Using Radio Buttons.

Also If I want to select more than One Option Then I use Check Box. For this Also When I select two or three options simultaneously then these values must be Inserted in the Database Table Fields.

View 1 Replies View Related

Forms :: Insert Image Into Database Field By Scanner / Camera

Jul 7, 2011

i'm using form 6i and oracle databse 10g i want to insert an image into database field(BLOB) from scaner or camera

i have been search about this in this forum but no thing

any example

My Email :[URL]....

View 4 Replies View Related

Server Utilities :: How To Create Control File To Insert Data In Our Database

Dec 21, 2011

how to create control file and how to load the data through command window in our database using sql * loader.i am having structure in my database and .csv file in my desktop.

View 20 Replies View Related

Forms :: Insert Record In Table When One Of Item In Database Block Is Filled?

Sep 11, 2012

i want to insert a record in table when one of item in database block is filled..from which property i knw my one of field in block is filled or not.

View 2 Replies View Related

Client Tools :: Unable To Insert Euro Symbol In Database With Character Set WE8MSWIN1252?

Mar 29, 2011

I am using oracle 9.2.0.6.0 on HP-UX.

I am unable to insert and even display euro symbol from server as well as windows client.

Following are the details of my database server

SQL> select * from nls_database_parameters;
PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET WE8MSWIN1252

[code]....

1) When I try to insert € from Db server (using putty) using Alt+0128 it does not print anything (nothing gets typed on the screen). Not even junk characters Also following query does not print anything

SQL> select chr(128) from dual;
C
-

2) while I set NLS_LANG on client and try to insert €, Alt+0128 produces a question mark symbol And following query displays junk character

SQL> select chr(128) from dual;

C
-
Ç

3) Regardless when I inserted couple of rows and tried UNISTR following was the result

SQL> select unistr(v) from t;
Error 45 initializing SQL*Plus
Internal error
$

View 19 Replies View Related

Oracle Xe INSERT?

Nov 30, 2006

I am having trouble running a simple insert query in xe.

INSERT INTO UTHEMANG.CLIENT (F_NAME, L_NAME, STREET_ADDR, CITY, STATE_PROV, ZIP_PC, PHONE_NBR, E-MAIL, PASSWORD) VALUES ( 'John' , 'Doe' , NULL , NULL , NULL , NULL , NULL , 'someone@hotmail.com', '12345' );

I receive the following error message.
ORA-00917: missing comma

I can enter data via the point and click interface, but not at the SQL command.

View 2 Replies View Related

PL/SQL :: INSERT All In Oracle SQL

Oct 22, 2012

My following script worked to insert rows in Oracle SQL -

INSERT ALL
INTO EASY_DRINKS (DRINK_NAME, MAIN, AMOUNT1, SECOND, AMOUNT2, DIRECTIONS) VALUES ('Kiss on the Lips', 'cherry juice', 2, 'apricot nectar', 7, 'serve over ice with straw')
INTO EASY_DRINKS (DRINK_NAME, MAIN, AMOUNT1, SECOND, AMOUNT2, DIRECTIONS) VALUES ('Hot Gold', 'peach nectar', 3, 'orange juice', 6, 'pour hot orange juice in mug and add peach nectar')
[code].......

It worked but I have a few questions.

1. Is this the best way to Insert ALL? I mean can't I just name column names once and have it work for all rows IF I'm using all columns of the table? I tried but got errors,
2. Select 1 or * FROM DUAL - Why did it work when I selected 1 and not * from DUAL?

View 7 Replies View Related

How To Do Multi-row Insert In Oracle

Dec 2, 2006

I would like to find a way to do a multi row insert in Oracle similar to the examples below ... if possible.

Note that I need it to work with constant values and not values selected from (another) table (ref examples below).

In MySQL and DB2 I can do this:

insert into pager (PAG_ID,PAG_PARENT,PAG_NAME,PAG_ACTIVE)
values (8000,0,'Multi 8000',1),(8001,0,'Multi 8001',1)

In MSSQL, PostgreSQL, and SQLite I can do this:
insert into pager (PAG_ID,PAG_PARENT,PAG_NAME,PAG_ACTIVE)
select 8000,0,'Multi 8000',1 union all select 8001,0,'Multi 8001',1

View 14 Replies View Related

Error When Using INSERT INTO In Oracle

Jan 22, 2012

I have declared my table and it was created with no issue. This is the code I used to declare my table...

CODECREATE TABLE STUDENT
(
Sid NUMBER(5) CONSTRAINTS STUDENT_Sid_pk PRIMARY Key,

[Code]...

Now I am trying to INSERT INTO that table, but ORACLE doesn't like ANY data that I input..

CODEINSERT INTO STUDENT VALUES
2  (100, �McClure�, �Sarah�, �M�, '144 Windridge Blvd', 'Eau Claire', 'WI', 54703, 7155559876, 'SR', 14-JUL-1979, 8891, 10);

View 2 Replies View Related

PL/SQL :: Insert Into From CSV File Oracle

Oct 30, 2013

I need to insert about 15000 rows into a table called STOCK_ADJUST What is needed for the insert it two columns:

STM_AUTO_KEY and COST_ADJ

These two values I have in a CSV-file. Now I want to import these rows into the database... How do I do this in the most easy way? If it was just one row I would do it like this Insert into

STOCK_ADJUST (COST_ADJ, STM_AUTO_KEY) VALUES(-500, 174500)

 But with 15000 rows in a CSV file this isn't going to work...

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved