Insert records from report program into R3 table
Hi
I wanted to insert records from report program into R3 table.
here is my code
data : itab type standard table of zemp initial size 10 with header line.
itab-EMPNO = '012'.
itab-ENAME = 'XXXX'.
itab-JOB = 'XXXX'.
APPEND itab.
insert ztable from table itab.
but i am getting the following error
the type of the data base table and work area/internal table "ITAB" are no unicode-converible.
how can I insert records from report program into R3 table
should I have to write move corresponding
pls guide
thanks
manian
Hi,
itab-EMPNO = '012'.
itab-ENAME = 'XXXX'.
itab-JOB = 'XXXX'.
APPEND itab.
insert ztable from table itab.
Do one thing
Data : itab type table of ztable with header line.
itab-EMPNO = '012'.
itab-ENAME = 'XXXX'.
itab-JOB = 'XXXX'.
APPEND itab.
insert ztable from table itab.
error will resolve, then try to make structure similar to ZTABLE
Similar Messages
-
Insert date from YUI calendar into mysql table
Is there a way to insert the date selected from the YUI calendar into a mysql table?
I have been in trouble since last 2 days... I have tried all possible and explored any related topics.. Still I cannot address the problem.
Problem 1:
I have a simple jsp form which passed a bengali word.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form action="Test2.jsp" method="post" >
<input type="text" value="কাকা" name="word">
<input type="submit" value="Next">
</form>
</body>
</html>
When this page is post, a java program( TestWord) is called by the Test2.jsp. TestWord insert the passed bengali word into a MySQL table. Then it retrieves again the inserted bengali word and display in Test2.jsp.
Test2.jsp:----
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<jsp:useBean id="get2" class="dictionary.TestWord" scope="session"/>
<jsp:setProperty name="get2" property="*"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form action="" method="post">
<%
String s=get2.getWord();
out.write("Before converion onversion = "+s);
s = new String(s.getBytes("ISO-8859-1"),"UTF-8");
out.write(" After conversion = "+s);
%>
</form>
</body>
</html>
It gives the output something like:
Before conversion = �?া�?া After conversion = ??????
Problem 2:
The record in mysql table is inserted in bengali font (eg. কাকা). When I retrieve the record and display in a jsp page, I can see the bengali word (কাকা) properly. But if I insert the bengali word again in MySql table, then I see some string like "�?া�?া" storing in the table.
Please help me out..
Thanks in advance. -
How to insert data from APEX form into two tables
Hi,
I'm running APEX 4.1 with Oracle XE 11g, having two tables CERTIFICATES and USER_FILES. Some of the (useless) fields are cut to reduce information:
CREATE TABLE CERTIFICATES
CERT_ID NUMBER NOT NULL ,
CERT_OWNER NUMBER NOT NULL ,
CERT_VENDOR NUMBER NOT NULL ,
CERT_NAME VARCHAR2 (128) ,
CERT_FILE NUMBER NOT NULL ,
) TABLESPACE CP_DATA
LOGGING;
ALTER TABLE CERTIFICATES
ADD CONSTRAINT CERTIFICATES_PK PRIMARY KEY ( CERT_ID ) ;
CREATE TABLE USER_FILES
FILE_ID NUMBER NOT NULL ,
FILENAME VARCHAR2 (128) ,
BLOB_CONTENT BLOB ,
MIMETYPE VARCHAR2 (32) ,
LAST_UPDATE_DATE DATE
) TABLESPACE CP_FILES
LOGGING
LOB ( BLOB_CONTENT ) STORE AS SECUREFILE
TABLESPACE CP_FILES
STORAGE (
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS UNLIMITED
FREELISTS 1
BUFFER_POOL DEFAULT
RETENTION
ENABLE STORAGE IN ROW
NOCACHE
ALTER TABLE USER_FILES
ADD CONSTRAINT CERT_FILES_PK PRIMARY KEY ( FILE_ID ) ;
ALTER TABLE CERTIFICATES
ADD CONSTRAINT CERTIFICATES_USER_FILES_FK FOREIGN KEY
CERT_FILE
REFERENCES USER_FILES
FILE_ID
NOT DEFERRABLE
What I'm trying to do is to allow users to fill out all the certificate data and upload a file in an APEX form. Once submitted the file should be uploaded in the USER_FILES table and all the fields along with CERT_ID, which is the foreign key pointing to the file in the USER_FILES table to be populated to the CERTIFICATES table. APEX wizard forms are based on one table and I'm unable to build form on both tables.
That's why I've created a view (V_CERT_FILES) on both tables and using INSTEAD OF trigger to insert/update both tables. I've done this before and updating this kind of views works perfect. Here is where the problem comes, if I'm updating the view all the data is updated correctly, but if I'm inserting into the view all the fields are populated at CERTIFICATES table, but for USER_FILES only the fields FILE_ID and LAST_UPDATE_DATE are populated. The rest three regarding the LOB are missing: BLOB_CONTENT, FILENAME, MIMETYPE. There are no errors when running this from APEX, but If I try to insert into the view from SQLDeveloper, I got this error:
ORA-22816: unsupported feature with RETURNING clause
ORA-06512: at line 1
As far as I know RETURNING clause in not supported in INSTEAD of triggers, although I didn't have any RETURNING clauses in my trigger (body is below).
Now the interesting stuff, after long tracing I found why this is happening:
First, insert is executed and the BLOB along with all its properties are uploaded to wwv_flow_file_objects$.
Then the following insert is executed to populate all the fields except the BLOB and it's properties, rowid is RETURNED, but as we know RETURNING clause is not supported in INSTEAD OF triggers, that's why I got error:
PARSE ERROR #1918608720:len=266 dep=3 uid=48 oct=2 lid=48 tim=1324569863593494 err=22816
INSERT INTO "SVE". "V_CERT_FILES" ( "CERT_ID", "CERT_OWNER", "CERT_VENDOR", "CERT_NAME", "BLOB_CONTENT") VALUES (:B1 ,:B2 ,:B3 ,:B4, ,EMPTY_BLOB()) RETURNING ROWID INTO :O0
CLOSE #1918608720:c=0,e=11,dep=3,type=0,tim=1324569863593909
EXEC #1820672032:c=3000,e=3168,p=0,cr=2,cu=4,mis=0,r=0,dep=2,og=1,plh=0,tim=1324569863593969
ERROR #43:err=22816 tim=1324569863593993
CLOSE #1820672032:c=0,e=43,dep=2,type=1,tim=1324569863594167
Next my trigger gets in action, sequences are generated, CERTIFICATES table is populated and then USER_FILES, but only the FILE_ID and LAST_UPDATE_DATE.
Finally update is fired against my view (V_CERT_FILES), reading data from wwv_flow_files it populates BLOB_CONTENT, MIMETYPE and FILENAME fields at the specific rowid in V_CERT_FILES, the one returned from the insert at the beginning. Last, file is deleted from wwv_flow_files.
I'm using sequences for the primary keys, this is only the body of the INSTEAD OF trigger:
select user_files_seq.nextval into l_file_id from dual;
select certificates_seq.nextval into l_cert_id from dual;
insert into user_files (file_id, filename, blob_content, mimetype, last_update_date) values (l_file_id, :n.filename, :n.blob_content, :n.mimetype, sysdate);
insert into certificates (cert_id, cert_owner, cert_vendor, cert_name, cert_file) values (l_cert_id, :n.cert_owner, :n.cert_vendor, :n.cert_name, l_file_id);
I'm surprised that I wasn't able to find a valuable source of information regarding this problem, only MOS note about running SQLoader against view with CLOB column and INSTEAD OF trigger. The solution would be to ran it against base table, MOS ID 795956.1.
Maybe I'm missing something and that's why I decided to share my problem here. So my question is how do you create this kind of architecture, insert into two tables with a relation between them in APEX ? I read a lot in the Internet, some advices were for creating custom form with APEX API, create a custom ARP, create two ARP or create a PL/SQL procedure for handing the DML?
Thanks in advance.
Regards,
SveThank you however I was wondering if there was an example available which uses EJB and persistence.
-
Inserting results from select query into another table
Hi: Is there a way to insert results returned from a SQL query into another table within the same SQL statement.
For example
SELECT a.SRCID,
SUM(DECODE(a.CLASS_ID,91147,1,0)) BLOCK,
SUM(DECODE(a.CLASS_ID,91126,1,0)) ALLOW,
FROM EVENT_DATA a
where
a.class_id in (91147,91126)
GROUP BY SRCID
order by TOTAL DESC;The columns returned SRCID, BLOCK and ALLOW need to go into another table called AGGREGATE_COUNT. This table has fields SRCID, BLOCK and ALLOW. Or is the only way this can be done from outside of SQL like using perl or C.
Thanks
RayINSERT INTO aggregate_count
( chart_id
, srcid
, block
, allow
SELECT 2234 chart_id
, srcid
, SUM(DECODE(class_id, 91147, 1, 0))
, SUM(DECODE(class_id, 91126, 1, 0))
FROM event_data
WHERE class_id IN (91147, 91126)
GROUP BY chart_id, srcid
ORDER BY total DESC; -
How to upload a collection of records from adobe form into a table in BAPI
We are creating an appliction using web dynpro and adobe that will allow users to update PO status information offline. The information is downloaded into a form and then updated offline by the vendor. After this change the form is uploaded into the application and sent to SAP R/3 via a BAPI call. The BAPI provides the information for different PO's as a table structure (many items - collection) which is downloaded into the form and displayed as a table. The download part works and we can upload the modified file also. We can even see the data getting loaded into the controller context after we upload the form.
<b>The problem</b> is when we try to execute the BAPI to upload the data. The data in the table structure does not seem to upload, only the non-table structure field values get posted back. Logs at the BAPI show "0" records uploaded. Couple of other fields which are not part of the table structure get uploaded properly.
Can someone <b>please provide some insights - help</b> on what could be going wrong. Any debugging ideas or checking logs to see if the data is really getting pushed from the webdynpro/adobe app to the R/3 system would be helpfull.
Our R/3 setup is ECC5 on a AIX server and the adobe webdynpro setup is NW04s on a different different AIX server.
ThanksHi satishsuri ,
You will have to use 3 methods together :
CALL METHOD cl_gui_frontend_services=>directory_browse "Browse the Directory
CALL METHOD cl_gui_frontend_services=>directory_list_files "Get all the files from the directory
CALL METHOD cl_gui_frontend_services=>gui_upload "Upload each file in a loop
Example:
TYPES: BEGIN OF ty_data,
line TYPE string,
END OF ty_data.
DATA: str_file TYPE string,
str_dir TYPE string,
it_file_table TYPE STANDARD TABLE OF file_info,
wa_file_table TYPE file_info,
v_count TYPE i,
it_data TYPE STANDARD TABLE OF ty_data,
wa_data TYPE ty_data.
CALL METHOD cl_gui_frontend_services=>directory_browse
CHANGING
selected_folder = str_dir.
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = str_dir
CHANGING
file_table = it_file_table
count = v_count.
LOOP AT it_file_table INTO wa_file_table.
CONCATENATE str_dir wa_file_table-filename INTO str_file SEPARATED BY '\'.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = str_file
filetype = 'ASC'
CHANGING
data_tab = it_data.
LOOP AT it_data INTO wa_data.
WRITE : / wa_data-line.
ENDLOOP.
ULINE.
ENDLOOP.
Regards,
Jovito -
Insert records from user form to multiple tables in same database
Hi Experts, I need your help. I have a form that has multiple text fields that I need to insert the records to their each respective table. For example: The first name field needs to go the the name table, address goes to a seperate table, phone goes to a seperate table and so on.
Is this possible to do?
Thanks Much
ShamThe same for ASP, JSP or PHP. Just the code syntax is different for each language. Are you using MySQL, Access or ?
In any case, create the three recordsets on the database and use insert queries. If you don't know what one is, google insert query and you will see the syntax.
Here is a good example out on the web
http://www.stardeveloper.com/articles/display.html?article=2000032601&page=1
In your case you would get the values for the inserts from the form data and only need to open the database connection once.
Good luck.
Walt
B & B Photography -
How to insert values from different region into one table
Hi everyone
I have created a page which contains 4 html regions like region1,region 2 ...region 4
in region 1 i created 2 text items like (emp_name,emp_id).
in region 2 i created 2 date fields (start_date,end_date).
In region3 i created a tabular form which contains(job , hire_date).
in region 4 i created a textfield (%of Hike)
So i want to create a button(submit) .when i press the button it will insert all the informations provided by the user in different regions will be inserted to a table called employee_information.
Can i do this?
If it is possible please tell me how to do this
if not then tell me any alternative solution.
Thanks,
Regards,
SabyasachiSabyasachi wrote:
Hi fac586
Can you please tell me step by step how to do it or can you please make an example in apex.oracle.com and give me the credentials so that i can know clarify my doubts.1. Create a Form using a Wizard. This will create the items and processes necessary to retrieve data from, and perform DML on, the table. The items will be contained in a single default region.
2. Create custom HTML regions on page.
3. Move items and buttons from the default region created by the Form Wizard by changing the Region value in the "Displayed" section of the item attributes page, or Page Items page; or reassign items to regions using the Reassign Region Items page. -
How to delete the all records in Ztable from report program
Hi Guys,
Good Day!
How to delete all records in Ztable from report program(Means I want to clean Ztable records from report program) . Please send me the code.
Thanks & Regards,
ReddyUse this.
DELETE { {FROM target [WHERE sql_cond]}
| {target FROM source} }.
*But before deleting the rows please check if this Ztable is being used in any other programs or used by others.
Check "where-used-list"
in se11 give the table name
utilities- where-used list.
I hope this helps.
thanks. -
Insert from multiple dbf into mdb tables
Can everyone tell me how to insert records from dbf files into existing ms access tables
1st free solution for Windows: use one jdbc-odbc connection for dbf, and a jdbc connection for ms access, then
Connection dbfConnection=...
Connection msaccessConnection=...
ResutSet dbfResultSet=dbfStatement.executeQuery("select ... from ...where ...");
PreparedStatement accessInsertStmt=msaccessConnection.prepareStatement.("insert into ... (..) values(?,?,...)");
while(dbfResultSet.next){
accessInsertStmt .setObject(1,dbfResultSet.getObject(1));
accessInsertStmt .setObject(2,dbfResultSet.getObject(2));
accessInsertStmt .executeUpdate();
2nd commercial solution for Linux/Unix: use HXTT DBF and HXTT Access, and read Bulk Insert A ResultSet from any JDBC driver at http://www.hxtt.com/access/advanced.html#insertresultset . -
Loading records from .csv file to SAP table via SAP Program
Hi,
I have a .csv file with 132,869 records and I am trying to load it to an SAP table with a customized SAP program.
After executing the program, only 99,999 records are being loaded into the table.
Is there some setting to define how many records can be loaded into a table? Or what else could be the problem?
Pls advice.
Thanks!!!hi Arun ,
A datasource need a extract structure to fetch data .It is nothing but a temp table to hold data.
First you need to create atable in SE11 with fields coming from CSV file.
Then you need to write a report program to read you CSV file and populate your table in BW .
Then you can create a datasource on top of this table .
After that replicate and load data at PSA and use to upper flow.
Regards,
Jaya Tiwari -
Retrive last inserted record from database table
Hi,
some body inserting a record into table 'A' through some procedure/java program.i want to retrive the last inserted record from database table.records are not stored in order.Can any body help me.In general, unless you are storing a timestamp as part of the row or you have some sort of auditing in place, Oracle has no idea what the "first" or "last" record in a table is. Nor does it track when a row was inserted.
- If you have the archived logs from the point in time when the row was inserted, you could use LogMiner to find the timestamp
- If the insert happened recently (i.e. within hours), you may be able to use flashback query to get the value
- If you're on 10g or later and the table was built with ROWDEPENDENCIES and the insert happened in the last few days and you can deal with a granularity of a few seconds and you don't need 100% accuracy, you could get the ORA_ROWSCN of the row and convert that to a timestamp.
If this is something you contemplate needing, you need to store the data in the row or set up some sort of auditing.
Justin -
Insert record from one table to another with help of cursor
Plz help!!!
tables are - 1. country( country_id pk, country_name, region_id)
2. a( country_id , country_name, region_id)
table a data are
1 a 1
2 b 2
3 c 3
null d 4
5 e 5
6 f 6
7 g 7
insert record from table a to country table with help of cursor, insert all not null records.
this procedure does not give correct result
create or replace
procedure amit as
cursor c1 is select * from a;
rw a%rowtype;
begin
open c1;
fetch c1 into rw;
while(c1%found)
loop
insert into countries values(rw.country_id,rw.country_name,rw.region_id);
commit;
fetch c1 into rw;
if rw.country_id is null then
fetch c1 into rw;
end if;
end loop;
close c1;
exception
when others then
dbms_output.put_line('exception name= '||rw.country_name);
end;bluefrog wrote:
You don't need cursor at all;
create or replace procedure amit as
begin
insert into countries (Country_ID, Country_Name, Region_ID)
(select a.Country_ID
,a.Country_Name
,a.Region_ID
from a
dbms_output.put_line('Rows inserted : ' || sql%rowcount);
commit;
end;
Bluefrog you missed where clause. :)
insert into countries (Country_ID, Country_Name, Region_ID)
(select a.Country_ID
,a.Country_Name
,a.Region_ID
from a
where country_id is not null
); -
Inserting records from internal table to database table
Hi all,
i want to insert records from internal table to zDatabase table, can u plz guide me which statement is better in performance to insert the records.
1) insert one by one record from internal table
loop at itab.
insert ztable from wa.
endloop.
2) insert total records at a time
INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
or let me know if any other statement is there with high performance.
i internal table contains nearly 40000 records.
thanks.Hi,
Insert the entire table at atime rather than a record so as to increase the performance.
you can use INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
or
MODIFY ZPRODUCT FROM TABLE GI_AFPO.
Regards,
Raj. -
Inserting records from a txt file to a database table
I would like to know how to insert records from a file (txt) to a database table through a java application?
[BufferedReader |http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html] and PreparedStatement
IO and JDBC -
How to load Matrix report data into basic table data using ODI
Hi,
How to load Matrix report data into basic table data using oracle Data Integrator ?
Requirement Description:
Following is the matrix report data:
JOB DEPT10 DEPT20
ANALYST 6000
CLERK 1300 1900 Need to convert it into below format:
JOB Dept Salary
ANALYST DEPT10
ANALYST DEPT20 6000
CLERK DEPT10 1300
CLERK DEPT20 1900
Thanks for your help in advance. Let me know if any further explanation is required.Your list seems to be a little restrictive, you can do a lot more with ODI procedures.
If you create new procedure, and add a step. In the 'command on source' tab set you technology and schema as per your source database. Use the unpivot functionality as described in the link, please, rather than using 'SELECT *' use the appropriate column names and alias them for eg:
SELECT job as job,
deptsal as deptsal,
saldesc as saledesc
FROM pivoted_data
UNPIVOT (
deptsal --<-- unpivot_clause
FOR saldesc --<-- unpivot_for_clause
IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
Then in your 'command on target' tab set the technology and schema to your target db, then put your INSERT statement for eg:
INSERT INTO job_sales
(job,
deptsal,
saledesc
VALUES
:job,
:deptsal,
:saledesc
Therefore you are using bind variables from source to load data into target.
Obviously if the source and target table are in the same database, then you can have it all in one statement in the 'command on target' as
INSERT INTO job_sales
(job,
deptsal,
saledesc
SELECT job as job,
deptsal as deptsal,
saldesc as saledesc
FROM pivoted_data
UNPIVOT (
deptsal --<-- unpivot_clause
FOR saldesc --<-- unpivot_for_clause
IN (d10_sal, d20_sal, d30_sal, d40_sal) --<-- unpivot_in_clause
also set the log counter as 'Insert' on the tab where your INSERT statement is, so you know how many rows you insert into the table.
Hope this helps.
BUT remember that this feature only came out in Oracle 11g.
Maybe you are looking for
-
Downloading mavericks is taking forever
I have been trying to download os x mavericks onto my mac book pro and in 24 hrs it hasnt passed the 1/4 mark is this normal to take so long? What am i doing wrong?
-
APO Tables for DP forecast Data
Hi All, I am working in VMI scenario. An IDOC of type PROACT carries the forecast data for DP. I need to fetch the dates for which the Forecast data is already existing in the database. Can some one name the tables where the forecast data is stored.
-
Execute two synchronous mappings in BPM
Dear All, i ahve the the follwing sceanrio to be execute in BPM. My requirement is to execute two synchornous mappings which has one source structure coming in file format i have mappe this message type with bothe the target messag etypes. first mapp
-
MDRT$ Not Getting Cleaned Up
We are having an issue where the MDRT$ tables remain in the schema after the spatial index has been dropped. I checked user_sdo_index_metadata and the MDRT$ do not exist in the table. Does anyone know if Oracle supports the manual dropping of MDRT$ t
-
Workflow in Aperture for Alamy
As a contributor to Alamy and a new user of Aperture, I wonder if anyone could recommend an ideal workflow. Most importantly the export settings to meet the Alamy specs. I am shooting using a Nikon D80 which gives a RAW file size of about 8.5 MB. Tha