INSERT INTO statement does not
I'm trying to insert values from one table into another table using forms. I create the destination table during execution that works very well. But the insert statement doesnot work. It does not error, but no rows are inserted in the destination table, although there are data in the source table. Calling a stored procedure to this effect.I wrote the following code in the event When button pressed
DECLARE
T_DATE VARCHAR2 (20);
v_table VARCHAR2 (20);
BEGIN
T_DATE: = TO_CHAR (SYSDATE, 'DD') | TO_CHAR (SYSDATE, 'LUN') | TO_CHAR (SYSDATE, 'YYYY');
v_table: = 't' | T_DATE; -It's a destination table name, the table is separately created with the same name
BACKUP_PRODUCTS (v_table); -Stored procedure
END;
According to the code of procedure stored
PROCEDURE backup_products (p_table VARCHAR2) IS
BEGIN
RUN IMMEDIATELY "INSERT" | p_table | "(SELECT product_id, name, price FROM products);
END;
I already checked that the stored procedure is executed using some arbitrary return values using VARIABLE. Its just that the insert will not work.
If I run this procedure from the SQL prompt, the procedure works very well.
Prior to that, I also tried to use the exec_sql procedures, but the insert statement was not insert data.
Can someone pls help me identify the problem?
Engage?
Concerning
Peter
Tags: Database
Similar Questions
-
Simple Insert statement does not
This problem is just driving me crazy. I don't know what I'm doing wrong here. The code works fine on my localhost, but gives the problem on the site online. It's a simple insert like this:
insert into tblSubImages (productid, title, subdescription, image, location) values (#form.productid #, ' #form.title #',' #form.subdescription #',' #uploadedimage # ", #form.place #")
The error I m to looks like this:
Syntax error in INSERT INTO statement.
The error occurred in D:\Hosting\davedhillon\superprinters\admin\addaditional.cfm: line 11
9: < cfset uploadedImage = cffile.serverfile >
10: < cfquery name = "insertadditional" datasource = "#super.dsn #" >
11: insertion in values(#form.productid#,'#form.title#','#form.subdescription#','#uploadedimage#') tblSubImages (productid, title, subdescription, image)
12: < / cfquery >
13:
--------------------------------------------------------------------------------
SQL insert into values(1,'ewr','werw','FamilyRoomBedroom.jpg') tblSubImages (productid, title, subdescription, image)
Davedhillon_accesscf_super DATA source
VENDORERRORCODE 3092
You can see that it is the simple insert statement that I worked with so many times. Why he started giving problems all of a sudden?
Thank you'Image' can be a reserved word. What happens if you do this?
insert into tblSubImages (productid, title, subdescription, [image])
values (...) -
Comment of "Syntax error in INSERT INTO statement." validation error.
I had this working perfectly on MySQL. Then I was told that I had to do with a mdb database in Access, now the errors pop up like crazy. I fixed all of them except this one, I get a "syntax error in INSERT INTO statement." When I try to post a comment on a post in my mini-blog site.
The thing is, I use almost the same code for the comments I make blog themselves. The positions work fine, the comments are not.
He said that the error is on my page addcomment_process as 119. It is the following (line 119 is underlined, bold line is also bolded in the error message):
< name cfquery = "input_comments."
DataSource = "" #DSN # ""
username = "" #DSNUSER # ""
password = "#DSNPASS #" >
INSERT INTO (comments)
speaker,
Comment,
DateTime,
post_id
)
VALUES)
"#form.commenter #"
"#form.comment #"
"#form.datetime #"
"#form.post_id #".
)
< / cfquery >
It is all fine data, by simply inserting not, because it says:
"INSERT INTO comments (speaker, comment, datetime, post_id) VALUES ('Anonymous', 'test commentary.', 25 April 12 22:55 ', ' 2').
It worked perfectly, when it was a MySQL database, now I keep getting errors present a part of the site now that it is MDB. Anyone know what is happening?
DateTime is a reserved word in Access.
--
Adam
-
I have a new computer running windows but 10, 13 photoshop elements disc. Insert the disc does not start something going and looking at the files I do not see an installation executable. I don't know what to do.
Download from Download Photoshop Elements | 14, 13, 12, 11, 10
Install and enter your serial number.
-
Active state does not properly in Chrome
Hello
I recently exported the site I created in HTML and everything seems to work well. The only problem I encounter is that active State does not work in Chrome. When I scroll to the bottom of the page, the color of the active state is not reflected. This does not work in IE, Safari and Firefox. Really need this to be resolved soon. Help, please!
Thank you!
Ryan
Hi whyax84 and Zak.
Download Yes it indeed solved the problem for chrome. Thank you very much!
Kelvin
-
ORA-13780: SQL statement does not exist
Hello
on the 11g R2, I get the following message:
Any idea?SQL> variable stmt_task VARCHAR2(64); SQL> EXEC :stmt_task := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_id => 'gh9p77g1fr0kd'); BEGIN :stmt_task := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_id => 'gh9p77g1fr0kd'); END; * ERROR at line 1: ORA-13780: SQL statement does not exist. ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79 ORA-06512: at "SYS.PRVT_SQLADV_INFRA", line 125 ORA-06512: at "SYS.DBMS_SQLTUNE", line 655 ORA-06512: at line 1
Thank you.Sql and the sql_id execution plan has been emptied out of the shared pool, so oracle could not find it.
-Thank you
-
Rollover State does not not on active state
Hi, I have a problem with the menu States. The rollover State does not work when a menu item is in its active state. This is supposed to happen or is there a solution to this?
Thank you.
Hello
This works as expected. Active state removes change it to any other State on the interaction of the mouse and other States work only on the links that are currently in Normal condition.
See also: https://forums.adobe.com/thread/1136562
See you soon,.
Vikas
-
Menu rollover State does not have the button active parent
My menu rollover State does not work the button parent in my menu while I'm on a page of the child. I didn't have any currently active States in the menu. How can I get the parent menu to respect the rollover State even while I'm on one of the child pages?
Please check this thread:
https://forums.Adobe.com/message/6148234#6148234
Thank you
Sanjit
-
Delete statement does not work properly
Hello
The following delete statement does not work correctly.
If I press DELETE will delete everything in the table of categories
I don't know whats wrong with it.
-Delete category line if there is not the infrastructure to support-
IF: P12_DFCY_SEQNO4 IS NOT NULL AND: P12_DFCY_CATG_C = "7" THEN
REMOVE FROM DFCY_CATG
IF NOT EXISTS (SELECT I.DFCY_SEQNO
OF DFCY_CATG C, DFCY_CATG_INFRSTRCTR I
WHERE C.DFCY_SEQNO = I.DFCY_SEQNO
AND: P12_DFCY_SEQNO4 = I.DFCY_SEQNO);
end if;
Thank you
MaryYou probably the where more clause:
DELETE FROM DFCY_CATG WHERE C.DFCY_SEQNO = :P12_DFCY_SEQNO4 AND NOT EXISTS(SELECT I.DFCY_SEQNO FROM DFCY_CATG C, DFCY_CATG_INFRSTRCTR I WHERE C.DFCY_SEQNO = I.DFCY_SEQNO AND :P12_DFCY_SEQNO4 = I.DFCY_SEQNO);
Not sure if this is the exact name of your column in the table, but that limit the scope of deleting just a record that you control.
Hope it will be useful,
Aaron
-
Statement INSERT INTO stuck, do not insert data
8174 (former ancient db) version on Solaris 8
Below work was running fine, until toady, nothing seems to have changed, no idea how to solve this problem? I check all the tablespace/file system, made the switches of the logfile etc and checked alert logfile, no idea yet...
SQL > select count (*) FROM findata.averion_etc_mapping_v;
COUNT (*)
----------
26352
SQL > select count (*) in the findata.etc_pjtran_summary;
COUNT (*)
----------
0
SQL > @updpjtran.sql;
SQL > SET FEEDBACK ON
SQL >
SQL > SPOOL /u06/users/db/oracle/updpjtran.lis
SQL >
SQL> -- =============================================================================================================
SQL >-Script:
SQL >-author: EOKALI
SQL >-Date: July 1, 2008
SQL >-reason: calls PC to update the value of the quantity of Deltek data in the PJTRAN table
SQL >--
SQL >--
SQL >--
SQL >-changes
SQL >-version: < X.X.XX >.
SQL >-change number: change source control number >.
SQL >-change Date: DD-MON-YYYY >.
SQL >-author of change: author of modification of the source code >.
SQL >-change Desc: Description of modification of the source code >.
SQL >-change Params: NewCode = < YES/NO >
SQL >-ModifyCode = < YES/NO >
SQL >-DeleteCode = < YES/NO >
SQL >-SingleChange = < YES/NO >
SQL >-GlobalChange = < YES/NO >
SQL> -- =============================================================================================
SQL >
SQL >
SQL> -- ============================================================================================================
SQL >-time
SQL> -- ============================================================================================================
SQL >--
SQL > SELECT TO_CHAR (SYSDATE, ' DD/MM/YYYY HH24:MI:SS') "Todays Date and time is:
2 double;
Today's Date/time is
-------------------
13/06/2012-13:30:33
1 selected line.
SQL >
SQL> -- ============================================================================================================
SQL >
SQL >-moved from script to FINSBO1 box
SQL >
SQL >-UPDATE findata.averion_pjtran_cp
SQL >-amount FIXED = units * findata.averion_calclaborrate_mod (company_id empl_id proj_id, laborclass, trans_date)
SQL >-WHERE source = 'DELTEK.
SQL >
SQL >-COMMIT;
SQL >
SQL> -- ============================================================================================================
SQL >-update the summary table for the tool ETC. necessary for the performance summary table
SQL> -- ============================================================================================================
SQL >
SQL > DELETE FROM findata.etc_pjtran_summary;
0 rows deleted.
SQL >
SQL > COMMIT;
Validation complete.
SQL >
SQL > INSERT INTO findata.etc_pjtran_summary
2 (project,
3 seqnum,
etc_activity 4,.
5 actualhrs,
actualamt 6,.
7 budgethrs,
8 budgetamt)
9. SELECT
Project 10,
11 seqnum,
etc_activity 12,
13 findata.etc_pkg.acthrs_byactivity (project, seqnum) acthrs,
14 findata.etc_pkg.actamt_byactivity (project, seqnum) actamt,
15 findata.etc_pkg.bdgthrs_byactivity (project, seqnum) bdgthrs,
16 findata.etc_pkg.bdgtamt_byactivity (project, seqnum) bdgtamt
17 FROM findata.averion_etc_mapping_v
18 project GROUP, seqnum, etc_activity;DBA2011 wrote:
8174 (former ancient db) version on Solaris 8Tough - very old version. I must rememeber what will work in v8...
From your post, I understand that the INSERT locks just without activity - a new development. Nothing has changed since the last sucessful run? If so, then what?
Some ideas of related questions:
1. can you run the SQL by itself without the INSERT to see if the SELECTION is the problem? If so how long does it take?
2. is the locked table?
3. is there that expect everything from events that occur during the insertion process?
4. how much time do you expect it to end?Later: what part was right?
Published by: riedelme on June 13, 2012 12:10
-
With multi-page session state does not save
Hello
I built an online form using apex that has 4 pages. The first 3 pages save in a session state on the last page running a process that inserts the data of 4 pages in the table. The first 3 pages are set to present an update of SQL.
The issue I'm having is that when I want to go back to a page within the session using the previous buttons, I created, the values of the previous page is no longer present in the fields (all fields are now empty). I got to the origin of the previous button to submit and then redirect to the previous page when clicking on the value. Then I tried just to set the button to redirect to the previous page without presenting and then it does not still work. Anyone know what could be causing this? Your help is very appreciated.
Thank you
MICAHHi Mika,
Have you checked the source of the page elements in your form to make sure that they are not using "Always replace any value stored in session state". If this field is selected in the menu drop-down, then they will be wiped off.
Thank you
Paul
-
OrderID if else statement does not
I have a page of payment if I orderID does not exist I want to create a new command id or if the orderID is using the current order id, but if it is not an empty order it does not give you a new command id
Check if there is already an order
$query = 'SELECT payment_id FROM host_payments WHERE payment_userid = %s AND payment_transaction_status = AND payment_amount_due = payment_type = LIMIT 1 %s AND %s %s';
$query = sprintf ($query $userid, $transaction_status, $amount_due, $payment_type);
$results = mysql_query ($query);
If (mysql_num_rows ($Results) > 0)
{
While ($Row = mysql_fetch_array ($Results))
{
$existing_payment_id = $row ['payment_id'];
}
}
on the other
{
Create order
$query = "INSERT INTO host_payments (payment_userid, payment_created_timestamp, payment_amount_due, payment_transaction_status, payment_type) VALUES (%s, %s, %s, %s %s)";
$query = sprintf ($query $userid, $timestamp, $amount_due, $transaction_status, $payment_type);
$results = mysql_query ($query);
$query = 'SELECT payment_id FROM host_payments WHERE payment_userid = %s AND payment_created_timestamp = AND payment_amount_due = payment_type = LIMIT 1 %s AND %s %s';
$query = sprintf ($query $userid, $timestamp, $amount_due, $payment_type);
$results = mysql_query ($query);
While ($Row = mysql_fetch_array ($Results))
{
$payment_id = $row ['payment_id'];
}
}
then
If (isset ($existing_payment_id) & &! empty ($existing_payment_id))
{
$ORDERID = $existing_payment_id;
}
on the other
{
$ORDERID = $payment_id;
}
$ORDERID = $payment_id; $existing_payment_id;
the variable I want to use at the end to send the bridge is so $ORDERID
> I need to take on more script for your suggestion to work?
You follow one of my last two suggestions!
Try this.
Check if there is already an order
$query = 'SELECT payment_id FROM host_payments WHERE payment_userid = %s AND payment_transaction_status = AND payment_amount_due = payment_type = LIMIT 1 %s AND %s %s';
$query = sprintf ($query $userid, $transaction_status, $amount_due, $payment_type);
$results = mysql_query ($query);
If (mysql_num_rows ($Results) > 0)
{
$row = mysql_fetch_array ($results)
$ORDERID = $row ['payment_id'];
}
on the other
{
Create order
$query = "INSERT INTO host_payments (payment_userid, payment_created_timestamp, payment_amount_due, payment_transaction_status, payment_type) VALUES (%s, %s, %s, %s %s)";
$query = sprintf ($query $userid, $timestamp, $amount_due, $transaction_status, $payment_type);
$results = mysql_query ($query);
$ORDERID = mysql_insert_id();
}
-
insert this line does not exist
Hi all
I need to insert a line using the daily procedure. Insert must only be performed when this line does not exist in the table. Please suggest me a decision. I know it's simple question, sorry for disturbing (Burns my brain).Hello
Use MERGE.
http://download.Oracle.com/docs/CD/B28359_01/server.111/b28286/statements_9016.htm#sthref9082
If you use Oracle 10 (or higher) then you don't need a section "WHEN MATCHED.If you want to know, post a small example of data (CREATE TABLE and INSERT statements, showing all the tables involved, as they exist prior to the INSERTs in question). Put one or two unconditional instructions INSERT (including an example of each matching rows found and not found) and the results you want (that is, the content of the table changed after the INSERTs).
Always tell what version of Oracle you are using. -
Insert using TO_NUMBER does not seem to accept the decimal value
Oracle 10g
I'm trying to insert a decimal value in a table from another table oracle oracle. The column of the source table is a data type
The destination table contains the following:"PLOTSIZE10_30CM" VARCHAR2(4 BYTE), "PLOTSIZE30_50CM" VARCHAR2(4 BYTE), "PLOTSIZE50CM" VARCHAR2(3 BYTE),
When I run the insert statement as the following decimal values are not inserted into the destination table."PLOT_SIZE_10_30CM" NUMBER(7,0), "PLOT_SIZE_30_50CM" NUMBER(7,0), "PLOT_SIZE_50CM" NUMBER(7,0),
See you soonSQL> SELECT DISTINCT PLOTSIZE50CM FROM IMPORT_DATA WHERE STAND_ID = 23; PLO --- 0.2 SQL> SQL> INSERT INTO 2 psp_plot_measurements 3 ( species_major 4 , plot_location_id 5 , codominant_height 6 , regen_density_primary_code 7 , regen_density_secondary_code 8 , PLOT_SIZE_10_30CM 9 , PLOT_SIZE_30_50CM 10 , PLOT_SIZE_50CM 11 ) 12 SELECT DISTINCT species_major 13 , '2' 14 , height_codom 15 , regen_prim 16 , regen_sec 17 , TO_NUMBER(plotsize10_30cm) 18 , TO_NUMBER(plotsize30_50cm) 19 , TO_NUMBER(plotsize50cm) 20 FROM import_data 21 WHERE stand_id = 23; 1 row created. SQL> SQL> SELECT PLOT_SIZE_50CM FROM PSP_PLOT_MEASUREMENTS; PLOT_SIZE_50CM -------------- 0
BenHi Ben,
If the destination table have the column as a Number (7.0) and then how you can store a decimal value.
The destination table contains the following:
"PLOT_SIZE_10_30CM" NUMBER(7,0), "PLOT_SIZE_30_50CM" NUMBER(7,0), "PLOT_SIZE_50CM" NUMBER(7,0),
Look at sample scenario-
SQL> CREATE TABLE TEST1(COL NUMBER(7,0)); Table created. SQL> CREATE TABLE TEST2(COL NUMBER(7,1)); Table created. SQL> INSERT INTO TEST1(COL) VALUES(1.234); 1 row created. SQL> INSERT INTO TEST2(COL) VALUES(1.234); 1 row created. SQL> INSERT INTO TEST1(COL) VALUES(0.234); 1 row created. SQL> INSERT INTO TEST2(COL) VALUES(0.234); 1 row created. SQL> SELECT * FROM TEST1; COL ---------- 1 0 SQL> SELECT * FROM TEST2; COL ---------- 1.2 .2 SQL>
If you want to store the decimal value, you must modify the destination table.
-
using nested case statement does not get the right result
Hello all;
I have a sample of data similar to below
create table t3 ( id varchar2(200), qty number(30), qty2 number(30) );
This is what looks like datainsert into t3 (id, qty, qty2) values ('A', 10, null); insert into t3 (id, qty, qty2) values ('A', 20, null); insert into t3 (id, qty, qty2) values ('B', null, 5); insert into t3 (id, qty, qty2) values ('B', null, 5); insert into t3 (id, qty, qty2) values ('C', null, -5); insert into t3 (id, qty, qty2) values ('C', null, 5); insert into t3 (id, qty, qty2) values ('D', -1, -2); insert into t3 (id, qty, qty2) values ('D', 1, 4);
It is the output that I desired belowID QTY QTY2 A 10 A 20 B 5 B 5 C -5 C 5 D 1 4 D -1 -2
A is a failure because the sum of the 2 has the value zero, where the summation of the qty was used to determine the State and because the sum of the quantity is not equal to zero, then, it is a failureID Status A Fail B Fail C Pass D Fail
D is a failure because even if the sum of the Qty 1 equals zero, we must make use of summation of the qty 2 instead because he is not null to determine the status and the summation of the qty is 2, where a failure
etc.
I tried write something but can not make it work
any help is appreciated. Thank you.select case when sum(v.qty) is not null and sum(v.qty) = 0 then 'Pass' when sum(v.qty) is not null and sum(v.qty) != 0 then 'Fail' else case when sum(v.qty2) is not null and sum(v.qty2) = 0 then 'Pass' else when sum(v.qty2) is not null and sum(v.qty2) != 0 then 'Fail' end as status end as status from t3 v;
Try this,
SELECT ID, CASE WHEN NVL(SUM (qty2),1) !=0 THEN 'fail' WHEN NVL(SUM (qty),0) != 0 THEN 'fail' ELSE 'pass' END FROM t3 GROUP BY ID OUTPUT ------------- ID RESULT -- ------ A fail B fail C pass D fail Z fail
G.
Maybe you are looking for
-
HP Z620: Cannot disable the legacy in Bios boot media
Hello I installed WIndows 10 using UEFI, but could not disable the startup mode of the legacy support in the BIOS. If I disable Legacy support PC 6 beeps and flashes of Red led on the power button. I don't know if someone has encountered this problem
-
I am trying to burn a CD and it starts to burn, and then tells me that burning failed.
See the subject line. That's my problem. My D drive will not burn a cd.
-
Unable to mount NFS 4.1 datastore on ESXi 6
Good afternoonI m running the tests and now I have built a 6 CentOS with NFS 4.1 as a NAS.Some lines of logs of CentOS:RPC.statd [1623]: Version 1.2.3 startingSM-notify [1624]: Version 1.2.3 startingkernel: RPC: registered named UNIX socket transport
-
Display alert that says "record exists" and commit not allowed.
Hello, my case is the following:I wrote a code toprotected void doDML (int operation, e TransactionEvent){/ * Some code here * /.}if(retvalue == 1){/ * See the alert saying file already exists! »}else {}super.doDML (operation, e);}My question is how
-
Photoshop crashes when you try to open 3D
Why keep photoshop crashes when you try to open 3D?