How to insert data with & into table..
Hi,
i want to insert following data to table
sql>insert into emp values('company & co');
Enter value for co:
how to avoid this ?
You should disable the interactive prompt in SQL Plus. How to do check this link
http://www.orafaq.com/wiki/SQL*Plus_FAQ#How_does_one_disable_interactive_prompting_in_SQL.2APlus.3F
Similar Messages
-
*HOW TO INSERT DATA MANUALLY INTO A BW TABLE*
Dear experts,
I'm working in BW 3.5 version.
Since I need to test some tables which are going to be load manually, please could anyone explain me which are the steps to insert data manually into a BW table.
Thank you very much in advance,
JorgeHi Jorge,
You can maintain the TMG(Table maintenance generator) and then enter the data manually. TMG creation Tcode is se55. and to view and maintain TMG it is sm30 .
Or if you have the data in excel. You can write a simple excel uploading ABAP program which will load your excel data to the table .
Hope the above reply was helpful.
Thanks & Regards,
Ashutosh Singh
Edited by: Ashutosh Singh on Apr 30, 2011 6:45 AM -
How to insert data in database table
Hi experts,
How to insert data into database table using internal table from function module.Hi,
As per my understanding are you looking for the complete API feature of data insertion into the database using the Locking Mechanism? If yes, then you need to create a Lock Object using the Primary keys of the Primary Table and Secondary Tables. You need to call the lock object first and then you need to make the entry into the table. This principle is based on 'All or None Concept'.
For the insert Statement Key word you can have a look at the following link:
http://help.sap.com/abapdocu/en/ABAPINSERT_SOURCE.htm
Hope this helps.
Thanks,
Samantak. -
How to insert data from a table to database
Hi all,
My problem statement is that:
I have jsp page, which has a table with some columns editable for inserting data. I am using MySql database.
Now when I insert the data in the table and click submit button , the data entered must get stored in the database.
If its a single data I can do it , but how to do for mulitple rows or columns.
Please suggest me a solution
Regards,
Suraji did one program similar to this requirement. when the rows and columns are fixed then what is the problem.
use java script and capture all the values into an array and pass this to servlet and there call a method which will set
the bean objects. or else no need to pick the array directly pass all the parameters and set the beans by retrieving these
parameters(request.getParameter()).
Diablo -
How to clone data with in Table with dynamic 'n' number of columns
Hi All,
I've a table with syntax,
create table Temp (id number primary key, name varchar2(10), partner varchar2(10), info varchar2(20));
And with data like
insert itno temp values (sequence.nextval, 'test', 'p1', 'info for p1');
insert into temp values (sequence.nextval, 'test', 'p2', 'info for p2');
And now, i need to clone the data in TEMP table of name 'test' for new name 'test1' and here is my script,
insert into Temp select sequence.nextval id, 'test1' name, partner, info from TEMP where name='test1';
this query executed successfully and able to insert records.
The PROBLEM is,
if some new columns added in TEMP table, need to update this query.
How to clone the data with in the table for *'n' number of columns and*
some columns with dynamic data and remaining columns as source data.
Thanks & Regards
PavanPinnu.
Edited by: pavankumargupta on Apr 30, 2009 10:37 AMHi,
Thanks for the quick reply.
My Scenario, is we have a Game Details table. When ever some Game get cloned, we need to add new records in to that Table for the new Game.
As, the id will be primary key, this should populate from a Sequence (in our system, we used this) and Game Name will be new Game Name. And data for other columns should be same as Parent Game.
when ever business needs changes, there will be some addition of new columns in Table.
And with the existing query,
insert into Temp (id, name, partner, info) select sequence.nextval id, 'test1' name, partner, info from TEMP where name='test'_
will successfully add new rows but new added columns will have empty data.
so, is there any way to do this, i mean, some columns with sequence values and other columns with existing values.
One way, we can do is, get ResultSet MetaData (i'm using Java), and parse the columns. prepare a query in required format.
I'm looking for alternative ways in query format in SQL.
Thanks & Regards
PavanPinnu.
Edited by: pavankumargupta on Apr 30, 2009 11:05 AM
Edited by: pavankumargupta on Apr 30, 2009 11:05 AM -
How to insert data in the table without join and using mapped rule value
1.Table SOL_K
A B C D – Columns Name
C D A B –Coulmns Values Defined (Rule --- Defined)
2.SECOND table SIC_K
SIC_ K
A B C D
Kamal Micky NULL MANOJ
3 Table SIC_Mapping
Same Columns A B C D based On Table SOL_K defined rule
I want to insert values(from table SIC K) into table SICMapping Table with the help of first table(SOL_K)(mapped rule)
Required Result SIC_Mapping Table
The output will be come like this.
A B C D — Columns Name
NULL MANOJ Kamal Micky ---- Came based on defined Mapping RuleWhat's your database version?
That's a funny requirement.
How about :
select case sol.a
when 'A' then sic.a
when 'B' then sic.b
when 'C' then sic.c
when 'D' then sic.d
end as a
, case sol.b
when 'A' then sic.a
when 'B' then sic.b
when 'C' then sic.c
when 'D' then sic.d
end as b
, case sol.c
when 'A' then sic.a
when 'B' then sic.b
when 'C' then sic.c
when 'D' then sic.d
end as c
, case sol.d
when 'A' then sic.a
when 'B' then sic.b
when 'C' then sic.c
when 'D' then sic.d
end as d
from sol_k sol, sic_k sic
;XQuery can do the trick too :
SQL> SELECT *
2 FROM XMLTable(
3 'for $i in ora:view("SIC_K")/ROW
4 return element r {
5 for $j in ora:view("SOL_K")/ROW/child::*
6 return element {name($j)} {$i/child::*[name()=$j]/text()}
7 }'
8 columns
9 a varchar2(30) path 'A'
10 , b varchar2(30) path 'B'
11 , c varchar2(30) path 'C'
12 , d varchar2(30) path 'D'
13 );
A B C D
MANOJ Kamal Micky
Edited by: odie_63 on 29 juin 2011 22:07 -
How to insert date value into oracle?
hi,
iam reading date from xml using vb.net and inserting it into oracle table.
the date value in xml file is in the format of "01012003".
i want to insert into oracle table.but iam getting an error "ORA-1843: not a valid month".
how to solve this problem.
Any suggestions or examples...That's not a date. It's just a string. Convert it to a date using,
DateTime d = DateTime.ParseExact("01022003", "MMddyyyy", null);
or
Dim d As DateTime = DateTime.ParseExact("01022003", "MMddyyyy", Nothing)
and then bind it to a parameter. ODP.NET will take it from there.
You should never be hard-coding the date literal into your SQL query.
David -
How to Insert data in 3 table without use of join 1table mapped rule define
1.Table SOL_K
A B C D – Columns Name
C D A B –Coulmns Values Defined (Rule --- Defined)
2.SECOND table SIC_K
SIC_ K
A B C D
Kamal Micky NULL MANOJ
3 Table SIC_Mapping
Same Columns A B C D based On Table SOL_K defined rule
I want to insert values(from table SIC K) into table SICMapping Table with the help of first table(SOL_K)(mapped rule)
Required Result SIC_Mapping Table
The output will be come like this.
A B C D — Columns Name
NULL MANOJ Kamal Micky ---- Came based on defined Mapping RuleThis is the forum for issues with the SQL Developer tool. You will get better answers in the SQL and PL/SQL forum.
-
Sqlloader: how to insert -ve value into table
hi..
i had problem during loading. The error is Record 1: Rejected - Error on table FILE01, column AMOUNT.
ORA-01722: invalid number
For AMOUNT, the datatype is number(20,2).
here is my .ctl
LOAD DATA
INFILE 'file1bp0103.txt'
BADFILE 'file01.bad'
APPEND
INTO TABLE file01
acct_no POSITION(01:13),
amount POSITION(14:28),
description POSITION(29:32)
my .dat file
A500000030401- 32.74PYMT
A500000320106- 46.95PYMT
A500000520408- 63.95PYMT
A500000610301- 12.99PYMT
A500001720110- 56.21PYMT
A500001800103- 55.65PYMT
A500002000109- 27.25PYMT
A500002000305- 53.35PYMT
A500002080210- 75.04PYMT
A500002250106- 103.38PYMT
A500002500104- 60.69PYMT
A500002620902- 509.77PYMT
A500002621010- 398.69PYMT
what is the problem? is it because of my datatype?
please help me..
TQIs there a need to use dynamic sql here?
at the very least, try using bind variables instead of concatenating values like that.
EXECUTE IMMEDIATE 'insert into your_table (column_list) values (:val1, :val2, ...)'
USING l_val1, l_val2, l_val3 ... ; -
How to insert date with timestamp into table values
hi,
I have a table
create table abc1(dob date);
insert into abc1 values (to_date(sysdate,'RRRR/MM/DD HH24:MI:SS'))
but when i see in data base it shows as normal date without time stamp.
Is it possible to insert into back end with timestamp.
Thanks..First, SYSDATE is a DATE already, no need to convert it to a DATE using the TO_DATE() function.
The date ALWAYS has a time component, whether or not it is displayed is up to your NLS settings. for example:
SQL> CREATE TABLE ABC1(DOB DATE);
Table created.
SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY';
Session altered.
SQL> INSERT INTO ABC1 VALUES(SYSDATE);
1 row created.
SQL> SELECT * FROM ABC1;
DOB
02/04/2010
SQL> ALTER SESSION SET NLS_DATE_FORMAT='MM/DD/YYYY HH24:MI:SS';
Session altered.
SQL> SELECT * FROM ABC1;
DOB
02/04/2010 12:54:57
SQL> DROP TABLE ABC1;
Table dropped. -
How to insert data from a table into itself if they don't already exist meeting a certain condition
First, let me apologize as I did not write/design this mess, just inherited this terrible design and legacy application!
I have table of companies and a table of suppliers with various attributes and of them being a bit column of is_public. The public suppliers then need to be inserted into the table as suppliers for the other suppliers.
As an example, in the company table company 'PUB01' is flagged as a public supplier (Company.IS_PUBLIC_SUPPLIER = 1). Therefore in the Suppliers table I need to insert a row for each each of PUB01's suppliers in that same table to all the other suppliers
in that table if they do not already exist as follows:
Here is a sample of the table structure:
CREATE TABLE [dbo].[COMPANY](
[COMPANY_ID] [nvarchar](15) NOT NULL,
[COMPANY_NAME] [nvarchar](100) NOT NULL,
[IS_PUBLIC_SUPPLIER] bit NOT NULL,
CONSTRAINT [PK_COMPANIES] PRIMARY KEY CLUSTERED
[COMPANY_ID] ASC
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[SUPPLIERS](
[SUPPLIER_ID] [int] IDENTITY(1,1) NOT NULL,
[COMPANY_ID] [nvarchar](15) NOT NULL,
[SUPPLIER_NAME] [nvarchar](100) NOT NULL,
[PUBLIC_SUPPLIER_ID] [int] NULL,
CONSTRAINT [PK_SUPPLIER_MASTER] PRIMARY KEY CLUSTERED
[SUPPLIER_ID] ASC
GO
Thanks!Thanks Visakh! Will that work if some have already been inserted previously?
Yes
but if you want to exclude them use this
INSERT INTO Suppliers(Company_ID,Supplier_Name,PUblic_Supplier_ID)
SELECT s1.Company_ID,
s2.Supplier_Name,
s2.Supplier_ID
FROM Suppliers s1
CROSS JOIN Suppliers s2
WHERE EXISTS(
SELECT 1
FROM Company
WHERE Company_ID = s2.Company_ID
AND IS_PUBLIC_SUPPLIER = 1
AND s1.COMPANY_ID <> s2.COMPANY_ID
AND NOT EXISTS (SELECT 1
FROM Suppliers
WHERE Company_ID = s1.Company_ID
AND Supplier_Name = s2.Supplier_Name
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
How to insert Data in a table from iFS.
Hi,
We have an application that communicates with the customer through iFS. I am asked to add a new functionality to that application that will populate a
table in the database with customer id, customer inserted file name and internal file name after rename. I would
really appreciate any input on how can I achieve this
from our Custom Application using iFS.
Is it possible to achieve this through LibrarySession API or I have to write a separate JDBC application which will be called from our current application to do the task.
Thanks,
SAYour question is little perplexing.
If you're using XML SQL Utility from
the commandline, just use putXML.
java OracleXML putXML
null -
How to insert the '&' character into table which is between in a string
SQL> create table s(ss varchar(10));
Table created.
SQL> insert into s values('2 & 3');
Enter value for 3:
old 1: insert into s values('2 & 3')
new 1: insert into s values('2 ')
1 row created.
SQL> select * from s;
SS
2
SQL> drop table s;
Table dropped.
SQL> create table s(ss varchar2(10));
Table created.
SQL> insert into s values('2 & 3');
Enter value for 3:
old 1: insert into s values('2 & 3')
new 1: insert into s values('2 ')
1 row created.
SQL> select * from s;
SS
2
SQL> drop table s;
Table dropped.
SQL> create table s(ss nvarchar2(10));
Table created.
SQL> insert into s values('2 & 3');
Enter value for 3:
old 1: insert into s values('2 & 3')
new 1: insert into s values('2 ')
1 row created.
SQL> select * from s;
SS
2
SQL> drop table s;
Table dropped.
SQL> create table s(ss char(10));
Table created.
SQL> insert into s values('2 & 3');
Enter value for 3:
old 1: insert into s values('2 & 3')
new 1: insert into s values('2 ')
1 row created.
SQL> select * from s;
SS
2
SQL> drop table s;
Table dropped.
SQL> create table s(ss nchar(10));
Table created.
SQL> insert into s values('2 & 3');
Enter value for 3:
old 1: insert into s values('2 & 3')
new 1: insert into s values('2 ')
1 row created.
SQL> select * from s;
SS
2
Edited by: user10438587 on 06-Jan-2009 07:57Here is one way ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.41
satyaki>
satyaki>
satyaki>select '2 '||chr(38)||' 3' res from dual;
RES
2 & 3
Elapsed: 00:00:00.20
satyaki>Regards.
Satyaki De. -
How to insert object values into table.
Hi All,
I have a problem with passing java object to procedure. Procedure is running properly when I execute in oracle,but it is not executing when I call from Java.
I am getting Error :
java.sql.SQLException: invalid name pattern: Pkg_Bulk_Insert.ITW_EMP_OBJ_ARRAY
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java)
at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java)
at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java)
at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java)
at JavaObjectToOracle.main(JavaObjectToOracle.java:31)
Here I am copying my procedure,oracle version is 9i.
Package specification:
CREATE OR REPLACE PACKAGE Pkg_Bulk_Insert AS
TYPE ITW_EMP_OBJ_ARRAY IS VARRAY(20) OF VARCHAR2(200);
PROCEDURE BULK_INSERT_TEST(strTable IN ITW_EMP_OBJ_ARRAY);
END Pkg_Bulk_Insert;
package body:
CREATE OR REPLACE PACKAGE BODY Pkg_Bulk_Insert AS
PROCEDURE BULK_INSERT_TEST(strTable IN ITW_EMP_OBJ_ARRAY) AS
i BINARY_INTEGER;
BEGIN
FORALL i IN 1..strTable.COUNT
INSERT INTO TEMP(NAME)
VALUES(strTable(i));
COMMIT;
END BULK_INSERT_TEST;
END Pkg_Bulk_Insert;
Here I am invoking the procedure:
DECLARE
x Pkg_Bulk_Insert.ITW_EMP_OBJ_ARRAY;
BEGIN
x := Pkg_Bulk_Insert.ITW_EMP_OBJ_ARRAY('A','B','C');
Pkg_Bulk_Insert.BULK_INSERT_TEST(x);
DBMS_OUTPUT.PUT_LINE('AFTER INSERTION');
END;
Please any body can help me on this regard.Your PL/SQL seems reasonable.
My suspicion would be that the oracle.sql.ArrayDescriptor.createDescriptor class only supports persistent collection types, i.e. those declared at the schema level with CREATE TYPE. -
How to insert data into two tables linke with foreign key..
I have two tables
1)EMP(emp_ID,username,emp_type_code)
emp_ID is primary key, emp_type_code is a foreign key references emptype table.
2)emptype(emp_type_code,emp_type_descripton)
emp_type_code is primary key
Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..CREATE TABLE "CATDB"."DWDIMUSER"
"USER_ID" NUMBER(10,0) NOT NULL ENABLE,
"SPECIALTY_ID" NUMBER(10,0),
"FULLNAME" VARCHAR2(20 BYTE),
"FNAME" VARCHAR2(20 BYTE),
"LNAME" VARCHAR2(20 BYTE),
"USER_SUBTYPE" VARCHAR2(20 BYTE),
CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE,
CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
CREATE TABLE "CATDB"."DIMSPECIALTY"
"SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
"SPECIALTY_NAME" VARCHAR2(100 BYTE),
CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
SELECT DISTINCT
Engineer AS FullName,
regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
'Engineer'
FROM EMPLOYEELOOKUP;
INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
SELECT DISTINCT SPECIALITY
FROM EMPLOYEELOOKUP;
COMMIT;
CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
"EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
"ENGINEER" VARCHAR2(25 BYTE),
"SPECIALTY" VARCHAR2(20 BYTE),
CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
DATA IN EMPLOYEELOOKUP
Engineer, Specialty,
John, Dow, Electronis,
Dow, Jons, Technician
Stan Smithers Sales
Mark, Richards Marketing
Jenny, Lane Marketing
John, Lee Sales
I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY.
Maybe you are looking for
-
ICal 'broken' (rebel without a cause...)
All, I've got some problems with iCal: it just won't listen. 3 weeks ago I updated my MacBook (intel, C2D) to Leopard, no problems so far. However, since about a week something's wrong. I'm not talking about syncing to PDA's or online-agenda's. iCal'
-
Custom Connector for Database for reconicitation
Hi, I have written my own customer connector to load all the users from external application database to OIM for reconcilitation (just initial loading of users).Now I want to check if a user information is changed in OIM it should be reflected in dat
-
How to do selectable filtering of output from table-function
Hi - I have been looking carefully but can't see the answer to my question in the forums so I have had to resort to asking! Apologies if this is covered elsewhere - my newbie state indicates I am fumbling in the dark here! I have a report which come
-
Download SAP Netweaver Mobile 7.1
Hi Friends, Where can I get SAP Netweaver Mobile 7.1? Is it available on Service Market Place? If yes from where i ccan download it? If no, then what is the procedure for getting DVD's from SAP? Pls help me. Its urgent. Thanks and warm regards Purnen
-
After the upgrade to firefox 9.01 with windows xp I get every time firefox tries to launch the error message "This application has failed to start because MOZCRT19.dll was not found. Re-installing the application may fix this problem". Well, re-insta