Query Need Answer

Hi Genius,
I need one query for below question:
create one procedure with different dml operation,different tables and different where condition? i need example also.
Urs
Apple

Is that what you need ?
CREATE OR REPLACE PROCEDURE test
AS
sql_stm VARCHAR2(4000);
tex VARCHAR2(20):= 'aaa';
BEGIN
sql_stm := 'INSERT INTO tab1 VALUES(1,:1)';
EXECUTE IMMEDIATE sql_stm USING tex;
sql_stm := 'DELETE tab2 WHERE id = 3';
EXECUTE IMMEDIATE sql_stm;
tex := 'bbb';
sql_stm := 'UPDATE tab3 SET id = 3 , tex = :1 where id = 2';
EXECUTE IMMEDIATE sql_stm USING tex;
END;
/Edited by: Mirek186 on 2010-12-19 07:34

Similar Messages

  • Defining more parameters than a query needs

    Hi.
    When I run the following code, I get the error "ORA-01036: illegal variable name/number" .
    The problem is that I currently define more parameters than the query needs. Thats because I don't know how many bind variables the query uses, and I would not like to parse the query ...
    I don't understand why I have to define exactly the same number of parameters, and in the exact order ... It doesn't make sense. As bind variables have names, there should be no problem passing more parameters or parameters in a different order: the binding should be done by name...
    I'm currently using Oracle10g, ODP.NET and .NET Framework 2.0.
    I would appreciate any help ...
    Thank you.
    Ricardo Coimbras
    ===== BEGIN VB.NET CODE =====
    Sub Execute_Query(ByVal SqlString as String)
    Dim ObjCmd As OracleCommand
    Dim DataAdap As OracleDataAdapter
    Dim outDsCorpo As DataSet
    Dim Constroi_Conn_String_Oracle As String
    Dim mObjConnOracle As OracleConnection
    Constroi_Conn_String_Oracle = "User ID=uuu" & _
    ";Password=ppp" & _
    ";Data Source=bd" & _
    ";Pooling=false"
    mObjConnOracle = New OracleConnection(Constroi_Conn_String_Oracle)
    mObjConnOracle.Open()
    ObjCmd = mObjConnOracle.CreateCommand()
    ObjCmd.CommandType = CommandType.Text
    ObjCmd.CommandText = SqlString
    ObjCmd.Parameters.Add("p1", OracleDbType.Char, 3, "001", ParameterDirection.Input)
    ObjCmd.Parameters.Add("p2", OracleDbType.Char, 3, "001", ParameterDirection.Input)
    DataAdap = New OracleDataAdapter(ObjCmd)
    outDsCorpo = New DataSet()
    DataAdap.Fill(outDsCorpo)
    GridView1.DataSource = outDsCorpo
    GridView1.DataBind()
    DataAdap = Nothing
    ObjCmd = Nothing
    mObjConnOracle.Close()
    mObjConnOracle.Dispose()
    mObjConnOracle = Nothing
    End Sub
    Execute_Query "select * from map.t_mapa_def where mapa_def_cod = :p1 order by mapa_def_cod"
    ===== END VB.NET CODE =====

    Hi,
    BindByPosition is the default behavior as per the docs, and you can change that by setting cmd.BindByName=true which adds a little bit of extra overhead.
    That wont fix the error seen when binding a random number of parameters to the statement though. You need to bind the correct number and types of parameters.
    Greg

  • How much UNDO does a query need?

    It seems that due to a gigantic delete, I am running out of UNDO. How can I see exactly how much undo a query needs?
    Searching on the web, I found this:
    select sq.sql_text sql_text, t.USED_UREC Records, t.USED_UBLK Blocks, (t.USED_UBLK*8192/1024) KBytes from v$transaction t,
    v$session s,
    v$sql sq
    where t.addr = s.taddr
    and s.sql_id = sq.sql_id
    and s.username = 'blah'
    , which is fine, but it seems to be returning results for only running queries. In other words, when the delete query I am investigating is executed, the above select returns no rows. Is there a way to modify it to return also queries that have been executed?
    Any help is welcome.
    Message was edited by:
    user622271

    Hi,
    It seems that you need to make an outer join between v$sql and v$session views [s.sql_id = sq.sql_id(+)] ... For more information is if this [url http://forums.oracle.com/forums/thread.jspa?messageID=1756927&#1756927]thread can help you.
    Cheers
    Legatti

  • SQL query needed to identify cancelled invoice where distribution lines

    SQL query needed to identify cancelled invoice where distribution lines Debit is not equal Credit line item in particular
    Is there a way from back end FROM ap_invoice_distributions_all where we can find for the cancelled invoice where distribution lines Debit is not equal Credit line item
    Regards,
    Prakash Ranjan

    Hello Prakash
    Can you please see if this query helps you?
    SELECT i.invoice_id, i.invoice_amount, nvl(sum(d.amount),0)
    FROM ap_invoice_distributions_all d, ap_invoices_all i
    WHERE i.org_id = <you org_id>
    AND i.invoice_id = d.invoice_id
    AND d.line_type_lookup_code not in ('PREPAY')
    AND i.cancelled_date IS NOT NULL
    GROUP BY i.invoice_id, i.invoice_amount
    HAVING (i.invoice_amount <> nvl(sum(d.amount),0))
    ORDER BY i.invoice_id asc
    Octavio

  • Query needed

    Query to get list of employees having photo attached with their profile and query needed to extract the January to April timesheets approved in oracle on 6th May 2008

    sorry could not understand your question completely.
    I think following query should work, but I am not sure
    select *
    from hxc_time_building_blocks
    where start_time >= sysdate - 60
    and scope = 'APPLICATION_PERIOD'
    and trunc(date_from) = trunc(sysdate)
    and date_to = to_date('31-12-4712', 'DD-MM-YYYY')
    and approval_status = 'APPROVED';
    Change your date from sysdate to some other date. This query is not optimized so you need to tweak it a bit if it works at all.
    Any other OTL Expert on this

  • How to find which query need to tuned

    Hi ,
    How can i find , which query need to tuned . Is there any mechanism behind it?

    The mechanisms behind it are depending on your database version.
    For example:
    Oracle 9i has STATSPACK that helps you to identify possible problem queries.
    Oracle 10g has AWR - Automatic Workload Repository
    Oracle 11g has SPA - Database Replay SQL Performance Analyzer
    but there are many more tools/mechanisms...trace/tkprof for example.
    Go to http://tahiti.oracle.com and do a search on 'performance tuning guide', and pick the one that matches your (sofar unknown) database version, read a bit every now and then and see what tools are at your disposal and fit your requirement and situation.
    Besides the links that Blu already posted, searches on http://asktom.oracle.com also give lots of pointers and explanations regarding the (neverending) tuning process (at least: helped me tremendously in understanding the tuning process, the do's and dont's).
    Make sure you don't get CTD (Compulsive Tuning Disorder) from all this... ;)

  • Query Jump with Navigation ( Sub query need to show same Navigation )

    Hi All.
       We have 4 BEx queries in our Dashboard Web Template and each table web items shows 10 rows and remaining with Scorll.
       For Printing ,we have created a query jump for each BEx Query ( same copy query) that shows all the rows detail.
       When i tried to jump from Orginial Dashboard ( From Specific table/Bex Query) with drill down <b>( Plant by Material )</b> , the jump query is not showing the same drill down but it showing the default rows <b>( Plant as per query rows</b>).
       SAP has suggested us its possible to do Query Jump with Navgiation that shows the same drill down path (navigation) in Sub Query as well.
       Am unable to find how to configure that , did search in OSS / Other Forumns But there were no postings on this.
       For me there is no Settings in RSBBS (or) SPRO and tried the Web Address Jump as well to pass the Drill Down Status (or) Navigation. May be iam not looking at right place. We are at 3.1x
       We found some limitations with SAP recommended web printing ( we dont need to discuss about that as per our requirement ), and our users like the Query Jump printing as which we working on now.
       Please inform if this can be possible, if so how.
    Thanks
    Martin Mouli

    Thanks for reply Bhanu.
    Its not like just Plant by Material.
    I would like to do my slicing & dicing on Navigational block with any combinations ( Customer by Plant by Material )
    When i do query jump from My Original Web Table , my jump query need to show the same drill down ( Customer by Plant by Material)but its showing only Material. ( Which is a default row in sub query)
    To show the same navigation in jump query as well, right now am doing drill down again in jump query as well. Its time waste to repeat the same drill down steps in sub query.
    By default my Jump Query has Material as row and We will show Plant & Customer on Demand (free characteristics)
    Please inform if more information required.
    Regards
    Martin Mouli

  • Monitoring via WMI - query needs a long time to get a result

    Hi experts!
    I am using Icinga (Nagios Fork) and a plugin called check_wmi_plus.pl (Perl Skript) which uses the wmic linux implementation.
    I have now multiple servers which needs very long to answer. I am using exactly the same command on the hosts. I give you an example here:
    Server-A:  WMI query needs ~70 Seconds, Ping Time is ~0.5-2.0 ms
    Server-B:  WMI query needs ~9 Seconds, Ping Time is ~90-120 ms
    I ran exactly the same command, from the same host, with the same user credentials and they are on the same domain.
    This behavior is not by the operting system because I have 2008r2 and 2003 servers which do both, need short and long time. They are all in different locations so there seems not to be a network issue. Hosts that are having the problems are 2008 hyper-v
    hosts but also 2003 file servers.. so I dont see any match here.
    I dont know how to go ahead, where to start the next troubleshooting steps?
    Is there any WMI log on the server I can monitor?
    Any help or ideas would be great! Thanks in advance!
    cheers, Duffkess

    this issue
    might related to the network issues, please check the Receive Side Scaling and
    the TCP Chimney registry settings. If TCP Chimney was enabled along with the
    RSS setting, WMI would fail.  <o:p></o:p>
    Meanwhile
    please test if the local basic WMI query also slow by
    Administrator account.<o:p></o:p>
    a. Run wbemtest, connect the namespace
    root\cimv2<o:p></o:p>
    b. Click Query… and enter query as: Select * from
    Win32_ComputerSystem. <o:p></o:p>
    c. Note down how many seconds does the query take.<o:p></o:p>
    Please also test if the remote basic WMI query is slow by
    Administrator account.<o:p></o:p>
    a. Run wbemtest, connect the namespace
    \\machinename\root\cimv2<o:p></o:p>
    b. Click Query… and enter query as: Select * from
    Win32_ComputerSystem. <o:p></o:p>
    c. Note down how many seconds does the query take.<o:p></o:p>
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • BEx query needs to count unique characteristic values

    Is there any way to build a query using BEx query designer to count the number of unique values of a characteristic.  For instance, my cube has detailed transactions for claim information.  Each claim number can have multiple products.  My query need to show the number of claims that exist for each product.  I don't want the detail of the claim number, just how many claims exist.
    Product          Gross Paid Loss        Claim Count
    Total Auto                $ 43,865.01              ?
    Total Property  $ 4,068,321.57              ?
    Not assigned                19,426

    Hi,
    Creat calculated  keyfigure with data functions Count value and save with technical name.
    Right click on that go to propertes, select count with exception aggregation - Claim Number,
    also use after aggregation and decimal places '0'.
    Regards
    Malyadri

  • Need answers for finance module? so any finance consultant can help me

    hai
    i need answers for automatic credit check managament.
    So,Can any functional consultant or technical consultant
    who knew the concept can help me to resolve
    the query.
    The query is abt the functional module
    "ENTIRE_LOAN_AMOUNT_CALCULATE".
    this will retrieve the structure RLOAM
    from which i have <u>to get the balance amount</u>
    for the relevant company code and contract number found.
    1) here what is  the balance amount from that structure
       and which fields i have to consider.
    2) what is the security fund contract?

    Sorry about cross-posting. I just coudn't help. I was so desperate because I'm having F in this class since I haven't turned in any programs so far. So please understand me a little bit.
    And Thank you all for reading and answering my question. It really helped me a lot.
    I think I'm gonna have to bother you guys often =) Thank you again~!
    Oh.. by the way, is there any way that I can write this program using basic methods like 'for', 'while' ,'array'?
    because we haven't got so far in my class and I'm not sure if my teacher's will accept my program written, using the methods that we haven't even learned. Any way Thank you again~!
    c.f> I will cross-post this so I can thank everyone.

  • How to open a Cash Drawer in AS3? NEED ANSWER ASAP!!!

    Is it in anyway possible to open a cash drawer in actionscript 3 (Flash CS5) that is connected to a receipt printer. NEED ANSWERS ASAP!

    You're right ! But my printer is connected via the ethernet port and i need to use the print API to communicate with it. In ActionScript nothing works I tried to send the escape sequence that should open the drawer : String.fromCharCode(27)+String.fromCharCode(112)+String.fromCharCode(48)+String.fromCharC ode(53)+String.fromCharCode(53) ... it didn't work.
    So i decided to call a little Java program (JAR) through the Air NativeProcess API. This program send the escape sequence to the printer using Java print API.
    Thx for the answer

  • I have inadvertently infringe copyright on facebook and they have subsequently barred me from uploading any more videos. The question I need answered is ( and not able to find the answer on any of you help pages).....  Do the following have free copyright

    I have inadvertently infringe copyright on facebook and they have subsequently barred me from uploading any more videos.
    The question I need answered is ( and not able to find the answer on any of you help pages).....
    Do the following have free copyright to publish on facebook and U Tube?
    1.Garage band sounds?
    2.Slide show...Sample music and Theme music?
    3.iMovie...iMovie sounds and iLife sounds ie.Medal Ceremony and Memorial etc?
    I note one can publish to shared net places directly from iMovie so one assumes these are copyright free for non-profit making and non-comercial use.
    It is impossible to contact apple direct.No email address.We put our selves at risk without this knowledge and like applemac, facebook will not communicate direct.Will applemac please take responsibility for copyright/the above that they are all too willing to sell to us but not support us with that knowledge.
    I have Mac OS X Snow Leopard version 10.6.2 (2009 bought in 2010)

    Thank you Klaus1.The large font, I copied and pasted from my mail box.I'm visually impaired...not to a huge degree but it helps to use the large font.I believe you are right about the copyright on the imac stuff but if facebook decide otherwise, you have to reply electronically to their challenge.If you can't provide a reference directly from the copyright owner then they remove the video.I believe this is a programmed response and no human is involved which now makes it impossible for me to get my video uploading restored.They detect added soundtrack automatically and then challenge.There are many others in the same boat and facebook will not communicate.They have various discussion sites on which I have left messages including Mark Zuckerbergs own facebook but I don't think anyone from facebook ever reads them.I intend to start a second facebook which I can use purely to get my videos uploaded as a lot of my friends enjoy them BUT don't want fall foul of their programming again.If only iMac would put something on the net to this effect.I think it is so unfair that with modern technology it is impossible to contact these large conglomerates personally and receive an email response.I tried emailing [email protected] but I got a failure notice.If you have any ideas on how to get verification from apple direct, I would be very grateful.Thank You.

  • Question about Xmod.. Need answer

    I'm really **bleep** Interested in the X-Fi technology and all that.
    Firstly the Xmod compared to other X-Fi devices... will the output sound be same in all the cases?
    look upon here:
    http://www.atomicmpc.com.au/article.asp?SCID=88&CIID=67889
    Apart from that all other reviews are mostly : Don't like it... or LOVE it..
    It says there isn't any X-Fi chip in the Xmod.
    Over that .. the test results are different from the X-Fi sound cards!!
    I just need answers from a professional person in this.
    Creative... Help me with this.

    don't compare xmod with the x-fi pci soundcard. theey are different. xmod is just a gimmick.

  • HT201303 I forgot my security answers, how do I recover them? I need answers ASAP!

    I forgot my security answers, how do I recover them? I need answers ASAP!

    This is the most asked and answered question on this forum.  Look at More Like This on the right side of this page or do a forum search or just look at the other posts.

  • Is there a firefox or best browser (except IE) for Windows Server 2003 R2 Standard? if so, is it free of charge (open source) forever? where can I get it? details. need answers to all questions

    is there a firefox or best browser (except IE) for Windows Server 2003 R2 Standard? if so, is it free of charge (open source) forever? where can I get it? details. need answers to all questions

    # As to what is the best browser, it is subjective. I think it is the best, others will disagree. There is no special version for Windows Server 2003, the usual version works on it.
    # It is free of charge and will always be free.
    # It is open source.
    # You can get it from http://www.mozilla.com

Maybe you are looking for

  • HT5858 When I press the app store app on my ipad

    When I press the app store app on my ipad, one of my previous purchases appears in the middle of the page.  I can't remove it so I can purchase more apps.  What do I need to do?

  • Multiple LIVE applications

    Wonder if you can help-. Two things really: Has anyone tried running HTMLDB 2.0 (APEX) on Microsoft Virtual server? Does ORACLE support this? I was planning on creating four environments on the same hardware, (Live, Staging, Development, Training). A

  • Where do I see "saved podcasts" (iTunes 11.2)

    Installed iTunes 11.2. I'm not sure how I access my "saved podcasts".  Where do they show up? Are all podcasts that are not deleted implicitly "saved podcasts"?

  • Prevent data from being written back to prod

    Are there any safeguards to ensure that the data is not written back to production? I know it is the RFC definition where the sender and receiver relation is maintained but other than that is there an internal TDMS mechanism that ensures that safegua

  • Plugins for SonyEriccson P990i and Nokia 6300

    Has anyone had any success using the available plugins that are out there with Leopard 10.5.6 and iSync 3.0.2? For example, v1.0.7 from SonyEriccson and the (old) plugins for the Nokia. None of these seem to work with the above version of iSync.