Different datatypes for insert/update
Hi All
In our design currently we recieve all the data for different
tables in 1 stand by table.
the column datatype in which we recieve the data is varchar2
from this table we insert / update data into the actual tables
where column datatypes can be of numeric, varchar2, date etc
Will updating /inserting into columns of different datatypes from
the varchar2 column will result in any error
Rgrds
For general sanity, you probably want to explicitly cast things (i.e. to_date, to_number, etc). If the varchar2 data is really always numeric when it is being inserted into a NUMBER column, you'll be fine. On the other hand, this sounds like a process that would be quite a maintenance headache if your data is the least bit dirty.
Justin
Distributed Database Consulting, Inc.
www.ddbcinc.com/askDDBC
Similar Messages
-
RFC enabled function module for insert update and delete in a Ztable..
friends..
Is there any standatd RFC enabled function module to insert , update and delete data in a custom database-table (Ztable)? if not how can we create it? plz give me the details steps..
what are the import, export parameters and how to develop and process it.. (for example: suppose fields in the table is Emp_Id, Name, Address)
Thanks and RegardsHi,
Try this code.
REPORT ZMMC071Z_RMV.
TYPE-POOLS : ABAP.
FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
<DYN_WA>,
<DYN_FIELD>,
<LV_CONDI>.
DATA: DY_TABLE TYPE REF TO DATA,
DY_LINE TYPE REF TO DATA,
XFC TYPE LVC_S_FCAT,
IFC TYPE LVC_T_FCAT.
SELECTION-SCREEN BEGIN OF BLOCK F1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_TABLE LIKE DD02L-TABNAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK F1.
Evento: At Selection Screen *
START-OF-SELECTION.
PERFORM GET_STRUCTURE.
PERFORM CREATE_DYNAMIC_ITAB.
PERFORM GET_DATA.
END-OF-SELECTION.
*& Form get_structure
text
FORM GET_STRUCTURE.
DATA : IDETAILS TYPE ABAP_COMPDESCR_TAB,
XDETAILS TYPE ABAP_COMPDESCR.
DATA : REF_TABLE_DES TYPE REF TO CL_ABAP_STRUCTDESCR.
DATA VL_LENGHT(30).
Get the structure of the table.
REF_TABLE_DES ?=
CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( P_TABLE ).
IDETAILS[] = REF_TABLE_DES->COMPONENTS[].
LOOP AT IDETAILS INTO XDETAILS.
CLEAR XFC.
XFC-FIELDNAME = XDETAILS-NAME .
XFC-DATATYPE = XDETAILS-TYPE_KIND.
XFC-INTTYPE = XDETAILS-TYPE_KIND.
XFC-INTLEN = XDETAILS-LENGTH.
XFC-DECIMALS = XDETAILS-DECIMALS.
APPEND XFC TO IFC.
ENDLOOP.
ENDFORM. "get_structure
*& Form create_dynamic_itab
text
FORM CREATE_DYNAMIC_ITAB.
Create dynamic internal table and assign to FS
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IFC
IMPORTING
EP_TABLE = DY_TABLE.
ASSIGN DY_TABLE->* TO <DYN_TABLE>.
Create dynamic work area and assign to FS
CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
ASSIGN DY_LINE->* TO <DYN_WA>.
ENDFORM. "create_dynamic_itab
*& Form get_data
text
--> p1 text
<-- p2 text
FORM GET_DATA .
*Get data from p_table into internal table <DYN_TABLE>
SELECT * INTO TABLE <DYN_TABLE>
FROM (P_TABLE)
Here you can implemente function DELETE, INSERT.
ENDFORM. " De_para -
CQCs for inserts/updates only where newValue != oldValue?
I want two producer apps placing identical data in my cache for redundancy but I don't want listeners advised twice of the insert/update. Is there a way so CQCs only receive events if the data put in the cache is different than the existing value?
Thanks,
AndrewHello Andrew,
I think what you would want to use is the [ MapEventTransformer|http://download.oracle.com/otn_hosted_doc/coherence/350/].
If you compare the new and the old value and they are the same then return null which will not send the event.
Hope that helps,
-Dave -
Search criteria for insert/update bdoc
Hi All,
In our set up we have ecc to crm replication of BP. If one goes and checks the extension data of a stuck bdoc it has an Object Task- Insert or Update.
Can someone help me with search criteria so that i can pull out bdocs which have an Insert as the Object task ??
We have search criteria for errored/intermediate state bdocs; for inbound vs outbound; bdoc type etc etc..
Need one based on Insert/Update Task so that any new data replication if stuck with its very first bdoc( Insert type) can be immediately queried.
Regards
AbhinavHello Abhinav,
I do not think that we have such a search criteria to search for BDocs based on the Task Type, which comes under the
data part of the BDoc.
One alternative way is to find out in which table these data gets stored and write a program to fetch the revelent Bdocs.
Hope thisl helps!
Best Regards,
Shanthala Kudva -
Same page for insert/update
Hi there,
Do someone knows about JSF patterns for using the same page/form for inserting and updating the same entities information ?
2 use cases:
1 --> the user browses a list of objects (DataTable), let's say Employees, clicks on one line and gets redirected to the employee details page so he can update the information;
2 --> the user wants to create a new employee and goes to the same page which is empty.
The way I am actually doing it: I have an employeeForm page and an EmployeeForm managed bean (session scope) which contains an instance of Employee. This Employee is initialized when an empty form is needed or sent by DataTable controller when employee details' are requested.
This is not really nice to my point of view since the EmployeeForm controller has to re-initialize it's Employee instance after each usage.
Does someone has a link or can provide a comment for a "best practise" on that topic?
Thanks in advance,
Fabrice.I think you should consider using the request scope of the employee bean, when navigating from dataTable to employeeForm overwrite the bean with the value from datatable
otherwise the bean is created on every request. -
Interfaces used for insert/update data in tables
for providing security the procedures are not allowed to directly insert/update the values in tables.some one suggested that use interfaces for this .i want infomation about this interfaces. how this works and how to use
An interface is an intermediate set of procedures/functions that do the job for you.
You haven't explained what it is you're trying to achieve exactly, but here's an example scenario.
We don't want to allow our developers to query, or write to the tables directly so they are set up with certain database users that have no permissions granted on the tables for such things.
Instead they have been granted permission to call procedures and functions belonging to another schema, and it is those procedures and functions that do the required table access and/or pass information/data back or write to the tables.
The developers have to write their applications to call these procedures to do any access to the tables. This means that they are limited to the functionality provided by these interface procedures so, if there is internal auditing or columns of data etc. on the tables then it may be that they can't access this data, but only the "user facing" data.
The interface can also ensure that data meets certain requirements before being written to tables, allowing for business or technical level restrictions to be implemented. -
Query on Correct Toplink Usage for insert/update
Hi,
I have a JSF based web application where-in my backing bean is having the Toplink generated enities as managed properties. i.e. the Toplink entity is being populated by the JSF value binding.
Now when I want to insert/update this entity, what approach should be followed(keeping in mind that the entities are detached entities).
I am using Toplink ORM v 10.1.3. I was thinking that I would have to call mergeClone for the update and registerObject for insert. But can I use mergeClone for both insert and update ?
Also mention the performance implications of the suggested option.
Regards,
Ani1. The main concern is will it work with the telecom carriers in India?
It will work in India. The N9 is not released in the US either, so its certainly not tuned to work with specific carriers there.
2. Do I need it to get it unlocked if I buy it from USA?
The N9 is not released in the US, hence you will not be able to buy a locked phone from there. So no question of unlocking it.
3. Will I be able to update the phone's software from India?
I bought the phone in UK, where the N9 is not released. I was able to update the software without problems.
4. What are the chances it will give problems as there would be no warranty/support on it when I bring it here in India.
No idea. Depends on your luck, as with any other phone.
5. Should I go ahead and buy Lumia 800 as it is readily available in India and its support too.
I believe the N9 is a better phone than the Lumia 800. But if you have concerns on the support and warranty, better to be safe than sorry.
A better bet would be to buy from Singapore, if you have someone who could send you the phone from there, or buy it in India from some dealer, who also promises some support. -
API for inserting/updating system profile option values
Hi,
Is there any API that I can use to insert/update system profile option values via PL/SQL?
Regards,
Santhosh JoseHi Santosh,
You can think of using the FNDLOAD utility to download the values from one instance and upload to other instance.
## Now lets have a look at the profile option using oracle's FNDLOAD
FNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct POR_ENABLE_REQ_HEADER_CUST.ldt PROFILE PROFILE_NAME="POR_ENABLE_REQ_HEADER_CUST" APPLICATION_SHORT_NAME="ICX"
## Note that
## POR_ENABLE_REQ_HEADER_CUST is the short name of profile option
## We aren't passing the user profile option name in this case. Validate using ...
########----->select application_id, PROFILE_OPTION_NAME || '==>' || profile_option_id || '==>' ||
########----->USER_PROFILE_OPTION_NAME
########----->from FND_PROFILE_OPTIONS_VL
########----->where PROFILE_OPTION_NAME like '%' || upper('&profile_option_name') || '%'
########----->order by PROFILE_OPTION_NAME
########----->/
## Now to upload
FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct POR_ENABLE_REQ_HEADER_CUST.ldt
For other config components download and upload you can refer the link- http://www.apps2fusion.com/apps/scripts/19-oracle-fndload-script-examples
Thanks,
Sanjay -
Autotrace for insert /update
Hi,
Db : 10.2
Os : Aix6
Is it possible to get the explain for insert statment without inserting the data in oracle 10g?I set set autotrace traceonly explain.
SQL> insert into emp select * from emp;
245760 rows created.
Execution Plan
Plan hash value: 2872589290
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 952K| 22M| 582 (3)| 00:00:07 |
| 1 | TABLE ACCESS FULL| EMP | 952K| 22M| 582 (3)| 00:00:07 |
Note
- dynamic sampling used for this statement
Thanks & Regards,
VNHi VN,
AUTOTRACE information is generated only after successful execution of DML.
Please note: http://docs.oracle.com/cd/B10501_01/server.920/a96533/autotrac.htm
So using AUTOTRACE you cannot get what you want. However, you can just use EXPLAIN PLAN statement.
explain plan for
select * from dual;
select dbms_xplan.display() from dual;vr -
Help for inserting/updating new record
hi,
i am trying to insert new data in account record in CRM OD from java using (web service v2.0 ) following methods
AccountInsertInput accountinsert=new AccountInsertInput();
accountinsert.setListOfAccount(accountDataList);
Here accountDataList is object of ListOfAccountData.......i want to know how can i insert data in accountDataList that is passed as argument....what i think is that i can create object of AccountData and set required values then convert this to ListOfAccountData(which i am not sure if possible)....pls help
there is one more problem while updating i am getting ...."No user key can be used for the Integration Component instance 'Account'."....however i have given the combination of user keys....i don't have accountid so i have just given id .....pls helpHi,
there is one more problem while updating i am getting ...."No user key can be used for the Integration Component instance 'Account'."....however i have given the combination of user keys....i don't have accountid so i have just given id .....pls helpPlease ensure that a record exists in CRM On Demand corresponding to the user key values you are providing. This error indicates that no record can be found matching the specified user key.
Thanks,
Sean -
Cursor problem ! (equivalents for insert, update and delete)
Hi,
I am having following three sql statements. I am using Oracle 8i.
====================================================================================================================
Statement1 : Insert
Insert Into DBSchema.DstTableName( dstCol1, dstColP, dstColKey, dstCol2, dstCol3, dstCol4, dstCol5, dstCol6 )
( SELECT DbSchema.Seq.nextval, srColP, srColKey, srCol1, srCol2, nvl(srCol3,0), nvl(srCol4,0), SYSDATE
From
SrcTableName SRC
Where
srcColP IS NOT NULL AND
NOT EXISTS
(SELECT 1
From
DBSchema.DstTableName Dst
Where
SRC.srcColP = DST.dstColP AND SRC.srcColKey = DST.dstColKey )
====================================================================================================================
Statement2 : Update
Update DBSchema.DstTableName dst
SET ( dstCol1,dstCol2,dstCol3,dstCol4, dstCol5)
=
( SELECT srCol1, srCol2, nvl(srCol3,0), nvl(srCol4,0), SYSDATE
From
SrcTableName src
Where
src.srcColP = dst.dstColP AND SRC.srcColKey = DST.dstColKey
WHERE EXISTS (
SELECT
1
From
SrcTableName SRC
Where
SRC.srcColP = DST.dstColP AND SRC.srcColKey = DST.dstColKey ) ;
====================================================================================================================
Statement3 : Delete
Delete
FROM DBSchema.DstTableName DST
Where Exists (
SELECT
1
From
SrcTableName SRC
Where
src.srcColP = dst.dstColP )
AND NOT EXISTS
SELECT
1
From
SrcTableName SRC
Where
src.srcColP = dst.dstColP AND SRC.srcColKey = DST.dstColKey ) ;
====================================================================================================================
For the above three statement I have written the following cursor.
Equivalent Cursor:
PROCEDURE DEMOPROC
is
loop_Count integer := 0;
insert_Count integer := 0;
CURSOR c1
IS
SELECT src.srcCol1,
src.srcCol2,
src.srcCol3,
src.srcCol4,
src.srcCol5,
src.srcCol6,
src.srcCol7,
src.srcCol8,
src.srcCol9,
src.srcColKey,
src.srcColP
FROM
SrcTableName SRC
Where src.srcColP IS NOT NULL
AND NOT EXISTS
(SELECT 1
From
DBSchema.DstTableName Dst
Where
src.srcColP = DST.dstColP AND src.srcColKey = DST.dstColKey )
BEGIN
FOR r1 in c1 LOOP
Insert Into DBSchema.DstTableName( dstCol1, dstColP, dstColKey, dstCol2, dstCol3, dstCol4, dstCol5, dstCol6 )
values(DBSchema.Seq.nextval, r1.srcColP, r1.srcColKey, r1.srcCol1, r1.srcCol2, nvl(r1.srcCol3,0), nvl(r1.srcCol4,0), SYSDATE);
Update DBSchema.DstTableName dst
SET dst.dstCol1=r1.srcCol1 , dst.dstCol2=r1.srcCol2,
dst.dstCol3=nvl(r1.srcCol3,0),
dst.dstCol4=nvl(r1.srcCol4,0),
dst.dstCol5=SYSDATE
Where
r1.srcColP = dst.dstColP
AND
r1.srcColKey = DST.dstColKey ;
Delete
FROM DBSchema.DstTableName DST
Where
r1.srcColP = dst.dstColP ;
insert_Count := insert_Count + 1 ;
/* commit on a pre-defined interval */
if loop_Count > 999
then begin
commit;
loop_Count := 0;
end;
else loop_Count := loop_Count + 1;
end if;
end loop;
/* once the loop ends, commit and display the total number of records inserted */
commit;
dbms_output.put_line('total rows processed: '||TO_CHAR(insert_Count)); /*display insert count*/
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error '||TO_CHAR(SQLCODE)||': '||SQLERRM);
END;
====================================================================================================================
I am not sure whether this cursor is right or not, have to verify it.
In delete and insert statements there is same where not exist clause in the original statement so I included that in my cursor declaration but not sure whether update will work with that or not.
I have to use the three statements mentioned above for few source and destination tables and each are having many rows. How do i tune it ?
What else can be done to improve the performance with the the three statements mentioned above.
Any help will be highly appreciated.
Thanks !
Regards,You wont any anything extra by creating mulitple threads of the same question. Instead of this just provide the full information wht have been asked so that someone here can helpo you. If you keep doing like this then you will put yourself in our's negative list and that's not good for you.
Daljit Singh -
I have the follwing table is called master table contain the follwing fields,
So here i need to create three Stored procedures
1.Insert operations(1 o/p paramter,and 14 input paramters) - uspInsert
2.Update operations(1 o/p paramter,and 14 input paramters) - uspUpdate
3.Delete Operations(1 o/p paramter,and 14 input paramters)
- uspdelte
The following is the table ,so using this to make the three sp's ,Here we will use Exception machanism also.
Location
Client Name
Owner
ConfigItemID
ConfigItemName
DeploymentID
IncidentID
Package Name
Scope
Stage
Type
Start Date
End Date
Accountable
Comments
So can u pls help me out for this ,bcz i knew to stored procedure's creation.I have the follwing table is called master table contain the follwing fields,
So here i need to create three Stored procedures
1.Insert operations(1 o/p paramter,and 14 input paramters) - uspInsert
2.Update operations(1 o/p paramter,and 14 input paramters) - uspUpdate
3.Delete Operations(1 o/p paramter,and 14 input paramters) - uspdelte
The following is the table ,so using this to make the three sp's ,Here we will use Exception machanism also.
Location
Client Name
Owner
ConfigItemID
ConfigItemName
DeploymentID
IncidentID
Package Name
Scope
Stage
Type
Start Date
End Date
Accountable
Comments
So can u pls help me out for this ,bcz i knew to stored procedure's creation.
Why you have to pass 14 parameters for DELETE and UPDATE? Do you have any Primary Key? If you do NOT have primary key in your table then in case you have duplicate information, SQL will update both or delete them together. You need to provide DDL of
you table. What are the data types of fields?
Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered. -
What are different datatypes for bpel sensor variables
I am in the process of implementing custom data publisher to be invoked from bpel sensor. I need to implement generic logic to parse the variable data and I have to depend to variable datatypes (ITVariableData.getDataType()) since the variables are available only in the form of "oracle.xml.parser.v2.XMLElement" in the DataPublisher.
I need to know available values for the datatype returned from ITVariableData.getDataType() method. Is there any document or link for the same ?Excuse me,
I got the answer by testing the remote API
And I have another question about the BPEL API which used in the console
I have success construct the class com.oracle.bpel.client.Locator
It providing a set of methods for invoking Oracle BPEL
However, the methods always using WhereCondition as parameter
therefore, I need to know about the database.
1. Could anyone tell me where can I found the database schema?
2. There are some deprecated APIs what is the preferred APIs of them?
- IDeliveryService.SERVICE_NAME
- IDeliveryService.request({Process}, {Operation}, {NormalizedMessage})
- IDeliveryService.post({Process}, {Operation}, {NormalizedMessage})
Thank you very much ^^
Roy -
Using stored procedures for insert, update and delete
Hello all;
We have a question from our customer (who is the DBA), who has not in the past used TopLink, about whether it makes sense to tie TopLink into existing stored procedures to save and retrieve informations.
Is it possible?
Is there any circumstance under which it is a good idea?
ThanksIn TopLink any operation for which TopLink generates SQL, can be replaced by custom SQL, or a stored procedure call.
Custom SQL or stored procedures can be used for each of the descriptor's CRUD operations, but also for mapping queries and named queries. The Mapping Workbench only supports defining custom SQL for the descriptor CRUD operations and named queries, so many of the stored procedures call from the descriptor and mappings will need to be done through amendment methods.
Whether it makes sense or not depends on the application and the company and their requirements. It will add significant overhead to the development process to have to define and maintain all of the stored procedures, and the stored procedure calls in the descriptors. You may wish develop your application using TopLink generated SQL, and once you have the model and queries stabilized then switch to using stored procedures.
Whether it is a good idea depends on the application and the company and their requirements. Stored procedures may give the DBA more freedom to change the data-model once in production, and may allow for adding database-level security checks. In general using stored procedures will not improve performance if the procedures contain the same SQL that would have be executed anyway, but they may allow for the DBA to tune the SQL better. -
How to find out who made inserts/updates/deletes made to a SQL Table
I want to know WHO MAKES INSERTS/UPDATES/DELETES TO a particular SQL Table. Bascially I want to AUDIT ANY Edites made to a SQL 2008 TABLE. I need info such as WHO AMDE THE Updates i.e. the user first/lastname, When update was made, what row was updated etc...How
can I do that with SQL 2008?One way to achieve that would be to use triggers to detect when a change is made to the table, and then insert a record into another table/database detailing what changed and who by.
You'd need three triggers, one for insert, update and delete respectively, and for each of those you use the "inserted" and "deleted" tables (system tables maintained by SQL) to retrieve what has been done. To retrieve who made the change you can query IDENT_CURRENT
which returns the last identity value for a specific table.
See :
Triggers -
http://msdn.microsoft.com/en-gb/library/ms189799(v=sql.100).aspx
Inserted & deleted tables -
http://technet.microsoft.com/en-us/library/ms191300(v=sql.100).aspx
INDENT_CURRENT -
http://technet.microsoft.com/en-us/library/ms175098(v=sql.100).aspx
There may be better / more up to date ways to do this, but I've used this method successfully in the past, albeit a long time ago (on a SQL 2000 box I think!).
Maybe you are looking for
-
Report to see the output of VLPOD transaction
Hi Gurus I have configured Proof of delivery concept to caputre loss of Quantity due to moisture. can any body tell me about standard report to see the output of VLPOD transaction.Full points for the correct solution.
-
Does anyone know how to fix this?
-
Display and Upload attachments to Opportunities
Hi, We are building an external Application for the CRM in WebDynpro for Java. 1. We need to attache (upload) documents to opportunities 2. We need to display attachments of opportunities These two actions should be performed using RFCs because this
-
Case Insenstive Search using CLOB
Can you do case insenstive search in CLOB, using DBMS_LOB.instr or any other way or is it necessary to install inter media for that??
-
Poor results when photos edited but look good when 'done'
HI, Apple seems to have ALMOST fixed the problems with the editing part of iPhoto. But pictures are still not very sharp in the edit mode. However when I finish editing and click done the pictures look better. But they really look GREAT when I email