Need script to insert records
Hi all,
I have to insert table LOCAL with entire contents of table REMOTE, minus any duplicates. Both tables have identical structures just hold different years of data. End result needs to be 1 gigantic table of all years. The tables have 7 indexes on each. Each table has about 20 million records. Any suggestions?
I do not know PL/SQL well. Given a generic script I should be able to figure it out.
Many thanks
I'm sorry I should of mention that the year data in both tables are overlapping.
It was recommended by the vendor to purge historical data off. This alleviated the bogging down of the production database with querying very large tables. So every couple years the database was cloned to an archive database and used for reporting purposes.
The end result: we have an administrative nightmare. The goal is to get all historical data into 1 reporting db.
There is actually 4 archive dbs I am trying to merge into 1. ie 1 database has some 2001, all 2002-2003, some 2004. The 2nd has some 2004, all 2005-2006, some 2007. This is a financial/payroll database containing records with many different dates. For example on the finance - this particular table I have requested for help om a query has 4 different dates - -transaction date,, approval date, a check date and a reconciliation date (which may be in that year or not, or never has been reconciled) ....
This was the concern for the duplicates.
Thank you
Similar Messages
-
Clueless NEWBIE DEVELOPER, NEEDS ASSIST with Insert Record Server Behavior
Experienced DW designer learning CFMX7. I cannot seem to get
beyond this error message when using the Insert Record server
behavior to write data from a form into the database. Using MS
Access 2002, CFMX7's internal server, DW 6.0. Please note that I am
learning development for the first time and am using tutorials. I
was able to connect at one point but now I cannot.
See error message below:
The following information is meant for the website developer
for debugging purposes.
Error Occurred While Processing Request
Error Executing Database Query.
Syntax error in INSERT INTO statement.
Resources:
Enable Robust Exception Information to provide greater detail
about the source of errors. In the Administrator, click Debugging
& Logging > Debugging Settings, and select the Robust
Exception Information option.
Check the ColdFusion documentation to verify that you are
using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; .NET CLR 1.1.4322)
Remote Address 127.0.0.1
Referrer
http://localhost:8500/moosek/TMPu724j3nl2j.cfm
Date/Time 07-Aug-06 07:23 PM
Text
TextMongoSlade,
I had this exact same problem with a CFMX 7 datasource that
was set up as Microsoft Access with Unicode. It turns out that
"Password" is a reserved word in the Unicode driver. Or somewhere.
I got around it by putting square brackets, i.e., [ ] around the
column name, like this:
update MyTable
set [Password] = '#form.Password#'
where UserID = '#form.UserID#'
That solved the problem nicely. I hope this solution will
work for you as well. -
I need how to insert records in ztable through modulepool
Hi All
I created a modulepool screen, in that i placed some fields from ztable.
Now i enter the record in that screen text area and push submit button it would be
store in ztable.
plz some one help me by sending the INSERT code for that
Thanks
LokeshHi,
Check out the following code.
TABLES: Ztable. .
DATA : BEGIN OF IT OCCURS 0,
sortl LIKE kna1-sortl,
SGTXT LIKE MSEG-SGTXT,
WERKS LIKE MSEG-WERKS,
LGORT LIKE MSEG-LGORT,
END OF IT.
*& Module USER_COMMAND_1000 INPUT
text
MODULE USER_COMMAND_1000 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'SAVE'.
ztable-agency = it-sortl.
ztable-AGENCY = IT-SGTXT.
ztable-WERKS = IT-WERKS.
ztable-LGORT = IT-LGORT.
INSERT ztable.
MESSAGE S100(ZMMABAP) .
IF SY-SUBRC NE 0.
MESSAGE E101(ZMMABAP).
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
*& Module STATUS_1000 OUTPUT
text
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'Zstatus'.
SET TITLEBAR 'title'.
ENDMODULE.
Reward points if helpful.
regards,
CS -
Need script to insert pages with specified master
Several years ago, someone here (I think Dave, maybe Ole) helped me out by giving me a short script that when run added a blank page (with a specified master page different from the previous page) after each page of a document.
I've had an emergency reformat of my system and have lost that script which I need constantly for work projects. I tried searching here, but it was before the current forum setup (I think around 2 years ago) and I can't find a way to get to the archives.
If anyone can either provide me with the java script code for this or point me to the old messages about it, I'd be very appreciative.
And, BTW, I am now using CS4 (though I'm sure the script I've been using was from an older version).
Thank you.Aaahhh ... PageMaker scripting. Now there was a challenge -- I don't think I ever could write the thing I intended with that.
This quick javascript works on CS, but I don't think the syntax has changed (much) for CS4. Yell if it doesn't work.
Be sure to fill in the right 'blank page' name in the first line! That includes the prefix and the hyphen -- the script will alert you if you got it wrong
//DESCRIPTION: Add Blank Master Page after each page
masterPageName = "A-AddMe";
masterPage = app.activeDocument.masterSpreads.item(masterPageName);
if (masterPage == null)
alert ('"'+masterPageName+'" is not a valid master...');
exit(0);
// Start at the end:
currentPage = app.activeDocument.pages.length-1;
while (currentPage >= 0)
theNewPage = app.activeDocument.pages.add (LocationOptions.AFTER, app.activeDocument.pages[currentPage]);
theNewPage.appliedMaster = masterPage;
currentPage--;
Copy, paste into a plain text editor (InDesign's ESTK is good) and save as "insertBlanksAfterAll.jsx" in your Scripts folder. When saved in the right folder, it will automatically become available in the Scripts Panel. -
I bulid trigger in tabel and check condition, if for example check_statment = X i need to delete inserted record (that mead not insert record) and when check_statment = Y then insert record in table, i try to write delete statment and rollback but there is error appear that the current record are reserved.
How i can solve it.1. Triggers cannot Issues ROLLBACK, SAVEPOINT, COMMIT statements.
2. I guess you are trying to avoid duplicate records, Create a unique index on the key(col1,col2) which you want to prevent duplicates on.
3. Or you can Add a column Flag Chr(1) to your table. While inserting you allow the records to get inserted, but based on your condition change the Flag to 'D' - deleted , 'A' -active. Build a View which the user uses for application filtering out the 'D'eleted records.
Does this look like what you are trying to do !
Ss -
Need Help in Inserting first ever record
I need help in inserting my first ever record from an OAF page.
I've created an AM 'MasterAM', added 'MasterVO' to it. Created a Page CreatePG which has a submit button, id = Apply
Below is processRequest of CreateCo
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (!pageContext.isFormSubmission()) {
am.invokeMethod("createRecord", null);
and below is processFormRequest
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Apply") != null)
OAViewObject vo = (OAViewObject)am.findViewObject("MasterVO1");
am.invokeMethod("apply");
pageContext.forwardImmediately("OA.jsp?page=/abcd/oracle/apps/per/selfservice/xxdemo/webui/CreatePG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
Below are 'createRecord' and 'apply' in MasterAMImpl
public void createRecord(){
OAViewObject vo = (OAViewObject)getMasterVO1();
if (!vo.isPreparedForExecution()) {
vo.executeQuery();
Row row = vo.createRow();
vo.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
public void apply() {
getTransaction().commit();
When I run the page, it opens and I try to enter some data and press Apply. it does not insert into the table.
Could anyone help me out.
My jdeveloper version is 10.1.3.3.0.3I am facing the same issue.
rows get inserted into the tbale, but only whol columns have the data.
all the attributes are correctly mapped to view instance and view attribute.
My VO has 1 EO and , i have joined another table to get desctriptions of the field.
could that be the problem ?
ex :
select item , desc
from t , master
where t.cola=master.colb
table t is the custom table I want the data to go in. but only who columns appear after commiting.
any clues ? -
I need to insert records in a ztable through bapi
Hello Gurus,
I am new to bapi creation. And I need to insert records in a ztable through bapi. similarly updation.can you send me with example.Its urgent.
Thanq you.Hi satish,
I have created a bapi but what is happening is i need to insert few records through bapi.say i have to insert records for an employeeno say 1 and for that employee i need to insert other field values like item_no and value and date.but i am not givin the other fields in import parameters.that is item_no and value and date.so plz give me a solution for this querry.
Thanq you Satish. -
Why grant select is needed on a table when you are only inserting records
Please can you tell me why a grant select is needed when inserting records which are being inserted across a link?
We have a table in database1 which we are trying to insert records from database2. database2 has a db_link to database1.
The table residing in database1 has grant insert to the named user in the db_link. But unless there is also a grant select to that user we cannot insert records. We do not actually need to be able to select the records across the db_link, but nevertheless we get the following error on trying to insert records without the grant select being in place:
ORA-01031: insufficient privileges
Cause: An attempt was made to change the current username or password without the appropriate privilege. This error also occurs if attempting to install a database without the necessary operating system privileges. When Trusted Oracle is configure in DBMS MAC, this error may occur if the user was granted the necessary privilege at a higher label than the current login.
Action: Ask the database administrator to perform the operation or grant the required privileges. For Trusted Oracle users getting this error although granted the the appropriate privilege at a higher label, ask the database administrator to regrant the privilege at the appropriate label.
Your thoughts would be appreciated.Since there is no remote describe function, a select must be done to get the table structure. This is talked about in Note: 1004923.6.
-
Inserting Record In same table through triggers.
Hi,
I've a table cus_mst ( cus_div_cd vachar2(1), cus_cd varchar2(5), cus_nm varchar2(100) )
Records are inserted in this table through forms ...
We need to automatically insert a record with a diff div_cd for any record inserted in the table .
If div_cd 'I' is entered automatically a record with div cd 'S' with other coulmns having same values should get inserted .
In case div_cd is 'S' then record with div_cd 'I' should get created.
Eg : If in insert ( 'S', 'A0001', 'ABC COmpany' ); another record with values ( 'I', 'A0001', 'ABC Comapny' ) gets created;
One way to do is to insert records in a view ( on the table ) and use instead of trigger to insert the corresponding record. But that is not possible as development team has to change form and use view instead of table.
Have tried doing it by populating a collection in-each-row trigger and then using statment level trigger to insert from the collection. But this leads to recursive error.
Would be great to get more insights into this..
thanks
cheers
JaaniHi,
Within the following script you need to make adjustments according to your needs about the columns you need to test. But this might help you.
Sorry for the layout. But I was not able to adjust it in a short time.
drop table ad_test
create table ad_test ( col1 varchar2(1), col2 varchar2(5), col3 varchar2(100) )
create or replace package ad_test_pkg is
procedure initialize_postpone ;
procedure postpone_record( r_atst in ad_test%rowtype ) ;
procedure handle_postponed_records ;
end ad_test_pkg ;
create or replace package body ad_test_pkg is
type type_atst is table of ad_test%rowtype index by binary_integer ;
t_atst type_atst ;
procedure initialize_postpone is
begin
t_atst.delete ;
end initialize_postpone ;
procedure postpone_record( r_atst in ad_test%rowtype ) is
begin
t_atst(t_atst.count) := r_atst ;
end postpone_record ;
procedure handle_postponed_records is
cursor c_test( cpiv_col1 in ad_test.col1%type ) is
select 'x'
from ad_test
where col1 = cpiv_col1
r_test c_test%rowtype ;
r_atst ad_test%rowtype ;
begin
for i in t_atst.first .. t_atst.last
loop
r_atst := t_atst(i) ;
if r_atst.col1 = 'I'
then
r_atst.col1 := 'S' ;
else
r_atst.col1 := 'I' ;
end if ;
open c_test( cpiv_col1 => r_atst.col1 ) ;
fetch c_test into r_test ;
if c_test%found
then
close c_test ;
else
close c_test ;
insert into ad_test
( col1
, col2
, col3
) values
( 'S'
, r_atst.col2
, r_atst.col3
end if ;
end loop ;
end handle_postponed_records ;
end ad_test_pkg ;
create or replace trigger test_ad_bis
before insert on ad_test
begin
ad_test_pkg.initialize_postpone ;
end ;
create or replace trigger test_ad_air
after insert on ad_test for each row
declare
r_atst ad_test%rowtype ;
begin
r_atst.col1 := :new.col1 ;
r_atst.col2 := :new.col2 ;
r_atst.col3 := :new.col3 ;
ad_test_pkg.postpone_record( r_atst => r_atst ) ;
end ;
create or replace trigger test_ad_ais
after insert on ad_test
begin
ad_test_pkg.handle_postponed_records ;
end ;
insert into ad_test values ( 'I', 'A0001', 'ABC COmpany') ;
select * from ad_test ;
Greets,
Ad
Edited by: loaddev on 10-nov-2010 4:47 -
Using Crystal 2008 to insert records into a table
Hi,
We have a unique need to use Crystal to insert records into a table. We have managed to test a report that can write into a temporary table. This is done by using sql command object and uses the following code :
INSERT INTO TEMP_TABLE (ORDERID)
VALUES ({?orderid}) (-- where orderid a parameter).
This test report asks for an order id and then inserts the record perfectly fine.
Now moving on to the real report - This report basically prints orders in batches and we want to insert order id into a temporary table to ensure we don't print orders that were already printed. To do this we created a sub report "insert orders" that has the above insert command. The main report passes the orderid to subreport and the idea is that the subreport would insert each time an order is passed. So if main report printed 50 orders ids, the then it would do 50 inserts individually into the temp table.
This however is NOT working. The report runs fine but there is no insert. Our hunch is that Crystal is not committing after every order id is passed from the main report. Not sure if we can set the AUTO COMMIT ON as a default somewhere?
Wondering if any one has attempted this or has any insights?
Regards,
Mohit.
Environment is - Crystal 2008 and Oracle 11GR2, we are using Oracle drivers (and not odbc)Hmmm... I don't use Oracle but the syntax looks good...
You've already tested it and I assume that you are using the same driver in the production report as you used in the test, so that shouldn't be an issue...
how are you pulling the data? Is the final SELECT statement that pulls the report data in the same command as the INSERT script, or is the INSERT script in it's own command?
The reason I ask... If you are trying to pass a multi-valued parameter to a command, it won't work. If you have the insert command as it's own command while the data is being pulled with linked tables or a separate command, it is possible that the report itself will execute as expected w/o passing a value to the insert script.
If it's all in 1 command (as it should be), a bad parameter would fail in the final SELECT causing an error.
Also... are rows null or empty string values being added to table when the report executes? This would be an indication that the command is being executed but isn't getting the parameter value.
Jason -
PHP Form Validation and Insert Records
Hi There,
I've been scratching my head for 2 days and couldn't find a solution.
Here is my problem:
Go to http://ecopethandbags.com/contactTest.php and click the "Send Comments" button.
You will see that the validation works.
Now, go to http://ecopethandbags.com/contactTestInsert.php, this time, I've inserted the "Insert Record" server behavior.
Click the "Send Comments" button again.
You will see the ugly message like "Column 'firstname' cannot be null" in a plain white page.
My question is:
How can I insert the PHP form records in my database and take advantage of the form validation nicely like in http://ecopethandbags.com/contactTest.php
I am attaching the files.
Thank you for you help!boloco wrote:
My question is:
How can I insert the PHP form records in my database and take advantage of the form validation nicely like in http://ecopethandbags.com/contactTest.php
Use simple PHP logic to merge the scripts together.
Dreamweaver automatically puts the Insert Record server behavior code at the top of the script. You need to adapt it so that the validation is done first. If the validation succeeds, use the Insert Record server behavior. If not, redisplay the form.
if (array_key_exists('send', $_POST)) {
// validate the form input
if (!$suspect && empty($missing)) {
// send the mail
if ($mailSent) {
unset($missing);
// insert the Insert Record server behavior code here -
Insert Record and Redirect Data
I have a website where we are adding articles to categories.
I need to be able to have a user add an article and then have the
option to add that same article into another category.
I'm using the INSERT RECORD behavior now but I'm looking for
an extension that will INSERT RECORD plus redirect the record/data
to another page so the user can add it to another category.I found this in the upload scripts read me file:
The clsUpload object contains public functions and methods
which enable you to upload and save files to a web server using
pure VBScript.
Read only
Data Type: Dictionary Collection
Syntax: object.Form
Returns a Forms collection consisting of all the Form objects
parsed from the HTTP header.
This collection contains all the HTML form elements which are
not "Files"
This collection should be used instead of the typical
"request.form" method to access data from the other form elements
(if you decide to combine "file" upload elements with other form
element types, like checkboxes, text boxes, drop-down lists,
textareas). Why? Because the form data is posted using
"multipart/form-data" encoding (and needs to be retrieved like
binary data instead of text data) and therefore the typical
"request.form" method isn't effective.
I changed request.form to clsUpload.form but it still did not
work. -
New browser window after insert record
I need some help in modifying the insert record so the the
goto page opens in a new browser window. I'm working with
PHP/mySQL. I would expect that I need to modify this section of the
code.
$insertGoTo = "new_page.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
Tried changing the first line to
$insertGoTo = "MM_openBrWindow('new_page.php',' ',' ')";
which does not work. I little help would be greatly
appreciated.The only way I know is using javascript.
Here I give you an example:
*main.html*********
<html>
<head>
<script language="javascript1.2">
<!--
function Change(){
window.open("child.html","","toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=120,left=300,top=260");
-->
</script>
<body>
<center>
<form name="form1">
<table>
<tr><td>Selected value:</td><td><input type="text" name="tf" value="(none)"></td></tr>
<tr><td colspan="2" align="center"><input type="button" value="Change Value" onClick="Change()"></td></tr>
</table>
</form>
</center>
</body>
</html>
*child.html*********
<html>
<head>
<script language="javascript1.2">
<!--
function Change(){
window.opener.document.form1.tf.value=document.form2.select.value;
-->
</script>
<body>
<center>
<form name="form2">
<table>
<tr><td>Value:</td><td><select name="select"><option value="1">1</option><option value="2">2</option><option value="3">3</option></select></td></tr>
<tr><td colspan="2" align="center"><input type="button" value="Change" onClick="Change()"></td></tr>
</table>
</form>
</center>
</body>
</html>
Best Regards! -
Im trying to insert data captured from a registration form
using Dreamweavers insert record scripts and need the data to be
sent to a user as it has a activation link inside the mail using
random numbers inserted into the database via a hidden form field.
Ive put the PHP Mail after the "$Result1 =
mysql_query($insertSQL, $sgu) or die(mysql_error());" line - but
its not sending at all.
Is there something i need to do or is there something im
doing wrong? Ive tried two variations of the mail() function, one
which i know for sure works as im already using it else where - and
one i discovered as a solution to the problem im having when
googling it.
Any help would really be appreciated!
Thanks,
JAll you do is locate the part of the insert script that
handles the
redirection to the success page and then copy (or write) your
mail script
there.
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"SamDesign.be" <[email protected]> wrote in
message
news:et6t3a$r77$[email protected]..
> Hi,
> I have an insert record in my ASP page to my db Access,
that's works fine.
> I want to know if it is possible to send at the same
time a mail to me
> that
> tell me there is a new record?
> Can I put two form actions in the same form?
>
> <form action="<%=MM_editAction%>" method="POST"
name="frm_connaitre"
> id="frm_connaitre">
> <form action="/fr/mail/mail.asp" method="post"
name="frm_connaitre"
> id="frm_connaitre">
>
> Response from bregent:
> No. You should execute the form mail script after the
insert record is
> successful.
>
> My question:
> Can someone explain to me how to execute the form mail
script after the
> insert
> record?
> Thanks in advanced
> Sam
>
> -
[SOLVED] FRM-40508:ORACLE error: unable to INSERT record
Hi all,
I have migrated this form from 4.5 to 10g (Version 10.1.2.0.2 ). This form inserts a record into the database table when all the fields in the form are filled and a button Save is presed.
At the time when I press the Save button, I get this error. FRM-40508:ORACLE error: unable to INSERT record
So I went on to see the "Display Error" from help and found to be the database error, inserting into a table.
The error message is ORA-00932: inconsistent datatypes: expected DATE got NUMBER
The form where I press Save button has 3 date fields and I checked the properties of them and they are Date only.
I also generated to object list report and tried to find some answer, but no use.
Please help me in debugging this form.
Edited by: Charan on Aug 18, 2011 4:05 PMI think you need to get a description of the table and compare all the "database" columns in the form with the ones in the database table to see that the types match. Somewhere there's a mismatch. Also check the block(s) "query data source columns" and see if there's any
columns in there that the type does not match the table. (check the sizes of things too while you're at it.)
Maybe you are looking for
-
What is the t.code of accounting key creation in TAX
hi all anybody can tell me what is the t.code of accounting key creation in TAX regards kalai
-
New machine install, terribly slow response
I'm hoping someone can shed some light here, I've recently built a new NLE for CS5.5 and the thing's incredibly slow to load, encode or even respond to an export command. A few specs on the new machine: Dual Xeon 3.47GHz 6 core CPU's, 12 cores total,
-
Opening RAW file from CS2 in LR instead of Camera Raw.
Has anyone found a way to open a RAW file in Photoshop that will open it automatically in LR instead of CS2's Camera Raw?
-
How can I get my pics back that were deleted from icloud?
How can I get my pics back that were deleted from icloud?
-
Hallo, die Angabe von Nullwerten der (ostdeutschen) PLZ in Numbers ist schon recht schwierig, aber umständlich machbar (mit eigener Formatierung = Nullwerte anzeigen). Die Übernahme in pages (Adresse mit PLZ) gelingt nicht. Beispiel: 4129 Leipzig = f