How to combine insert and where query ?
hi..
could somebody guide me how to combine insert and where query ?
insert into tdc_imarspc (ANUMBER,EMF_ID,PRODUCT) values ('1234567','65','ITFS')
where anumber not like '1234567';
Thank you,
Baharin
Hi, Baharin,
As Mahesh said, WHERE only works on a query.
You can always base a query on dual, like this:
INSERT INTO
tdc_imarspc (ANUMBER, EMF_ID, PRODUCT)
SELECT '1234567', '65', 'ITFS'
FROM dual
WHERE anumber NOT LIKE '1234567';Of course, you can use a literal, like '1234567' in both places where I used the bind variable, but if you're not using a variable, why would you want to?
You could also put all the literals in a sub-query (based on dual), and reference column names in the main WHERE clause, LIKE THIS:
INSERT INTO
tdc_imarspc ( ANUMBER, EMF_ID, PRODUCT)
WITH sub_q
AS (
SELECT '1234567' AS an, '65' AS ei, 'ITFS' AS pr
FROM dual
SELECT an, ei, pr
FROM sub_q
WHERE an NOT LIKE '1234567';
I assume you're not really saying
an NOT LIKE '1234567'If you're not using any wild cards after LIKE, you might as well use !=
an != '1234567'
Similar Messages
-
How to combine sales and delivery data
hi
i have requirement to make a report from sales as well as deliveries. Important fields in report are sales document , material , plant , sales document type , country key , sold to party , ordered quantity , delivered quantity , price from vakon ( KBETR ), actual goods issue date.
The required extractors are 2LIS_11_VASCL, 2LIS_11_V_SSL ,2LIS_11_VAKON.
Problem is how to combine sales and delivery data as V_SSL has different key figures.Multicube is not the solution as dont have plant , sold to party and many other fields in V_SSL.
Kindly suggest how to combine sales and deivery data.
Regards,
MonikaI guess you do have shipping point in delivery.
In most scenarios shipping point may not(or) may be same like order plant.
Although they are different you can still roll up the delivery information to order level by plant since you have order # available as reference key in delivery.
With this reference key you can convert all delivery information to order (item) level.
I guess you can use one merge ODS with one cube (or) with 2 ODS for each at order level for validation.
You may have to map delivery type to order type as per R3 configuration as well.
speak with any Logistics guys for help.
cheers
Martin -
How do I insert and delete pages from a pdf with acrobat 10X?
How do I insert and delete pages from a pdf with acrobat 10X?
Alternatively, be sure your page thumbnails panel is open, and click on the icon highlighted in this image, just under the heading.
You will see a dropdown with the options you need. -
How can u insert and retrieve text files in any format using forms6i.
how can u insert and retrieve text files in any format using forms6i.
can u give me an example of an insert statement, let's assume the file is located in the a:drive.
and retrieving the files, i would give the user a list of all the files that are in the database, the user would select one, but what command(or piece of code) would open the file in its apppropriate editor.
e.g .pdf formatted file would open in acrobat.
any help would be appreciated.
Thanks
Hussein Saigerthe filereference class is for downloading and uploading files.
if you want to load xml, use the xml class.
and, if you want to write to an xml file and don't want to use server-side code, wait. -
the battery of my Ipod doesnt charge, so how much it cost and where can I replace it???
You can take it to an Apple store...I think its costly though, I was told maybe a 100 bucks...not sure though. How long have you had the iTouch before the battery showed signs of failure, what Generation?
This is something that has been having me wonder about battery life. -
(in the browser before I used the theme in anime), I do not remember how to install it and where to find, maybe it was not a topic, and skin.
The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
To Reset Firefox do the following:
#Go to Firefox > Help > Troubleshooting Information.
#Click the "Reset Firefox" button.
#Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
#Firefox will open with all factory defaults applied.
Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
Did this fix your problems? Please report back to us! -
How to combine servlet and jsp
I'm doing a project. My friend using jsp. and i using servlet..
we are confused, how to combine servlet and jsp. or we can just use redirect??
but it's still doesn't work properly...thanks for your helppYou can use RequestDispatcher interface for calling a JSP from a Servlet, or vice-versa.
Following is the code for sending output to a JSP page from a servlet:
javax.servlet.RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(�/Ashu.jsp�);
request.setAttribute(�Name�,�Ashutosh�);
dispatcher.forward(request,response);
- Ashutosh -
I can't sync my iPad to the iTunes it's give me an unknown error message 0xe8000012 I don't know how to fix it and where is the problem could be need format or the problem is in the charging port please can any one help me
Unknown Error containing "0xE" when restoring
To resolve this issue, follow the steps in iPhone, iPad, iPod touch: Unknown error containing '0xE' when connecting. If you have a Windows computer with an Intel® 5 series/3400 series chipset, you may need updates for your chipset drivers. See iTunes for Windows: Issues syncing iOS devices with P55 and related Intel Chipsets for more information.
From Here > http://support.apple.com/kb/TS3694 -
How can I insert and image in all PDFs printed via BW?
How can I insert and image in all PDFs printed via BW?
We want to remove the image from all Web Templates and insert it in the header of PDF printouts.
<removed by moderator>!
Tom
Edited by: Siegfried Szameitat on Dec 3, 2008 2:57 PMSelect clip in timeline. Open effects. At the bottom, search for flip. This should find the "Flipped" effect. Drag that effect cover the clip.
-
I bought an Iphone 4S 16Gb from softbank - Japan. I would like to buy an active code for my Iphone, how can I do and where can I buy?
That iPhone is useable only on the softbank network. Softbank does not
unlock iPhones for use on other networks. Sell that iPhone to someone who
can use it on Softbank and use the money to buy an iPhone that will work
with your wireless provider. -
HT4623 How do I download and where can I save All my contacts on my Computer ?
How do I download and where do I save All my contacts onto my computer ?
How to sync iPhone with Outlook: http://lmgtfy.com/?q=how+to+sync+iphone+with+Outlook
-
How to combine spatial and secondary index, when extracting?
Hi spatiallers,
vers.: (32 bit) Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production on Sun/SunOS 5.8 (64 bit)
In our DataWarehouse the table topo_geodata stores all topographic data in Denmark. The table has a spatial index (QT) on its SDO_geometry column named utm_geo as well as a primary key on the column topo_geo_id and 4 secondary indexes on other columns.
The query to find all geomtries in a given munipalicy is as follows
select count(*) as antal_AnyInteract_topo_geodata
from topo_geodata k, topo_geodata tg
where SDO_RELATE(tg.utm_geo, k.utm_geo, 'mask=AnyInteract querytype= WINDOW') = 'TRUE'
and k.topo_geo_id = 961 -- geometry of a municipality
and it returns a count of 19445 in 4 minuttes. However our users are only interested in extracting certain object types, that is a very small subselection of the 19445 geometries. The subselection is typically based on some value or a range of values in the secondary indexed columns.
Question: How can I make the SELECT use a combination of the spatial index index and a secondary index?
Only when a pinpoint 1 particular value of the primary key do I get fast response. When pinpointing 1 value in a secondary index as in
select count(*) as antal1
from topo_geodata k, topo_geodata tg
where SDO_RELATE(tg.utm_geo, k.utm_geo, 'mask=AnyInteract querytype= WINDOW') = 'TRUE'
and k.topo_geo_id = 961 -- Gladsaxe
and tg.mtk_obj_id = 58476 -- has secondary index
the performance deteriorates back to 4 min., and the queryplan shows some weird bitmap conversion followed by a bitmap-and operation.
- Thanks in advance,
Jens Ole Jensen
Kort & MatrikelStyrelsen (WWW: http://www.kms.dk)
DanmarkHi Jens,
I'm not sure I understand the question, or what it is that works fast.
In this case, the SDO_RELATE with the anyinteract mask has to be done first.
If this takes 4 minutes, then adding additional criteria to reduce the amount of
data returned from that subset will only add time.
The spatial portion of the query has to be done using the spatial index, which is
a monolithic index for the whole table, so all of the geometry data has to be searched,
and the anyinteract applied to all of this data.
After that set of rows comes back, then the additional predicate is applied.
I'm not sure what this means:
Only when a pinpoint 1 particular value of the primary key do I get fast response. You do have a few options to try to make things work faster:
If queries included additional predicates on mtk_obj_id, you might try
to use range partitioning.
If the predicates on mtk_obj_id is very selective, then you might want to select
values based on that column, then use sdo_geom.relate between that very
small subset and the query window.
Hope this helps, and all is well with you.
Dan -
How to design insertion and report for customers
I develop a web application in which I provide a web interface for inserting a customer. I model this customer as a class and provide its attributes. I have functions like addCustomer that inserts a customer's details in DB and getDetails() that returns a customer's attributes as an array. I have designed this for dealing with a single customer.
Now I want to list all customers from DB. I think another class should be created with a listing function that has multiple references(multiplicity) for the customer class. It is a easy task to retrieve all customer using a query and display it. But I don't know how to model this. I don't want to create one object for all available customers and display the details of each customer. Then How to model this and how to implement this using classes.
Can U tell me a resource or article that handles similar task.
Thanks.Hi,
Create a POJO called customer ( plain java object which represent the persistant data ) and a Customer manager which is reponsible for retrieving a list of customer.
So the Customer manager will deal with retrieving the customer list.
Regards,
Alan Mehio
London,UK -
Want to get totaly how many is insert and how the duplicate name
Hi all,
I need to insert a group of string into database it work, but I also need to know how many rows is insert, and out put the duplicat name out
My code is
while(tokens.hasMoreTokens()) {
MySec=tokens.nextToken();
while(token.hasMoreTokens()) {
rs = stmt.executeQuery("select * FROM "+table+" where Name='"+Name+"' and Segment='"+Segment+"'");
// same sequences will only allow to upload once.
int Row=0;
while(rs.next()) {
Row ++; // count rows in record.
connectionPool.returnConnection(conn);
if(Row <1){
conn.setAutoCommit(false);
//insert data into different tables
stmt.executeUpdate("insert into "+table+" ("
+ "Name, Segment, Sequence, SubType,location, SampleYear, author)"
+ "VALUES('"
+ Name + "','"
+ Segment+ "','"
+ word+ "','"
+ subType + "','"
+ loc + "','"
+ year+ "','"
+ author + "'"
+ ")");
conn.commit();
conn.setAutoCommit(true);}//end if
else{
dupli[k]=Name;
k++;}
}//in while
}out while
Thank youOrange file?!?I.e. not the Apple file.
-
Insert and update query to calculate the opening and closing balance
create table purchase(productid number(5) ,dateofpurchase date,
qty number(5));
create table inventory(invid number(5),productid number(5),
idate date,openingqty number(5),closingqty number(5));
Records in inventory:
1,1,'01-jan-2009', 10, 20
2,1,'03-jan-2009', 20, 30
3,1,'04-jan-2009', 40, 50
when I enter the purchase invoice for 15 qty on 02-jan-2009
after say '15-jan-09' , a new record should get inserted
with opening balance = (closing balance before 02-jan-2009)
and all the opening and closing balance for that product should
get affected.
If the invoice for 20 qty is entered for the existing date say
'03-jan-2009' in inventory , then the closing balance
for 03-jan-2009 should get updated and all the following records
should get affected.
I need the insert for the first one and update query for the
second one.
Vinodh<strike>You can do this in one statement by using the merge statement</strike>
Hmm, maybe I spoke too soon.
Edited by: Boneist on 25-Sep-2009 13:56
Thinking about it, why do you want to design your system like this?
Why not simply have your purchases table hold the required information and then either work out the inventory on the fly, or have a job that calls a procedure to add a row for the previous day?
If you continue with this design, you're opening yourself up to a world of pain - what happens when the data doesn't match the purchases table? Also when is the inventory cut-off to reset the opening/closing balances? Monthly? Annually? Weekly? If it's set to one of those, what happens when the business request the inventory for a particular week?
Edited by: Boneist on 25-Sep-2009 13:59
Maybe you are looking for
-
Why do I get this SQLException?
Hello! I got two questions 1) I'm using Mysql, I can insert without any problems but I can't do "UPDATE" then I get this error: ("key" is my primary key) ----------------------------------------- ERROR ------------------------------------------ java.
-
BMM & PRESETATION( newbie)
1) explain how aggregate tables work. 2)explain how to setup level-based measures. 3)how to create multiple hierarchies for the same dimension. 4) can you change the presentation column name in the presentation layer? 5) How to categorize the folders
-
New iPhoto not working at all - blank library on startup
I just upgraded my iLife package to 09 and must admit that I've never experienced this much trouble in my 15 years as an apple. First of all: Upon upgrading and first launch of iPhoto I was met by a complete blank library. I quickly checked all my pr
-
How to implement delete functionallity on a form
Hello I have a form that displays the current row of a table, and you can modify it. I want to implement delete functionality in such a way that deletes the current row and shows the next one in the form. My problem is that the delete button must be
-
Verizon system can't handle porting phone number from Straight Talk customers?
According to this discussion: Verizon system can't handle porting phone number from Straight Talk customers? If still true, then VW misses a huge business opportunity. Adjusting the sizing the account number to be wider is not a hard system adjustme