Error while insert data using execute immediate in dynamic table in oracle
Error while insert data using execute immediate in dynamic table created in oracle 11g .
first the dynamic nested table (op_sample) was created using the executed immediate...
object is
CREATE OR REPLACE TYPE ASI.sub_mark AS OBJECT (
mark1 number,
mark2 number
t_sub_mark is a class of type sub_mark
CREATE OR REPLACE TYPE ASI.t_sub_mark is table of sub_mark;
create table sam1(id number,name varchar2(30));
nested table is created below:
begin
EXECUTE IMMEDIATE ' create table '||op_sample||'
(id number,name varchar2(30),subject_obj t_sub_mark) nested table subject_obj store as nest_tab return as value';
end;
now data from sam1 table and object (subject_obj) are inserted into the dynamic table
declare
subject_obj t_sub_mark;
begin
subject_obj:= t_sub_mark();
EXECUTE IMMEDIATE 'insert into op_sample (select id,name,subject_obj from sam1) ';
end;
and got the below error:
ORA-00904: "SUBJECT_OBJ": invalid identifier
ORA-06512: at line 7
then when we tried to insert the data into the dynam_table with the subject_marks object as null,we received the following error..
execute immediate 'insert into '||dynam_table ||'
(SELECT
887684 wrote:
ORA-00904: "SUBJECT_OBJ": invalid identifier
ORA-06512: at line 7The problem is that your variable subject_obj is not in scope inside the dynamic SQL you are building. The SQL engine does not know your PL/SQL variable, so it tries to find a column named SUBJECT_OBJ in your SAM1 table.
If you need to use dynamic SQL for this, then you must bind the variable. Something like this:
EXECUTE IMMEDIATE 'insert into op_sample (select id,name,:bind_subject_obj from sam1) ' USING subject_obj;Alternatively you might figure out to use static SQL rather than dynamic SQL (if possible for your project.) In static SQL the PL/SQL engine binds the variables for you automatically.
Similar Messages
-
Error while inserting data using DBMS_RANDOM
Hi ,
I tried the following insert command in the link http://www.oracle-base.com/articles/misc/RollupCubeGroupingFunctionsAndGroupingSets.php
BANNER
Oracle Database 10g Release 10.2.0.1.0 - Production
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> INSERT INTO dimension_tab
2 SELECT TRUNC(DBMS_RANDOM.value(low => 1, high => 3)) AS fact_1_id,
3 TRUNC(DBMS_RANDOM.value(low => 1, high => 6)) AS fact_2_id,
4 TRUNC(DBMS_RANDOM.value(low => 1, high => 11)) AS fact_3_id,
5 TRUNC(DBMS_RANDOM.value(low => 1, high => 11)) AS fact_4_id,
6 ROUND(DBMS_RANDOM.value(low => 1, high => 100), 2) AS sales_value
7 FROM dual
8 CONNECT BY level <= 1000;
SELECT TRUNC(DBMS_RANDOM.value(low => 1, high => 3)) AS fact_1_id,
ERROR at line 2:
ORA-00907: missing right parenthesisCould you please advice me to get the correct recordssmile wrote:
Hi ,
I tried the following insert command in the link http://www.oracle-base.com/articles/misc/RollupCubeGroupingFunctionsAndGroupingSets.php
BANNER
Oracle Database 10g Release 10.2.0.1.0 - Production
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> INSERT INTO dimension_tab
2 SELECT TRUNC(DBMS_RANDOM.value(low => 1, high => 3)) AS fact_1_id,
3 TRUNC(DBMS_RANDOM.value(low => 1, high => 6)) AS fact_2_id,
4 TRUNC(DBMS_RANDOM.value(low => 1, high => 11)) AS fact_3_id,
5 TRUNC(DBMS_RANDOM.value(low => 1, high => 11)) AS fact_4_id,
6 ROUND(DBMS_RANDOM.value(low => 1, high => 100), 2) AS sales_value
7 FROM dual
8 CONNECT BY level <= 1000;
SELECT TRUNC(DBMS_RANDOM.value(low => 1, high => 3)) AS fact_1_id,
ERROR at line 2:
ORA-00907: missing right parenthesisCould you please advice me to get the correct recordsYou can't used named parameters for function/procedure calls in SQL until version 11.
You'll have to remove the
low => And stick with the good old "positional" way of doing things. -
Error while inserting data in SQL Server.
Hi',
I am using SOA 11.1.1.5
I am inserting data using DB adapter in MS SQL Server. Some times I get below error.
Error Message: {http://schemas.oracle.com/bpel/extension}bindingFault
Fault ID rrr/xxx!1.1*soa_313bd437-7bb9-41c6-a719-d1775b9afc4b/xx/4115908-BpInv0-BpSeq1.6-4
Fault Time Dec 24, 2012 8:02:09 AM
Non Recoverable System Fault :
<bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [InsertIntoStagingxx.Stagingxx]. Caused by java.sql.BatchUpdateException: String or binary data would be truncated.. Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-8152" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary></part><part name="detail"><detail>String or binary data would be truncated.</detail></part><part name="code"><code>8152</code></part></bindingFault></bpelFault>
Please advice.
Thanks
YatanHi Yatan,
This should be due to data issues. And the error message is due to data truncation issues.
Please check your payload that you are trying to insert into the SQL server table.
One or more fields might have a data that is exceeding its defined length with respect to the table definitions.
Problem with using SQL server is that while inserting, you will not be pointed towards which field or column is causing the error.
You have to take the pain of searching through the entire payload to find the problem causing ones.
Thanks,
Deepak. -
Error while inserting data into a table.
Hi All,
I created a table.While inserting data into the table i am getting an error.Its telling "Create data Processing Function Module".Can any one help me regarding this?
Thanx in advance
anirudhHi Anirudh,
Seems there is already an entry in the Table with the same Primary Key.
INSERT Statement will give short dump if you try to insert data with same key.
Why dont you use MODIFY statement to achieve the same.
Reward points if this Helps.
Manish -
Help with ORA 14400 error while inserting data
Hi all,
i am facing an ora 14400 error in the following scenario , please help.
i have created a table using the syntax:
CREATE TABLE temp_table
GRPKEY NUMBER(20, 0) NOT NULL,
UKEY NUMBER(10, 0),
ANUM VARCHAR2(250 BYTE),
APC VARCHAR2(2 BYTE),
SID VARCHAR2(65 BYTE),
RDATETIME VARCHAR2(19 BYTE),
CKEY NUMBER(20, 0),
AVER VARCHAR2(25 BYTE),
CVER VARCHAR2(250 BYTE),
TNAME VARCHAR2(50 BYTE),
SCODE VARCHAR2(30 BYTE),
PTYPE VARCHAR2(50 BYTE),
FILENUMB NUMBER(10, 0),
LINENUMB NUMBER(10, 0),
ENTRY_CREATEDDATE DATE
, CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
PARTITION BY RANGE(ENTRY_CREATEDDATE)
(PARTITION P0 VALUES LESS THAN(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
when i try to insert data using :
insert into temp_table values
(1,null,null,null,null,null,null,null,null,null,null,null,null,null,'01-NOV-2010');
i get the following error output:
Error report:
SQL Error: ORA-14400: inserted partition key does not map to any partition
14400. 00000 - "inserted partition key does not map to any partition"
*Cause: An attempt was made to insert a record into, a Range or Composite
Range object, with a concatenated partition key that is beyond
the concatenated partition bound list of the last partition -OR-
An attempt was made to insert a record into a List object with
a partition key that did not match the literal values specified
for any of the partitions.
*Action: Do not insert the key. Or, add a partition capable of accepting
the key, Or add values matching the key to a partition specificationHi Chaitanya,
Change your table script to
CREATE TABLE temp_table
GRPKEY NUMBER(20, 0) NOT NULL,
UKEY NUMBER(10, 0),
ANUM VARCHAR2(250 BYTE),
APC VARCHAR2(2 BYTE),
SID VARCHAR2(65 BYTE),
RDATETIME VARCHAR2(19 BYTE),
CKEY NUMBER(20, 0),
AVER VARCHAR2(25 BYTE),
CVER VARCHAR2(250 BYTE),
TNAME VARCHAR2(50 BYTE),
SCODE VARCHAR2(30 BYTE),
PTYPE VARCHAR2(50 BYTE),
FILENUMB NUMBER(10, 0),
LINENUMB NUMBER(10, 0),
ENTRY_CREATEDDATE DATE
, CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
PARTITION BY RANGE(ENTRY_CREATEDDATE)
(PARTITION P0 VALUES LESS THAN(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P1 VALUES LESS THAN(MAXVALUE)
insert into temp_table values
(1,null,null,null,null,null,null,null,null,null,null,null,null,null,'01-NOV-2010');
1 row insertedor refer question regarding "Date Partitioning a table"
*009*
Edited by: 009 on Nov 3, 2010 11:29 PM -
Using execute immediate creating a table from another
hi friend i wanted to create a table from a select statement in a pl sql procedure. i am using execute immediate but getting problems with it pls can anyone help me.
here is the query i am using
EXECUTE IMMEDIATE 'CREATE TABLE table_name AS (SELECT * FROM a_view WHERE column_name LIKE '%some_string%');
i need to know if this can be done and if yes how. pls help me its bit urgent too. the schema name is same and the privileges are available to create tables too.Your syntax is wrong.
If you would use a syntax higlighted editor, it would show.
Yout try to execute a string where another string is embedded. Please use two times single quote or use the 'q' function:
This one is correct:
EXECUTE IMMEDIATE 'CREATE TABLE table_name AS (SELECT * FROM a_view WHERE column_name LIKE ''%some_string%'')';
or this one:
EXECUTE IMMEDIATE q'|CREATE TABLE table_name AS (SELECT * FROM a_view WHERE column_name LIKE '%some_string%')|';
good luck -
Error while Inserting data into flow table
Hi All,
I am very new to ODI, I am facing lot of problem in my 1st interface. So I have many questions here, please forgive me if it has irritated to you.
========================
I am developing a simple Project to load a data from an input source file (csv) file into a staging table.
My plan is to achieve this in 3 interfaces:
1. Interface-1 : Load the data from an input source (csv) file into a staging table (say Stg_1)
2. Interface-2 : Read the data from the staging table (stg_1) apply the business rules to it and copy the processed records into another staging table (say stg_2)
3. Interface-3 : Copy the data from staging table (stg_2) into the target table (say Target) in the target database.
Question-1 : Is this approach correct?
========================
I don't have any key columns in the staging table (stg_1). When I tried to execute the Flow Control of this I got an error:
Flow Control not possible if no Key is declared in your Target Datastore
With one of the response (the response was - "FLOW control requires a KEY in the target table") in this Forum I have introduced a column called "Record_ID" and made it a Primary Key column into my staging table (stg_1) and my problem has been resolved.
Question-2 : Is a Key column compulsary in the target table? I am working in BO Data Integrator, there is no such compulsion ... I am little confused.
========================
Next, I have defined one Project level sequence. I have mapped the newly introduced key column Record_Id (Primary Key) with the Project level sequence. Now I am got another error of "CKM not selected".
For this, I have inserted "Insert Check (CKM)" knowledge module in my Project. With this the above problem of "CKM not selected" has been resolved.
Question-3 : When is this CKM knowledge module required?
========================
After this, the flow/interface is failing while loading data into the intermediar ODI created flow table (I$)
1 - Loading - SS_0 - Drop work table
2 - Loading - SS_0 - Create work table
3 - Loading - SS_0 - Load data
5 - Integration - FTE Actual data to Staging table - Drop flow table
6 - Integration - FTE Actual data to Staging table - Create flow table I$
7 - Integration - FTE Actual data to Staging table - Delete target table
8 - Integration - FTE Actual data to Staging table - Insert flow into I$ table
The Error is at Step-8 above. When opened the "Execution" tab for this step I found the message - "Missing parameter Project_1.FTE_Actual_Data_seq_NEXTVAL RECORD_ID".
Question-4 : What/why is this error? Did I made any mistake while creating a sequence?Everyone is new and starts somewhere. And the community is there to help you.
1.) What is the idea of moving data from stg_1 and then to stg_2 ? Do you really need it for any other purpose other than move data from SourceFile to Target DB.
Otherwise, its simple to move data from SourceFile -> Target Table
2.) Does your Target table have a Key ?
3.) CKM (Check KM) is required when you want to do constraint validation (Checking) on your data. You can define constraints (business rules) on the target table and Flow Control will check the data that is flowing from Source File to Target table using the CKM. All the records that donot satisfy the constraint will be added to E$ (Error table) and will not be added to the Target table.
4.) Try to avoid ODI sequences. They are slow and arent scalable. Try to use Database sequence wherever possible. And use the DB sequence is target mapping as
<%=odiRef.getObjectName( "L" , "MY_DB_Sequence_Row" , "D" )%>.nextval
where MY_DB_Sequence_Row is the oracle sequence in the target schema.
HTH -
Runtime Error while uploading data using a BAPI
Hi ALL,
I am trying to upload duties for PO items using BAPI from a excel sheet.In this BAPI I am saving the data into a z table(Customizing table, maintenance only by cust., not SAP import).The data is getting saved into the table and it shows the data uploaded successfully message also,but when I scroll up I see RUN time error,althogh the data is getting saved.
I have seen in the st22 and it shows the following information.
Internal error: Invalid page number.
What happened?
The current ABAP program had to be terminated because the
ABAP processor detected an internal system error.
The current ABAP program "ZFI_UPD_BOE_UPLOAD" had to be terminated because the
ABAP
processor discovered an invalid system state.
My functional consultants opinion is after data getting saved it comes into me23n's condition tab.He has done it many times.But for one PO it is not showing.
I checked the upload program.In upload program a BAPI is written which simply takes the data from a excelsheet and saves into the z table.
My query is whether we can show the data of a z table into standard tocde?Thanks Lakshman!
I debug the program.There is no BDC used update.In this program after taking the data from excel sheet one internal table is prepared and this internal table is directly used to insert data into z table.This is the last code which executes.
INSERT zmmpoamend FROM TABLE t_zmmpo_amend_tab.
IF sy-subrc EQ '0'.
MESSAGE 'Data Upload Successfully completed' TYPE 'S'.
ELSE.
ROLLBACK WORK.
MESSAGE 'Data Upload failed ' TYPE 'E'.
ENDIF.
CLEAR t_zmmpo_amend_tab.
REFRESH t_zmmpo_amend_tab.
Is it possible to configure z table using SPRO tcode,such that this z tables data will go to standard table and then we can see it in the standard tcode?
I am not sure but it's just a guess. -
Java Character set error while loding data using iSetup
Hi,
I am getting the following error while migrating settup data from R12 (12.1.2) Instance to another R12 (12.1.2) Instance, Both the Database has same DB character set (AL32UTF8)
we are getting this error while migrating any setup data
Actual error is
Downloading the extract from central instance
Successfully copied the Extract
Time taken to download Extract and write as zip file = 0 seconds
Validating Primary Extract...
Source Java Charset: AL32UTF8
Target Java Charset: UTF-8
Target Java Charset does not match with Source Java Charset
java.lang.Exception: Target Java Charset does not match with Source Java Charset
at oracle.apps.az.r12.common.cpserver.PreValidator.validate(PreValidator.java:191)
at oracle.apps.az.r12.loader.cpserver.APILoader.callAPIs(APILoader.java:119)
at oracle.apps.az.r12.loader.cpserver.LoaderContextImpl.load(LoaderContextImpl.java:66)
at oracle.apps.az.r12.loader.cpserver.LoaderCp.runProgram(LoaderCp.java:65)
at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
Error while loading apis
java.lang.NullPointerException
at oracle.apps.az.r12.loader.cpserver.APILoader.callAPIs(APILoader.java:158)
at oracle.apps.az.r12.loader.cpserver.LoaderContextImpl.load(LoaderContextImpl.java:66)
at oracle.apps.az.r12.loader.cpserver.LoaderCp.runProgram(LoaderCp.java:65)
at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
Please help in identifying and resolving the issue
SachinThe Source and Target DB character set is same
Output from the query
------------- Source --------------
SQL> select value from nls_database_parameters where parameter='NLS_CHARACTERSET';
VALUE
AL32UTF8
And target Instance
-------------- Target----------------------
SQL> select value from nls_database_parameters where parameter='NLS_CHARACTERSET';
VALUE
AL32UTF8
The Error is about Source and Target JAVA Character set
I will check the Prevalidator xml from How to use iSetup and update the note
Thanks
Sachin -
Error while inserting data in datagrid
Hi,
I am trying to insert data into a datagrid getting results
from a cfc using remoteobject. If I use everything inline then it
works fine.
I have a button when clicked give me the results. if I have
something like this:
<mx:Button label="get Query Remote Object"
click="myTest.getSystem()"/>
then it works fine.
but if I use a namespace like
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns:serv="services.*">
<serv:services id="services" />
and try to use
<mx:Button label="get Query Remote Object"
click="services.myTest.getSystem()"/>
then i get an error saying
Access of undefined property myTest in package services.
I have the remoteobject call within services.mxml which is
inside services folder. What do I need to change? It used to work
fine in 1.5.
ThanksAre you using the Cairngorm framework or why are you using a
sevices.mxml?? -
Error while updating data using session and call transaction method
Hi all,
i have to update data using MM01 transaction from flat file to database.i have used both session method and call transaction method to do that.in both the methods data has been transferred from internal tables to screens but while updating the data that is by clicking the ok-code at the end of the transaction iam getting a dialogue box stating
SAP EXPRESS DOCUMENT "UPDATE WAS TERMINATED" RECEIVED FROM AUTHOR "SAP".
please tell whether the problem lies and solution for that.
thanks and regards.hi,
check your recording.check whether u saved your material no in recording or not.
once again record the transacton mm01.
MATNR LIKE RMMG1-MATNR,
MBRSH LIKE RMMG1-MBRSH,
MTART LIKE RMMG1-MTART,
MAKTX LIKE MAKT-MAKTX,
MEINS LIKE MARA-MEINS,
MATKL LIKE MARA-MATKL,
BISMT LIKE MARA-BISMT,
EXTWG LIKE MARA-EXTWG,
these are the fields which u have to take in internal table.
this is the record which i took in my flatfile.use filetype as asc and hasfieldseperator as 'X'.
SUDHU-6 R ROH MATSUDHU " 001 7890 AA
i did the same.but i didn't get any error. -
Error while extracting data using function module
Hello,
I created one generic datasource and i want to extract data with the option "Extraction by Function Module".
But when i specified function module name and was trying to save, it thrown a error message saying
'The specified table does not exist'.
What could be the reason?
Please help me out.
Thanks,
Regards,
SteveHi Steve,
Once you execute T.Code RSO2, you need to fill in the details and click Create, specify the Appl. Component and in Extraction by Function Module, give Function Module name and Extrct Structure in the given boxes.
"This structure is used by a DataSource that was created using the transaction RSO2 (generic extraction) and selects data using a function module.
The data must be transferred from this function module to an interface table E_T_DATA."
I'll try to comeup with small piece of code to sort your issue.
Hope it helps!!!!
Amit -
Error while Extracting data using RSCRM_BAPI
Friends
We are on 3.5 system upgraded recently. I am getting the following Error message while trying to extract data from a query to a table using the transaction RSCRM_BAPI. The Error message says ' Internal Error in Method CHECK_TABLE_NAME(RSCRMBW_EX_NAMESPACE_GET).
This was working fine prior to upgrade. I scoured all the OSS notes, could not find an appropriate one to solve the issue.
Have you had this problem and any thoughts on resolution ? Appreciate your inputs very much.
Regards
Mathur SreedharHi Mathur,
did you ever resolved this Issue? if so can yoou share with me the solution. i am having the same problem, we are in 3.0 . it works fine in Development and Test. but when i try it in Production . i get this error.
'Internal error in method CHECK_TABLE_NAME (RSCRMBW_EX_NAMESPACE_GET)..
if you know the answer. would please share with me.
your help would be greatly appreciated.
Thanks.
Sreeni. -
Error while loading data using SQL*Loader
Hi All,
I am now in process of loading data from MS SQL to Oracle Database.
I am getting the data in excel format and i will convert them into csv.
Upto converting everything is working fine.
In MS SQL, table columns are case sensitive.
So i created those tables in oracle db as same.
There is one column "MaxNumber" which is of type float(49).
The column is case sensitive.
in the control file first i given as
"MaxNumber" "TO_NUMBER(:MaxNumber,'99,999.99')"
After executing the SQL*Loader i am getting the error
SQL*Loader-466: Column MAXNUMBER does not exist in table TABLEONE.
I changed the control file entry as
"MaxNumber" "TO_NUMBER(:"MaxNumber",'99,999.99')"
After the execution i got the error
SQL*Loader-350: Syntax error at line 13.
Expecting "," or ")", found "MaxDiscount".
"MaxNumber" "TO_NUMBER(:"MaxNumber",'99,999.99')"
Please Guide me in this issue.
Regards
Salih KMWhat I'm saying is, verify the column name. Dont post if not possible.
Example follows, with one table intentionally "hidden".
SQL> create table "tEsT" ("MaxNumber" float, "MaxnumbeR" number);
SQL> select table_name,column_name from user_tab_columns where table_name like 't%';
TABLE_NAME COLUMN_NAME
tEsT MaxNumber
tEsT MaxnumbeR
teST iD
teST MaxNumberHth,
Fredrik -
How to resolve error while importing data using IDoc method in LSMW ?
Hi
I am trying to import my data using IDoc method in LSMW.
But after completing the whole LSMW process, when I look into the IDOC generated, the error description is as this.
It talks about the process code and other stuff.
Function module not allowed : APPL_IDOC_INPUTI
Message No. B1252
Diagnosis :
The function module APPL_IDOC_INPUTI and the application object type which were determined are not valid for this IDoc.
I am not able to resolve the problem.
Please help.
Regards,
Rachesh Nambiarcheck the below link.
/people/stephen.johannes/blog/2005/08/18/external-data-loads-for-crm-40-using-xif-adapter
Maybe you are looking for
-
I'm trying to match double letters inside words, excluding ones that begin or end a word. I'm running into a problem matching \B at the end of a line. example: My RegExp is /\Bdd\B/gi String is "dda adda add add" This will match twice, the dd in the
-
I transfered all my music over from my old to my new laptop but my playlists are not there. How do i get my playlists?
-
Albums in Aperture 3 not showing upon IPhone/IPad "Photos" App
Hello; Some of the Albums I have on file in Aperture 3 are not showing up on my IPhone nor IPad in the "Photos" App. Am I missing a setting? Thanks Mark
-
Awesome users report on your usage habits and favorite apps
So, I've been wondering what apps users of the awesome window manager are using. I'm trying to get used to the concept of a tiling window manager, but the graphical apps I'm used to look like crap. I've seen some really good looking screenshots of ti
-
How do I overcopme this issue with Lightroom 5.5.