473,487 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Insert

2 New Member
I want to insert records to the table test1 from table prueba, for example
insert into test1
(fecha,momento,antes)
values
(select
fecha,momento from prueba);
when i runinng this script i was recived the following errors
ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8
ORA-00936: missing expression
Aug 1 '06 #1
6 10044
lipsa
35 New Member
I want to insert records to the table test1 from table prueba, for example
insert into test1
(fecha,momento,antes)
values
(select
fecha,momento from prueba);
when i runinng this script i was recived the following errors
ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8
ORA-00936: missing expression
***********************
hey i m a beginner,3 months work exp,still trying
i think ur query should b something like this
insert into test1
(fecha,momento,antes)
select
fecha,momento,some_column from prueba;

u wanna insert into 3 columns and providing 2 values,and "values' keyword also wont b used
regards,
lipsa
*************************
Aug 2 '06 #2
llunar
2 New Member
Hey i don't understand your answer.

In this case explain me the similars errors

Expand|Select|Wrap|Line Numbers
  1. insert into cli_tab_19_old
  2. (MOD_19_TAB_NUM_COD,
  3. MOD_19_TAB_DES_NOR,
  4. MOD_19_TAB_ESP_COD,
  5. MOD_19_TAB_BAR_COD,
  6. MOD_19_TAB_BAR_PRE,
  7. MOD_19_TAB_REQ_DIA,
  8. MOD_19_TAB_DIA_EST,
  9. MOD_19_TAB_1ER_COD,
  10. MOD_19_TAB_2DO_COD,
  11. MOD_19_TAB_ANE_COD,
  12. MOD_19_TAB_ESP_DES,
  13. MOD_19_TAB_1ER_DES,
  14. MOD_19_TAB_2DO_DES,
  15. MOD_19_TAB_ANE_DES,
  16. MOD_19_TAB_BAR_DES,
  17. MOD_19_TAB_INT_COD)
  18. values
  19. (select
  20. MOD_TAB_NUM_COD,
  21. MOD_TAB_DES_NOR,
  22. MOD_TAB_ESP_COD,
  23. MOD_TAB_BAR_COD,
  24. MOD_TAB_BAR_PRE,
  25. MOD_TAB_REQ_DIA,
  26. MOD_TAB_DIA_EST,
  27. MOD_TAB_1ER_COD,
  28. MOD_TAB_2DO_COD,
  29. MOD_TAB_ANE_COD,
  30. MOD_TAB_ESP_DES,
  31. MOD_TAB_1ER_DES,
  32. MOD_TAB_2DO_DES,
  33. MOD_TAB_ANE_DES,
  34. MOD_TAB_BAR_DES
  35. from cli_tab_11_old);
Error on line 0
insert into cli_tab_19_old
(MOD_19_TAB_NUM_COD,
MOD_19_TAB_DES_NOR,
MOD_19_TA

ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8
ORA-00936: missing expression







***********************
hey i m a beginner,3 months work exp,still trying
i think ur query should b something like this
insert into test1
(fecha,momento,antes)
select
fecha,momento,some_column from prueba;

u wanna insert into 3 columns and providing 2 values,and "values' keyword also wont b used
regards,
lipsa
*************************
Aug 2 '06 #3
masdi2t
37 New Member
actually we've 2 kind of INSERT statement

1. INSERT INTO <table> [(field)] VALUES (<values>)
2. INSERT INTO <table> [field] SELECT [field] FROM <table>

when we use INSERT ... SELECT, we can simply insert rows selected from another table or tables, while INSERT ... VALUES insert from constant value.
Aug 3 '06 #4
lipsa
35 New Member
Dear llunar,
plz check that ur 'MOD_19_TAB_INT_COD' column value(in the SELECT......) is not provided.and also dont use 'values' key word as masdi2t has already explained.
Regards
Lipsa :)
Aug 3 '06 #5
aarbhargavi
6 New Member
I want to insert records to the table test1 from table prueba, for example
insert into test1
(fecha,momento,antes)
values
(select
fecha,momento from prueba);
when i runinng this script i was recived the following errors
ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8
ORA-00936: missing expression
hai
have u checked u r table structure for column lengths.
because ora-00604 is an error that can be corrected if ora-06502 can be rectified.ora-06502 can be corrected if column data lengths are of suitable type.
usually this problem comes when u r trying to insert 10 charcters into a column whose data length is 5.
and ora-00936 is due to ur insert statement requires three columns for select stament where as u r select stament returns only two columns.and in insert from table type syntax the key word 'values' is not nessasary.
Aug 31 '07 #6
amitpatel66
2,367 Recognized Expert Top Contributor
I want to insert records to the table test1 from table prueba, for example
insert into test1
(fecha,momento,antes)
values
(select
fecha,momento from prueba);
when i runinng this script i was recived the following errors
ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 8
ORA-00936: missing expression
There are two problems from your insert statement:

1. You want to insert 3 values, but in select statement you are selecting only 2 values.
2. When you use a SELECT statement with INSERT statement, the key word VALUE should not be used.

Correct these and try executing a query. Do post back in case of any further problem!!
Sep 1 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2494
by: Howard Hinnant | last post by:
I recently asked for a survey of multimap insert with hint behavior, in support of a paper I'm writing concerning lwg issue 233. My sincere thanks to Beman Dawes, Raoul Gough, Russell Hind, Bronek...
6
6966
by: Mark P | last post by:
Some time ago I posted here about inserting into a set with a hint: ...
14
4268
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
16
16972
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
8
6273
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
4
5465
by: Chris Kratz | last post by:
Hello all, We have run into what appears to be a problem with rules and subselects in postgres 7.4.1. We have boiled it down to the following test case. If anyone has any thoughts as to why...
2
3169
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
3
2298
by: MP | last post by:
Hi Posted this several hours ago to another ng but it never showed up thought i'd try here. using vb6, ado, .mdb, jet4.0, no access given table tblJob with field JobNumber text(10) 'The...
6
3705
by: lenygold via DBMonster.com | last post by:
Hi everybody: What is the best way to I have 10 tables with similar INSERT requiremnts. INSERT INTO ACSB.VAATAFAE WITH AA(AA_TIN, AA_FILE_SOURCE_CD, .AA_TIN_TYP) AS ( SELECT AA_TIN,...
1
2642
by: EJO | last post by:
with sql 2000 enterprise Trying to build a stored procedure that will take the rows of a parent table, insert them into another table as well as the rows from a child table to insert into...
0
7108
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.