Insert data into the source of destinator Table
Hi all
Need to insert data in sample_table1 table xxc_source_table sample_table2
create table xxc_source_table (DESCRIPTION varchar2 (10));
Insert the table xxc_source_table values('A201.) ABC.4084.GR');
create table sample_table1 (col_1 varchar2 (10), col_2 varchar2 (10), col_3 varchar2 (10), col_4 varchar2 (10));
create table sample_table2 (col_1 varchar2 (10), col_2 varchar2 (10), col_3 varchar2 (10), col_4 varchar2 (10), moved_flag varchar2 (2));
col_1 = A201
col_2 = ABC
col_3 = 4084
col_4 = GR
Note: Insert data into the col_1, the col_3, the col_4 of the xxc_source_table sample_table1
(2) if the next (form xxc_source_table) data is exist in the sample_table2, and then set the moved_flag as Y in this column
3) xxc_source_table has 17000 lines
Thank you.
Post edited by: Rajesh123 please do not consider cross the line message
Hi Renon,
Why you don't want substr and instr? For best performance, you should go with substr and instr instead of regexp_substr. However you asked me to provide the code instead of substr and InStr. Then try the below...
INSERT ALL
IN VALUES sample_table1 (col1, col2, col3, col4)
IN sample_table2 VALUES (col1, col2, col3, col4, 'Y')
SELECT REGEXP_SUBSTR (DESCRIPTION,'[^.] +', 1, 1) col1,.
REGEXP_SUBSTR (DESCRIPTION,'[^.] +', 1, 2) col2.
REGEXP_SUBSTR (DESCRIPTION,'[^.] +' 1, 3) col3.
REGEXP_SUBSTR (DESCRIPTION,'[^.] +' 1, 4) col4
OF xxc_source_table;
Thank you
Ann
Tags: Database
Similar Questions
-
What trigger to use to insert data into the table db forms
Hello
My form is current having a block of database with the table reference. When you enter data into the form field and click Save. Automatically record is inserted in the database table.
I want to do this under manual insert. I changed the block of data to a data non-base. Where should I write the insert statement to insert data into the table.
Is - shutter release key of the form-level validation?
Please notify.
Thank you
Didi.You can guide me how to remove the message FRM-40401 no changes to save and instead, I wanted to put 1 transaction record successful... some like it like that.
Hi didi.
And this is my last post I'll sleep. ;)
Take form level trigger named preform
and write on it:SYSTEM.MESSAGE_LEVEL := 5;
I hope this works...
Hamid
Mark correct/good to help others to get the right answers. *
-
How to insert data into the table by using the expression builder in the assign activity
How to insert data into the table by using the expression builder in affect business in BPEl, I use SOA Suite 11.1.1.5
Can someone help me pleaseHello
I don't think that oraext:query-database() can insert data into the table.
What are your needs?
Can not you plan to use the DB adapter with the insert operation?Kind regards
Neeraj Sehgal -
How to insert data into the BLOB column
Hi all
Can someone help me to insert data in the BLOB data type column?
The structure of the table is
CREATE TABLE XXATFL_DM_FORCAST_STG
(
TASK_ID NUMBER,
USER_ID NUMBER,
CREATED_BY NUMBER (15),
CREATION_DATE DATE,
LAST_UPDATED_BY NUMBER (15),
DATE OF LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN NUMBER (15),
RECORD_STATUS VARCHAR2 (1 BYTE),
ERROR_MESSAGE VARCHAR2 (4000 BYTE),
DATA_FILE BLOB
)
I want to insert data into the column DATA_FILE. and this insert statement inside a procedure.
Please help me as soon as possible because it is very urgent for me
Thank you and best regards,
CharrierCharrier,
If you form the string yourself, you can use the function utl_raw.cast_to_raw on your channel.
http://download.Oracle.com/docs/CD/B12037_01/AppDev.101/b10802/u_raw.htm#997086
sql> create table t( 2 id number, 3 l_blob blob 4 ); sql> insert into t values(1, utl_raw.cast_to_raw('SampleString')); 1 row created. sql> commit; Commit complete.
-
Cannot insert data into the database
Hello world
I stuck with a problem in DB juice. When I try to insert data into the database using DB tool, I get a repeated error message (error 1). Please find the my vifile below and solve say.
Problem is use Labiew 8.2. So try to answer accordingly
Try it with a cluster instead of a string or an array.
-
How to insert data into the database using smartview
Hello
I am trying to insert data into the database using * "Send data" * button on the Ribbon of Essbase.
My database is empty.
I opened an ad hoc network, it returns * "#missing" * in all cells
I have modified the cells and provided data in the cells that I want to. Now, I supported on * "Send data" * button.
It just reloaded the adhoc grid instead of submit data, I rechecked the data through data console Administrative Service are not inserted.
I am following the right way to insert data? If not, could you please suggest me how (Populate) insert default data in the database?
--
VINETYou go about it the right way, once you have submitted if you réactualisiez then data values should be there, if you POV is against members of dynamic calc and then data not written to the database, you need to check the Member properties of your POV.
See you soon
John
http://John-Goodwin.blogspot.com/ -
cannot insert data into the PRODUCT_USER_PROFILE table
I've connected to the database as the sysdba, which is installed on VMWARE. database is oracle 11g.
whenever I insert data in the table PRODUCT_USER_PROFILE that the database returns 1 row inserted and then when I try to show everything on the table before or after the statement commit is made the database returns "No. LINES SELECTED.
guys any idea about this problem...Hello
Try to connect as a system and make the insert and check. Always think about the issue.
-Pavan Kumar N
Oracle 9i / 10g - OCP
http://oracleinternals.blogspot.com/Published by: pounet on January 4, 2010 16:29
-
Plan the work that runs according to max date in the source to create table
Hi all
I am trying to create an automation in my sql. Basically, I have a table I do reporting and analysis on which is a subset of records from a source table. For the purposes of this example, I called the source table "src_table" and my table as the target table, "tgt_table." Essentially the source table gets updated with a value again months from date (founded order_dt) and I have a procedure I call when the source table is updated to load the value of the new month of records in my target table. So let say June 2012 data is loaded in the source table, I call my procedure that has a date parameter and enter June 2012 as the point of departure date so that it looks for new records in the source table from June 1, 2012 and load it into my target table. For variety reasons I won't get in, my goal in a position is not a view, there must be a stand alone table. The problem is that the source never table gets updated at the same speed interval... sometimes they will load a new months of data at the beginning of the following month, sometimes medium of the month... sometimes I have to wait a few months to get another month of data. So, whenever I get a email notification telling me another month of data is loaded in the source table, I have a windows batch file that runs my setting... I just have to change the start date (based on the order_dt column) and run it. I want to do is automate the process so that I did not yet do. What do I think creates a task that runs every day or even at the end of each month, this work has basically seized the date of maximum order of the source table and if the date of the order is greater than the maximum order date in my target table, it runs my procedure that loads the new month with a value of data in my target table. Thus, for example, my maximum order of my target table date is May 31, 2012. The work runs at a certain period of time and check the maximum date on the source table, if the maximum date is May 31 nothing happens... new data has not been loaded so does not perform the procedure. If the maximum date on the source table is June 30, 2012, the maximum date is greater than the maximum in my table target date so that the procedure runs. I need also the procedure to insert records into the table in the source where the order date in the source table is > = at the time of maximum order in the target table.
In a Word, this is what I need but I'm not sure how to put in place. The procedure works fine... all I need is an interim procedure that runs as a scheduled task every x number of days and the date of maximum order check on the source table if it exceeds the maximum order on my table of target date it runs my procedure. My procedure is called "insert_new_orders" and when I run it I run it like:
execute insert_new_orders('01-jun-2012');
If anyone can help me with what would be great :-)
Thank you
EdTo start:
You must remove the EXECUTE keyword. -
Error inserting data into the database of JSF
Hi all
I have a form and a button of validation. I created the form using the editable view object created on an entity object. When the student has table (base table of data in which I have to enter data) was empty, I managed to insert the data into the table.when I run the same second time application it shows data that I entered previously. But iam able to modify this data and insert the new record again. What should I do so that it does not show the data I already inserted previously when I run again. I think that iam missing something. Please suggest.
Thank you.Here are two ways to achieve the same thing:
-If you use taskflows, you can add createInsert action as activity by default and then have a navigation from this at the registration page so that the creation form will be shown on the loading of the page. As a result, you can directly enter and validate.
-If not, have binding action createInsert in your pagedef and add an executable invokeAction for the same thing with prepareModel so that the registration form empty appears when loading the pageJean Lou
-
Insert data into the same table based on certain conditions
Hello. I'm new to this forum.
I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:
Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:
1. if PaidAmount > 0 & & CurrentInstallment < TotalInstallment then
CurrentInstallment = CurrentInstallment + 1
2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...
So, I have to insert data by incrementing the month and year. for example:
If currentdata is 11/2012 next data will be 12/2012
But following will be 01, 2013
I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit on each record selected and insert data and then turns them into table (MYTABLE) even.
How to achieve that?
Thank you.978184 wrote:
Hello. I'm new to this forum.
I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:1. if PaidAmount > 0 & CurrentInstallment
CurrentInstallment = CurrentInstallment + 1
2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...
So, I have to insert data by incrementing the month and year. for example:
If currentdata is 11/2012 next data will be 12/2012
But following will be 01, 2013
I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit & on each of the selected data record and insert then turns them into table (MYTABLE).You can do this way:
This is not tested, but if you can provide the example of table structure and data (IN create table and insert scripts), it can be put to the test.
insert into your_table (col1, col2, col3...current_installment, month_field) select col1, col2, col3.., current_installment + case when paidamount > 0 and current_installment < total_installment then row_number() over ( partition by column1, column2,.. columnn -->You may choose partition if you want the --Increment of Current_installment to reset after particular combination ends order by primary_key -->Order the Increment, you may choose to add more columns to order by ) else 0 --> if condition is not met, then Add 0 end curr_installment, add_months(to_date(month_field, 'MM/YYYY'), 1) nxt_month from your_table;
-
Insert data into the table from the flat Flie
I have a flat file save in a directory on my server. I would like to read the data from the flat file and insert into a table on the stage. The flat file data as below
01-02-03-04-05-06-07-08-09-10
Suppose that Location_stage is my table and c1 is the column name.
The data should be saved as follows
Select * from location_stage
C1
----
01
02
03
04
05
Any help will be appreciated.
Thank you
NSYou can define an external table to read data from the file and a simple view to convert the string enclosed in columns:
SQL> create directory ext_data as 'c:\'; Directory created. SQL> create table ext_locations ( 2 loc varchar2(4000) 3 ) 4 organization external 5 ( 6 type oracle_loader 7 default directory ext_data 8 access parameters ( 9 records delimited by newline 10 logfile ext_data:'ext_loc.log' 11 fields terminated by ',' (loc) 12 ) 13 location ('locations.txt') 14 ); Table created. SQL> select * from ext_locations; LOC ----------------------------------------------- 01-02-03-04-05-06-07-08-09-10 SQL> create view location_stage as 2 select regexp_substr(loc,'[^-]+',1,level) c1 3 from ext_locations 4 connect by level <= length(loc)-length(replace(loc,'-',''))+1; View created. SQL> select * from location_stage; C1 ---------------------------------------------------------------------------- 01 02 03 04 05 06 07 08 09 10 10 rows selected.
Your data is stored only in the file...
Max
-
Hi all
I use forms [32 bit] Version 6.0.8.24.1 (Production)
Oracle Database 10g Release 10.2.0.1.0 - Production
I have settings such as the (optional) emp_code and the year (mandatory field - four digits).
Based on the setting that I have to get the detail of a table and these must be inserted at the other table with columns of additions (to hardcode the additional columns).
To achieve this, I intend to get a cursor by selecting the required fields in the table by the way the where clause of the cursor parameters.
by making a loop through the cursor I will insert the records in the other table.
Here, the thing is that the data is going to be huge (since the year is the parameter).
so my approach causes the performance issue.
I heard that there is a different method of insetions
can anyone suggest me the best way (performance wise) other than what I mentioned (if you are aware of)...
Thank you...user13329002 wrote:
Thanks for everyone.
I have to take the data from the table as e_name, e_code, of the table and insert it into another table with some other values such as
e_name, e_code, as well as I add 'n', 'o'.
its something likeinsert into e_emp(emp_name,emp_code,emp_add,emp_status,emp_type) select e_name,e_code,e_add,'O','N') from e_table where e_date = Parameter.
in other words, the values for Emp_status, emp_type I have no values in the e_table.so table and enter in e_table I have to hard code it.
CAL I hard code as I mentioned in my statement examplecan someone clear me of the foregoing.
Thank you...
Published by: user13329002 on February 15, 2011 20:11
Yes... You can hardcode the values for Emp_status, emp_type.
SQL> CREATE TABLE e_emp(emp_code NUMBER(10),emp_status VARCHAR2(1),emp_type VARCHAR2(1)); Table created. SQL> create table e_table as (select * from e_emp); Table created. SQL> INSERT INTO e_table(emp_code) VALUES('1111'); 1 row created. SQL> insert into e_table(emp_code) values('2222'); 1 row created. SQL> select * from e_table; EMP_CODE E E ---------- - - 1111 2222 SQL> insert into e_emp(emp_code,emp_status,emp_type) (select emp_code,'0','N' from e_table); 2 rows created. SQL> select * from e_emp; EMP_CODE E E ---------- - - 1111 0 N 2222 0 N SQL>
I hope this helps.
Kind regards
Claudy -
Insert data into the table particular
Hello
I have a requirement to insert data from table from Oracle 10 g to Oracle 9i table.
The pom_code table should be filled with gr_product table based on a specific schema of codes - i.e. If POM Code corresponds to a specific model, then it must belong to a specific company.
FROM :: Oracle 10g database gr_product pr_code varchar2(20 byte) pr_desc varchar2(80 byte)
To :: Oracle 9i database pom_code code varchar2(12 byte) desc varchar2(100 byte) companyid Number
Thank you1. All gr_product.pr_code with following pattern should go to pom_code.code and companyid =10 a. <one digit><.><two digit><alphabet> ex code: 1.01A b. <one digit><.><two digit><alphabet><space><two alphabet> ex code: 1.01B ZF 2. All gr_product.pr_code with following pattern should go to pom_code.code and companyid =20 a. <two digit><.><one digit><alphabet> ex code: 10.1A b. <two digit><.><one digit><alphabet><space><two alphabet> ex code: 10.5A HR 3. All gr_product.pr_code with following pattern should go to pom_code.code and companyid =30 a. <alphabet><.><two digit><alphabet> ex code: B.42A b. <alphabet><.><two digit><alphabet><space><two alphabet> ex code: N.10B AT
SandyHello
The CASE expression I posted earlier does what you want?
If so, please mark the thread as "answered".
If this isn't the case, after a complete script that people can run to recreate the problem and test their ideas. Includes TABLE of CASH and INSERT statements for some examples of data for all the tables, the results you want from these sample data and your request (or INSERT statement) using the CASE expression. Report where the code you posted does not have what you need and explain how to get good results in these places. -
Insert data into the table without using the insert or select the command
Hello
Is there anyway to insert data from one table to another table, without using insert, and then select the command in the same pattern.
Note: the two tables have the same structure.ALTER table... Swap partition...
-
Dreamweaver server behaviors, can not insert data into the database
Hi, I tried to use server behaviors to add registration information in my database in my registration page.
(1) that I created a login page, and it works very well. This means that connections and the connection works fine database so it can match the record in my database.
(2) but when I tried to download the news in the form of database, it does not work. When I clicked on the service behavior to double check the action "insert data", it always jumps the error message: "When executing inspectserverbehavior in InsertRecord.htm, a javascript error occurred."
I copied my code below. Except the form code and a little jquery is written by me, most of the code generated by Dreamweaver.
<? php require_once('Connections/MAMPPRO.php');? >
<? PHP
If (! function_exists ("GetSQLValueString")) {}
function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
If (via PHP_VERSION < 6) {}
$theValue = get_magic_quotes_gpc()? stripslashes ($TheValue): $theValue;
}
$theValue = function_exists ("mysql_real_escape_string")? mysql_real_escape_string ($TheValue): mysql_escape_string ($theValue);
Switch ($theType) {}
case 'text ':
$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
break;
case "long":
case "int":
$theValue = ($theValue! = "")? intval ($TheValue): 'NULL ';
break;
case "double":
$theValue = ($theValue! = "")? doubleVal ($TheValue): 'NULL ';
break;
case "date":
$theValue = ($theValue! = "")? « " ». $theValue. "" "": "NULL";
break;
case "set":
$theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
break;
}
Return $theValue;
}
}
$editFormAction = $_SERVER ['PHP_SELF'];
If (isset {}
$editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);
}
If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "Register_Form")) {}
$insertSQL = sprintf ("INSERT INTO"user identity"(Ui_LastName, Ui_Email, Ui_FirstName, Ui_Password) VALUES (%s, %s, %s %s)", ")
GetSQLValueString ($_POST ['Register_Firstname'], "text").
GetSQLValueString ($_POST ['Register_Lastname'], "text").
GetSQLValueString ($_POST ['Register_Email'], "text").
GetSQLValueString ($_POST ['Register_Password'], "text"));
@mysql_select_db ($database_MAMPPRO, $MAMPPRO);
$Result1 = mysql_query ($insertSQL, $MAMPPRO) or die (mysql_error ());
$insertGoTo = "LoginSuccessful.php";
If (isset {}
$insertGoTo. = (strpos ($insertGoTo, '?'))? « & » : « ? » ;
$insertGoTo. = $_SERVER ['QUERY_STRING'];
}
header (sprintf ("location: %s", $insertGoTo));
}
@mysql_select_db ($database_MAMPPRO, $MAMPPRO);
$query_Recordset1 = "SELECT *"IDENTITY of the user;"
$Recordset1 = mysql_query ($query_Recordset1, $MAMPPRO) or die (mysql_error ());
$row_Recordset1 = mysql_fetch_assoc ($Recordset1);
$totalRows_Recordset1 = mysql_num_rows ($Recordset1);
? >
<! doctype html >
< html >
< head >
< meta charset = "UTF-8" >
Registeration < title > < / title >
"< link href="jquery-mobile/jquery.mobile-1.3.0.min.css "rel ="stylesheet"type =" text/css">
"< script src="jquery-mobile/jquery-1.8.3.min.js "type =" text/javascript"> < / script >
"< script src="jquery-mobile/jquery.mobile-1.3.0.min.js "type =" text/javascript"> < / script >
< / head >
< body >
< div data-role = 'page' id = "registrationpage" >
< div data-role = "header" >
< h1 > welcome! < / h1 >
< h1 > register yourself! < / h1 >
< / div >
< data-role = 'content' div > < / div >
< do action = "<?" PHP echo $editFormAction;? ">" method = "POST" id = "Register_Form" name = "Register_Form" >
< p >
< label > Email < / label >
< input name = "Register_Email" type = "email" required id = form register_email = "Register_Form" title = "Register_Email" >
< label > < br >
Password < / label >
< input name = "Register_Password" type = "password" required id = form register_password = "Register_Form" title = "Register_Password" value = "" >
< /p >
< p >
< label > name < / label >
< input name = "Register_Lastname" type = "text" required id = form register_lastname = "Register_Form" title = "Register_lastname" value = "" >
< label > < br >
First name < / label >
< input name = "Register_Firstname" type = "text" required id = form register_firstname = "Register_Form" title = "Register_Firstname" value = "" >
< /p >
< name of entry = "MM_insert" type = 'submit' form 'Register_Form' value = 'Registration' = >
< input type = "hidden" name = "MM_insert" value = "Register_Form" >
< / make >
< a href = "index.php" data-role = "button" > return to connection < /a > "
< div data-role = "footer" >
footer < h4 > < / h4 >
< / div >
< / div >
< / body >
< / html >
<? PHP
mysql_free_result ($Recordset1);
? >
Finally I found the problem.
It seems in my setting, MAIL does not work in live mode DW. But if moved to any explores, it works fine.
Adobe really needs to improve its management of PHP.
Maybe you are looking for
-
Toshiba 32DV502: is it possible to use speakers while the headset is connected
Is it possible that the loudspeakers of the TV can be activated when you use headphones?I use the headset to get a sound in a stereo amp output but I want TV sound when the car radio is turned off. The only way it works is to unplug the cable from th
-
I install windows 7 and like her excitement, I install the update, but I found that the problem lies in the networking. Suddenly, I can't connect to the internet using my connection broadband, troubleshooting is I have to disable my LAN and try to fi
-
I was wondering if anyone has experience with this error message, even if they print on their all-in-one: 'the scanner could not be initialized (Scanner not found).' I could scan until I unpacked & re - configure my Mac to a new apartment - as far as
-
How can I see all the restore points?
I have Vista and my system has become unstable - black screen and no reply until I turn off computer with switch. I decided to do a restore. Come to the window to restore the system, but only two show Restore Points - yesterday and day before. But th
-
Unknown icon of Smartphones BlackBerry blackBerry / HELP me
There is a weird indication on my home screen, it is yellow and he used to say 1 (symbol) and now it's 2 (symbol). It is yellow and looks like the icon small browser but without the arrow. What is c? How can I get rid of him? Thank you