How to execute multiple queries in one stored procedure.

Hi,
I am Kumar,
How to execute multiple queries in one stored procedure.
here is the my requirements,
1. get the max value from one table and sum of the that value.
2. insert the values and also sum of the max value.
using stored procedure
I am using SQL server 2000 database.
Please help me.
Advance thanks
by,
Kumar

This is not a java question and it is not even a problem: your only problem is
1) lack of knowledge
2) lack of interest to find a manual
But you are going to have to change both by actually reading a book or a manual that explains the stored procedure language of SQL Server. It is the same as Sybase I think, so you could also look for a manual for that DBMS.

Similar Messages

  • How to execute Operating System commands from Stored procedure.

    Any help on how to execute Operating System commands from stored procedures will be appreciated.
    Nanditha.

    Search the forums for 'External Procedure' and you will find example code that has been posted before.

  • SQL Developer cannot execute multiple queries in one connection

    Hi,
    Using : SQL Developer 1.2.29.98, Oracle Database 9i on Windows XP.
    Currently I have TOAD and PL/SQL Developer to handle things related to Oracle Database.
    I found this SQL Developer tools as an interesting tool which might replace PL/SQL Developer (I assume).
    I opened two SQL Worksheets and tried to execute 2 queries (time consuming one) simultanously, suddenly it freezes (the window become grayed). Just like TOAD, we cannot smoothly execute multiple queries on single connection on SQL Developer
    I can monitor the query process using TOAD (Session Browser) and found both queries are running while SQL Developer window become grayed and seems not functioning. After the queries have been finished, I mean both of them, the SQL Developer window become normal and "alive" again showing the expected results.
    Well, however PL/SQL Developer could handle this. Executing multiple queries in single application is just its unbeatable features.
    We can view the query result once its finished instead of until the others being processed, by just only switch the SQL Windows.
    Is it true that SQL Developer doesn't support executing multiple queries?
    Or is it a feature which we should request?
    Or we have to activate this feature by doing some changes on configuration / preferences?
    (Do we need to open two SQL Developer instances? what a memory consuming solution).
    Regards,
    Buntoro

    SQLDeveloper connections are single threaded and also rather single minded (in that you can't do much else while a long query is running.)
    There is an existing feature request http://apex.oracle.com/pls/otn/f?p=42626:39:3685254426061901::NO::P39_ID:4202 for which you can vote.
    The workaround is to have multiple connections. Not brilliant but it works.

  • How to embed multiple queries in one web template

    Hi,
    I've a requirement wherein I need to embed two queries in one web template. The first query displays order quantity from a particular customer and the second query displays other information for that customer. Most of my web templates i've contains only one query which i've created using 0ADHOC template saving this as diff template and modifying it. But this is the first time I have got this type of requirement wherein the user drills down on a particular customer for order quantity and then goes for other information from other query.
    Does anyone out there has any idea or suggestion as to how to do this ? One more thing I need to pass the values from one query to another which is akin to RRI concept while staying in the same web template.
    Your suggestions/advices are highly appreciated.
    Thanks in Advance,
    Rash.

    Hi Rash,
    You can do this by including 2 table web items in your template and assiging the 2 different queries as different dataproviders to each. You can try to create a drop down box to filter the customer and in its properties set DataProvider1 and DataProvider2 as the affected data targets.
    Hope this helps...

  • Executing a Variable in a Stored Procedure containing an Update Statement

    Hi,
    I have created a Stored Procedure, it has one input parameter. Inside the Stored Procedure there are 5 other variables are declared, based on the input parameter 4 of these variables are populated.
    Fifth variable is a a concatenation of text and some of these variables and creates a dynamic Update Statement. Once it is created I want to execute this variable but it is not executing.
    Could someone please help me in knowing how to execute a variable within a stored procedure that contains an update statement.
    Thanks for your help.
    Thanks
    Vineesh
    vineesh1701

    If you have set up the variable so that it contains a valid sql update, it should work.  For example, see below, which does do an update
    use tempdb
    go
    Create Table #Test(i int);
    Insert #Test(i) Values(1);
    go
    Create Procedure TestProc As
    Begin
    Declare @SQL nvarchar(250);
    Set @SQL = 'Update #Test Set i = 2';
    --Print @SQL;
    Exec sp_executesql @SQL;
    End
    go
    Exec TestProc
    -- Test Result
    Select * From #Test;
    go
    Drop Procedure TestProc;
    go
    Drop Table #Test;
    One thing I would recommend while testing is that you print out or select the variable that contains the dynamic sql.  (Like the above code where I have a print statement.  That lets you see exactly what you are executing and if there is any problem
    with the update command. 
    As Naomi said, to get anything more than general help, you will probably have to show us your code and the parameter values you are passing when you execute the stored proc.
    Tom

  • Can we use multiple queries on one template

    Can we use multiple queries on one template

    Hi,
    if you're using data templates for your data set, you
    can put multiple queries in the XML data template.
    The queries may then be linked (or not) by the "link
    name" tag ...
    Grtz.Following you answer here...do you know eventually how/if possible to preview a report (with XMLP Desktop) that is using data templates for the data set?
    Thanks,
    Liviu

  • How to run multiple sqls in one jasper report

    Hello!
    Is there any one that can help me in integrating/ viewing my xml file to the web. I have my GUI in jsp format, the jsp makes a call to the bean class and then finally bean class hit my reports java class.The report java class generates the report and shows it in the new window.
    The problem is with writing mutiple sql queries and showing the result from multiple sql queires in one report.
    I do not know how to write multiple queries for just 1 report. I can give a simple example of my problem also.
    My report is as follows:
    First Name Middle Name Last name
    Sandeep               Pathak
    Now First and Middle Name come from 1st sql query and Last Name comes from 2nd sql query.
    I want to join the result obtained from both the sql queries in one Jasper Report (not as 2 separate sections but as one section).
    My problem is how to view my report in the web. furthermore, how to make complex query in jasperassistant, like multiple table in one query, because i�m integrating multiple query in one form or sheets of paper.
    Please help me in this.
    Thanks
    Sandeep
    Calance
    India

    Hi Sheldon,
    we never have issues when we combine standard objects, like a cliear with a load inforprovider, or the master data integration you mentioned in your document. However, from the moment we combine a script logic with a standard package (like a move) it does not work .The data package contains the task needed for the script and for the move. the process chain is called up but always comes in error in the first step (BPC modify dynamically ) ... there is also no log when checking the view status ...
    I can sent you some screenshots if you like ...
    D

  • Execute Multiple Queries on Screen Load: ADF Swings

    how can i execute multiple queries and populate each query value to corresponding combo box .assume i what to execute 5 different query and populate it into 5 different combo box.
    Prakash

    Hi,
    if you work with ADF then all iterators are accessible through the panelBinding object
    DCIteratorBinding dciter = (DCIteratorBinding) panelBinding.get("Iterator Name");
    dciter.execute();
    If you need to add query parameters like bind parameters then a call to the execute with params method (if available in the binding) could be perfomed as an OperationBinding
    OperatioNBinding oper= (OperatioNBinding ) panelBinding.get("ExecuteWithParams");
    oper.getParamMap().put("bind variable name", <value>);
    oper.execute();
    Frank

  • How to use multiple ipods on one account

    I have an Ipod classic and just bought my sons two nano's how do I use these on the same account without changing my account info?

    Take a look here:
    How to use multiple iPods with one computer
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Discussions page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums, in the User Tips Library and in the Apple Knowledge Base before you post a question.
    Regards.

  • How to print multiple copies on one page ?

    How to print multiple copies of one document on one page ?
    in coreldraw I used to make the document -for example a business card 5x9 - and when sending to print it automatically placed the number of cards that would fit in my A4 sheet.
    how do I make the same operation in Indesign.
    thanks

    Hi, Peter S.
    >I can see that as a shortcut to printing a page of different cards for multiple people, but to do a simple n-up of a single card it seems overly complex to me. What am I missing?
    * It's just an alternative to copy/paste and step/repeat.
    * For a one-time only use, perhaps it's a little more complex than necessary. But for any future needs, only the content of the data file needs to be changed, either by editing, or by pointing to a new data file. If different cards for multiple people becomes necessary, it's ready to go.
    Regards,
    Peter Gold
    KnowHow ProServices

  • How to scan multiple pages in one file

    I would like to know how to scan multiple pages into one file.  There is no add button that comes up.  I have a HP Officejet 8600 and a macbook pro.  Please help, this would really help me out.

    Open Preview and use its "Import From Scanner" option in the File menu. This will launch the scanning interface, which has some standard and basic scanning controls. If you choose "PDF" as the file format to save as, then you will see an option to scan all images to one file. When you do this, you will scan and edit them individually, but Preview will save them to the same file when saved.

  • Moving multiple queries from one category to another in QM

    Hi All,
    Is there is any way of moving multiple queries from one category to another in the query manager?
    Or is the only way of doing it by saving each one individually into a different category.
    Any ideas ?
    Regards,
    Rakesh N

    Hi Rakesh,
    The query manager has limited function compare with normal file management applications. Under current design, you have to do this one by one. You just need to make sure move the smaller amount of queries to large category. Category name can be changed easily.
    Thanks,
    Gordon

  • HT4059 I'm trying to organize my PDFs in iBooks on my ipad2 and I can't figure out how to combine multiple PDFs into one. Any thoughts?

    I'm trying to organize my PDFs in iBooks on my ipad2 and can't figure out how to combine multiple PDFs into one. Any thoughts?

    I'm trying to organize my PDFs in iBooks on my ipad2 and can't figure out how to combine multiple PDFs into one. Any thoughts?

  • Hp printer f4488 HOW TO SCAN MULTIPLE SHEET IN ONE ATTACHMENT

    hp printer f4488 HOW TO SCAN MULTIPLE SHEET IN ONE ATTACHMENT Kindly suggest if any solution are their for above subject..

    Open Preview and use its "Import From Scanner" option in the File menu. This will launch the scanning interface, which has some standard and basic scanning controls. If you choose "PDF" as the file format to save as, then you will see an option to scan all images to one file. When you do this, you will scan and edit them individually, but Preview will save them to the same file when saved.

  • How to execute sql-queries through shell scripting in linux?

    How to execute sql-queries through shell scripting in linux?

    http://www.oracle.com/technology/pub/articles/saternos_scripting.html
    Two simple examples:
    #!/usr/bin/env bash
    set_orafra () {
       orafra=`echo 'set heading off
       select name from v$recovery_file_dest;
       exit' | sqlplus -s / as sysdba`
    set_orafra
    echo $orafra
    #!/usr/bin/env bash
    export ORACLE_SID=instance_name
    export ORACLE_HOME=/path_to_oracle_home_directory
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=/$ORACLE_HOME/bin/$PATH
    $ORACLE_HOME/bin/sqlplus -s <<EOF
    connect scott/tiger@my_instance_name
    INSERT INTO table VALUES (sysdate);
    exit
    EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM

Maybe you are looking for

  • Internal Order Budget Issue

    Hello, I have one of the scenerio related to Internal order My Budget is planned in KO22 as follows. 2012   1000 INR 2013   1500 INR I created PR of Rs 1300 with delivery date as 15.01.2013. Hence after Pr creation the commitment will go and seat in

  • Inventory Transfer Report

    Hi experts,    I want to retrieve data inventory transfer like    Suppose Wh01 And Wh02     I have done inventory transfer from Wh01 to Wh02 And Vice versa for I001     I want in report like for subcontracting inventory transfer..... Regards, Sandy

  • Logic for this requirement

    Hi friends, I get salary from different tables... like for example m_sal and e_sal..if the salary is null in m_sal i have to select salary from e_sal and viceversa can you pls tell me how to do this Thanks

  • NAC best practices

    Hello -- Is there a best practice doc that explains how best to deploy NAC? Also, is it possible to deploy the NAC agent remotely? Please let me know. Thanks, Ohamien

  • Can aperture 2 on 10.4.11 still be used to make a photo book ?

    Hello Clever People ! Can aperture 2 running on 10.4.11 still be used to make a photo book ? If so ... is it also possible to also upload to order via a PC running on XP ? Thank you in advance for your much appreciated help and expertise