Displaying stored procedure

Hello.
This is the first time I've worked with stored procedures. I want to display it to see the sql. Is there a sql command that will allow me to do this in sql*plus ?
Thanks for any help

There isn't a command to do this. The following will do it though - spool it to a file and peruse at you leisure:
SELECT text
FROM user_source
WHERE procedure_name = 'YOUR PROCEDURE'
ORDER BY line ;
null

Similar Messages

  • How to display stored procedure

    what is the command to display stored procedure through sqlplus.

    If you would like to get a view about the parameters of the procedure, just use
    SQL> desc <procedure name>;
    If you would like to see the code for the procedure, then use (assuming you are logged in as the owner of the procedure)
    SQL> SELECT Text FROM User_Source WHERE Name ='PROCEDURENAME' ORDER BY Line;
    Message was edited by:
    Satish Kandi
    @Dave: Sorry I did not see your post.

  • Displaying Stored Procedure (SQL) in Report (INFORMATION_SCHEMA.ROUTINES.ROUTINE_DEFINITION)

    We have processes that call numerous stored procedures.  We are trying to create a SSRS report for our IT department to use so they can easily lookup the stored procedure definition.  Some end users do not have access to SQL Server Management Studio.
    The dataset query uses a System View... INFORMATION_SCHEMA.ROUTINES.  We are joining on the
    ROUTINE_NAME.  When running the SQL, it works perfect.  We are able to get all the columns we need.  The primary column in the INFORMATION_SCHEMA.ROUTINES we need is ROUTINE_DEFINITION (the sql/text of the stored procedure).
    In SSRS, we copy/paste the same SQL into the DataSet query.  When I test the query in the DataSet window (using red
    ! button), it pulls back the data just fine.
    I then drop all the queried columns on the report (see query below).  When I run the report all data is display except the ROUTINE_DEFINITION column.  Why is this?  Is it because it's SQL and SSRS won't display SQL content?  How
    can I get the ROUTINE_DEFINITION column data on the report?
    Here is example query I'm using in the SSRS dataset:
    SELECT SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME,
    ROUTINE_TYPE, CREATED, LAST_ALTERED,
    ROUTINE_DEFINITION
    FROM INFORMATION_SCHEMA.ROUTINES
    WHERE ROUTINE_NAME = @StoredProcedureName
    Andy Kreider | Principal Financial Group | Des Moines, IA, USA

    I have created a new report with the query.  When I run the query, you can see I get results for all columns (as expected).
    I'm using a tablix report and just dropping the columns on the report.  No other editing or customization of the report.  I confirmed (twice) that the Field Name and Field Source are present within the
    Dataset Properties > Fields page. 
    ROUTINE_DEFINITION is list as the Field Name AND Field Source.
    When I run the report through Report Builder, this is what I see...
    As you can see, the ROUTINE_DEFINITION column has no data.  I also ran this same report outside of Report Builder editor by just clicking on the report to open it in a browser window.  Same results... data for all columns except ROUTINE_DEFINITION.
    Seems like this would be something between Report Builder and SQL Server when being displayed.  Or could it be a permissions issue?
    Andy Kreider | Principal Financial Group | Des Moines, IA, USA
    Just out of curiosity did you try using same query on a reporting services report and see if there's any change?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Trap/display stored procedure errors

    Hi,
    We are running oracle DB 11g.
    In oracle forms, if I want to trap an error, I do exception and then do MESSAGE().
    In oracle stored procedure I can do exception but how do I display my formatted message. I am calling the stored procedure from an oracle form.
    Here is the piece of code. If the username or password is wrong oracle throws out 312000 error, I want to trap that and display a user friendly message.
    PROCEDURE LDAP_LOGIN (ldap_host  VARCHAR2,ldap_port VARCHAR2,
                                            ldap_user VARCHAR2, ldap_password VARCHAR2)  IS
    ldap_retval   PLS_INTEGER;
    ldap_session  DBMS_LDAP.session;
    BEGIN
         DBMS_LDAP.USE_EXCEPTION := TRUE;
         --- connect to LDAP server
         ldap_session := DBMS_LDAP.init(hostname => ldap_host,
                                        portnum => ldap_port);
      ldap_retval := DBMS_LDAP.simple_bind_s(ld => ldap_session,
                                             dn => ldap_user,
                                             passwd => ldap_password);
       --- disconnect from the LDAP server
       ldap_retval := DBMS_LDAP.unbind_s(ld => ldap_session);
    EXCEPTION
         WHEN OTHERS THEN
    END;     Thanks
    Munish
    Edited by: Munish on Jan 9, 2013 1:28 PM

    >
    In oracle stored procedure I can do exception but how do I display my formatted message. I am calling the stored procedure from an oracle form.
    Here is the piece of code. If the username or password is wrong oracle throws out 312000 error, I want to trap that and display a user friendly message.
    >
    You use the EXCEPTION_INIT pragm to associate a name with the error number.
    See the PL/SQL Language doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/errors.htm#i1863
    >
    Associating a PL/SQL Exception with a Number (EXCEPTION_INIT Pragma)
    To handle error conditions (typically ORA-n messages) that have no predefined name, you must use the OTHERS handler or the pragma EXCEPTION_INIT. A pragma is a compiler directive that is processed at compile time, not at run time.
    In PL/SQL, the pragma EXCEPTION_INIT tells the compiler to associate an exception name with an Oracle Database error number. That lets you refer to any internal exception by name and to write a specific handler for it. When you see an error stack, or sequence of error messages, the one on top is the one that you can trap and handle.
    You code the pragma EXCEPTION_INIT in the declarative part of a PL/SQL block, subprogram, or package using the following syntax:
    PRAGMA EXCEPTION_INIT(exception_name, -Oracle_error_number);
    where exception_name is the name of a previously declared exception and the number is a negative value corresponding to an ORA-n error. The pragma must appear somewhere after the exception declaration in the same declarative section, as shown in Example 11-4.
    Example 11-4 Using PRAGMA EXCEPTION_INIT
    DECLARE
    deadlock_detected EXCEPTION;
    PRAGMA EXCEPTION_INIT(deadlock_detected, -60);
    BEGIN
    NULL; -- Some operation that causes an ORA-00060 error
    EXCEPTION
    WHEN deadlock_detected THEN
    NULL; -- handle the error
    END;

  • How to display stored procedure results in SJSC table?

    I have been able to create a cached rowset and debug/watch the results, but do not understand how to transfer those results to a Table component. Can anyone point me in the right direction?
    Details:
    In SessionBean1.java, I declared the stored procedure and rowset along with get/set and update procedures:
    // SLS trying stored procedure 20060412
        private java.sql.CallableStatement spFXRatesStatement; 
        private CachedRowSetXImpl spFXRatesRowSet = new CachedRowSetXImpl();
        public CachedRowSetXImpl getSpFXRatesRowSet() {
            return spFXRatesRowSet;
        public void setSpFXRatesRowSet(CachedRowSetXImpl crsxi) {
            this.spFXRatesRowSet = crsxi;
        public void updateSpFXRatesRowSet(String inDate, String inCcy) {
            try {
                spFXRatesStatement.setString(1, inDate);
                spFXRatesStatement.setString(2, inCcy);
                spFXRatesRowSet.populate(spFXRatesStatement.executeQuery(), 1);
            catch (Exception e) {
                // TODO - write exception code
    // SLS trying stored procedure 20060412I then �prepared� the stored procedure within SessionBean1�s init() procedure:
    // SLS trying a stored proc 20060412
            try {
                javax.naming.Context ctx = new javax.naming.InitialContext();
                javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup("java:comp/env/jdbc/bmo_fp");
                java.sql.Connection conn = ds.getConnection();
                // spGetFXRates
                spFXRatesStatement = conn.prepareCall("{call GetFXRates(?, ?)}",
                        java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY);          
               // next sp...
                // clean up
                ctx.close();
                conn.close();
            catch (Exception e) {
                // TODO - add exception code
    // SLS 20060412 I can see the results in a web page procedure with a �getSessionBean1().getSpFXRatesRowSet().getString(i)� watch.
    try {
                getSessionBean1().updateSpFXRatesRowSet("9/30/2005","EUR");
                getSessionBean1().getSpFXRatesRowSet().first();
                while (getSessionBean1().getSpFXRatesRowSet().isLast() != true) {
                    getSessionBean1().getSpFXRatesRowSet().next();
            catch (Exception e) {
                // TODO - specify error detail
            }Now, how do I transfer these results to a table?

    I think you have to add a CachedRowSetDataProvider to you page been.
    Then initalize it with your getSpFXRatesRowSet() in the init() method.
    Then link you table to the CachedRowSetDataProvider.

  • Displaying message text from a stored procedure.

    Within my stored procedures I am using DBMS_OUTPUT.PUT_LINE to output messages (error/warning/info/debug) but they are not displayed until the procedure has finnished. There is also the problem in that the amount of storage space for these message is limited (exceeding this limit can cause an OK procedure run to terminate with an error :( ).
    Is there a better way that results in the 'displays' being made visible immediately?

    dbms_output.put_line is not interactive and the message is limited to 1000000 the max size. you can write your own code as workaround such that capturing the message by inserting it into another log table.

  • How to display Error Message in APEX from Database Stored Procedure

    Hello,
    Using APEX version 3.2
    DB version 9.2.0.8.0
    Internet Explorer version 6
    I have an After Submit Page Process that calls a stored procedure. In the exception section I'm using dbms_output.putline to display an error message, but the error message is not displayed in APEX. How can I have the error message generated from the stored procedure display in APEX?
    Thanks so much.

    Hi Apex_Noob,
    I created On Load - Before Header process that uses apex_application.g_notification := :P3_ROLE;I'm sorry but I'm not sure what you mean by "instead of using dbms_output.putline use :P1_ITEM"
    I have the following code in my stored procedure
    EXCEPTION
         WHEN OTHERS THEN
         dbms_output.put_line('Role does not exist');Thanks.

  • Stored Procedure for displaying data in Crystal Reports

    Hi I am new to Oracle & Crystal Reports,so can any one please give me sample stored procedure to display data in Crystal report from Oracle by passing rwo input values.

    from site:-
    Crystal Reports will only support the return of a single refcursor from Oracle. Even the latest and greatest version 10 doesn't allow you to return more than one recordset at a time. You could add one more step to your procedure that would join up the output of the multiple refcursors into a PL/SQL table and then fetch the result set out through a single refcursor. That way you are using temporary space that will be cleaned up as soon as the connection is terminated and will only be returning a single refcursor

  • Error message display for me"invalid colmun " when i implement stored procedure

    Hi guys
    in this stored procedure below i have proplem in colmun in sex type i have two values Male and female
    but when i search by this colmun from interface it give me invalid colmun why
    this is my stored procedure
    Create Procedure sp_Employee
        @EmployeeID       NVARCHAR(50),
        @EmployeeName     NVarchar(100),
        @SexType          Nvarchar(50)
    AS
    Declare @SQLQuery as nvarchar(2000)
    SET @SQLQuery ='SELECT * from ViewEmpTEST Where (1=1)'
     If @EmployeeID <>''
             Set @SQLQuery = @SQLQuery + 'And (EmployeeID = '+ @EmployeeID+') '
    If @EmplyeeName  <>''
             Set @SQLQuery = @SQLQuery + ' AND (EmplyeeName  LIKE
    N''%'+@EmplyeeName +'%'') '
    If @SexType <>''
              Set @SQLQuery = @SQLQuery + 'And (SexType = '+ @SexType+') '
    Exec (@SQLQuery)
    and this is my view ViewEmpTEST
    SELECT     CONVERT(varchar, dbo.Employee.DriverID) AS EmployeeID, dbo.Employee.EmplyeeName, dbo.Employee.DriverName,
                          dbo.Nationality.NationalityName, dbo.Employee.ResidentNo, dbo.Country.CountryName, dbo.Branch.BranchName, dbo.Employee.ResignDate,
                          dbo.Employee.HealthCarNo, dbo.Jobs.JobName, dbo.Department.DepartmentName, dbo.Employee.PlaceIssue, dbo.Employee.Deduction,
                          dbo.Employee.ExpireDateMedical, dbo.Employee.PolicyNumber, dbo.Employee.ExpireDateResident, dbo.Miritial.MiritualStatus,
                          dbo.Status.StatusType, dbo.Sex.SexType, dbo.Employee.UnactiveReason, CONVERT(varchar, dbo.Employee.BirthDate, 103) AS BirthDate,
                          CONVERT(varchar, dbo.Employee.DateToday, 103) AS DateToday, dbo.Employee.UserID, dbo.Employee.PassportNo, dbo.Employee.Bonus,
                          dbo.Employee.AccountType, dbo.Employee.PlaceOfBirth, dbo.Employee.ExpireDateresidentHijri, CONVERT(varchar, dbo.Employee.PassportDateStart,
                          103) AS PassportDateStart, dbo.Employee.PassportDateExpire, dbo.Employee.EntryNo, dbo.Employee.PlacePassport, CONVERT(varchar,
                          dbo.Employee.Salary) AS Salary, dbo.Employee.AccountNo, dbo.Religon.ReligonName, dbo.Employee.Mobile, dbo.Employee.Email,
                          CONVERT(varchar, dbo.Employee.SexID, 103) AS SexID, CONVERT(VARCHAR, dbo.Employee.StatusID, 103) AS StatusID, dbo.Employee.JoinDate,
                          dbo.Employee.JobDetailes, dbo.BloodType.BloodType, dbo.Class.ClassName, dbo.Employee.OccupationID, dbo.Ocuppation.OcuppationName
    FROM         dbo.Employee LEFT OUTER JOIN
                          dbo.Ocuppation ON dbo.Ocuppation.OccupationID = dbo.Employee.OccupationID LEFT OUTER JOIN
                          dbo.BloodType ON dbo.BloodType.BloodID = dbo.Employee.BloodID LEFT OUTER JOIN
                          dbo.Class ON dbo.Class.ClassID = dbo.Employee.ClassID LEFT OUTER JOIN
                          dbo.Department INNER JOIN
                          dbo.Jobs ON dbo.Department.DepartmentID = dbo.Jobs.DepartmentID ON dbo.Employee.JobID = dbo.Jobs.JobID LEFT OUTER JOIN
                          dbo.Miritial ON dbo.Miritial.MiritialID = dbo.Employee.MiritialID LEFT OUTER JOIN
                          dbo.Branch ON dbo.Branch.BranchID = dbo.Employee.BranchID LEFT OUTER JOIN
                          dbo.Status ON dbo.Status.StatusID = dbo.Employee.StatusID LEFT OUTER JOIN
                          dbo.Sex ON dbo.Sex.SexID = dbo.Employee.SexID LEFT OUTER JOIN
                          dbo.Religon ON dbo.Religon.ReligonID = dbo.Employee.ReligonID LEFT OUTER JOIN
                          dbo.Country ON dbo.Country.CountryID = dbo.Employee.CountryID LEFT OUTER JOIN
                          dbo.Nationality ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID
    WHERE     (dbo.Nationality.NationalityID IS NULL) OR
                          (dbo.Nationality.NationalityID IS NOT NULL) OR
                          (dbo.Country.CountryID IS NULL) OR
                          (dbo.Country.CountryID IS NOT NULL) OR
                          (dbo.Jobs.JobID IS NULL) OR
                          (dbo.Jobs.JobID IS NOT NULL) OR
                          (dbo.Miritial.MiritialID IS NULL) OR
                          (dbo.Miritial.MiritialID IS NOT NULL) OR
                          (dbo.Branch.BranchID IS NULL) OR
                          (dbo.Branch.BranchID IS NOT NULL) OR
                          (dbo.Status.StatusID IS NULL) OR
                          (dbo.Status.StatusID IS NOT NULL) OR
                          (dbo.Sex.SexID IS NULL) OR
                          (dbo.Sex.SexID IS NOT NULL) OR
                          (dbo.Class.ClassID IS NULL) OR
                          (dbo.Class.ClassID IS NOT NULL) OR
                          (dbo.Ocuppation.OccupationID IS NULL) OR
                          (dbo.Ocuppation.OccupationID IS NOT NULL) OR
                          (dbo.BloodType.BloodID IS NULL) OR
                          (dbo.BloodType.BloodID IS NOT NULL)
    what is the proplem in statment sextype in stored procedure

    Start over - completely.  The tsql for your view is poorly written. 
    One does not have a sex, one has a GENDER. 
    I can understand a conversion of datatype like "CONVERT(varchar, dbo.Employee.DateToday, 103) AS DateToday", but not "CONVERT(varchar, dbo.Employee.SexID, 103) " - style 103 is for datetime datatypes and the column name SexID does not
    remotely imply that datatype. 
    Similarly, stop being so lazy and specify the length of your converted varchar column rather than allowing it to default to some length.  And if you are going to convert to varchar, shouldn't you be converting to nvarchar given that your procedure
    arguments are nvarchar?  Consistency will only help your code stability and correctness.
    To continue with the datetime to varchar conversion, is this an attempt to simply strip the time component from a column that is datetime?  If so, simply convert it to date and avoid any possibility of error due to interpretation assumptions with the
    converted string and its format.
    Lastly, do you really need all of those outer joins?  I find it difficult to believe that an employee does not have a required relationship with a majority of those tables.
    As for your problem, please post the complete and entire error message - exactly as displayed.  Presumably you have performed a basic test of your view and verified that it still works (i.e., nothing was changed about the tables involved in the view
    after the view was created).  Something like "select top 1 * from dbo.ViewEmpTEST where SexType = 'x';" should execute successfully and return an empty resultset. 
    And, of course, the SexType column is (presumably) nvarchar, so you will need to enclose the value you are searching for in your dynamic sql with single quotes.  If you intend to provide dynamic searching functionality, you will need to learn to code
    it and debug it yourself.  The others have already indicated that this approach is a security-risk.  At the very least, you should capture the string that you are attempting to execute and visually examine it yourself when you discover that
    it does not work.  It will then become obvious (assuming the code you currently have posted is what you are using) that the error is your inclusion of the SexType argument in the string:
    select ... where ... And (SexType = male)

  • How to display error message raised by stored procedure in ADF Faces ?

    Hi all,
    From my jspx page, I call a stored procedure wrapped by a custom service method in apps module.
    Based on certain condition in the stored procedure, e.g : NO DATA FOUND EXCEPTION, I raised a custom error from the stored procedure :
    RAISE_APPLICATION_ERROR(-20001, 'ERROR : No Data Tobe Processed !') ;
    The question is : How to display that error nicely in the jspx page ?
    Below is my backing beans code to call the stored procedure :
    public String okButton1_action() {
    try {
    SalesAM service =
    (SalesAM)JSFUtils.resolveExpression("#{data.SalesAMDataControl.dataProvider}");
    createdInvoices = service.processInvoice(
         soFr.getValue().toString().toUpperCase(),
         soTo.getValue().toString().toUpperCase(), .....     
    currDateTime, "O") ;
    } catch (JboException e) {
    System.out.println("There is error raised by stored proc..!");
    System.out.println(e.toString());
    Thank you for your help,
    xtanto

    You can add a message to the page in the following way:
    FacesMessage mess = new FacesMessage(FacesMessage.SEVERITY_ERROR, "title", e.getMessage());
    FacesContext.getCurrentInstance().addMessage(null, mess);

  • Stored procedure to export result to excel header not displayed

    Hi,
    I am using below stored procedure to export data to excel with header. but it is not displaying the header . i believe this is because the max length of query can be 8000. but  I have more than 250 columns so probably the length of query is breaking
    the code.
    can someone please help here.
    Thanks in advance.
    ALTER procedure [dbo].[proc_generate_excel_with_columns]
    @table_name varchar(100),
    @file_name varchar(100)
    as
    --Generate column names as a recordset
    declare @columns varchar(8000), @sql varchar(8000), @data_file varchar(100)
    select
    @columns=coalesce(@columns+',','')+column_name+' as '+column_name
    from
    information_schema.columns
    where
    table_name=@table_name
    select @columns=''''+replace(replace(@columns,' as ',''' as '),',',',''')
    --Create a dummy file to have actual data
    select @data_file=substring(@file_name,1,len(@file_name)-charindex('\',reverse(@file_name)))+'\data_file.csv'
    --Generate column names in the passed EXCEL file
    set @sql='bcp "select * from (select ' + @columns + ') as header" queryout E:\test.csv -c -t, -T -S ' + @@servername
    exec master..xp_cmdshell @sql
    --Generate data in the dummy file
    set @sql='bcp "select * from CustomerTable where ReservationDate>''1/1/2013''" queryout E:\data_file.csv -c -t, -T -S' + @@servername
    exec master..xp_cmdshell @sql
    --Copy dummy file to passed EXCEL file
    set @sql= 'exec master..xp_cmdshell ''type '+@data_file+' >> "'+@file_name+'"'''
    exec(@sql)
    ----Delete dummy file
    set @sql= 'exec master..xp_cmdshell ''del '+@data_file+''''
    exec(@sql)
    --EXEC proc_generate_excel_with_columns 'CustomerTable','E:\test.csv'

    Can you try to print the @columns?
    In the same procedure can you change size of @columns to varchar(max) and try executing the procedure?
    ALTER procedure [dbo].[proc_generate_excel_with_columns]
    @table_name varchar(100),
    @file_name varchar(100)
    as
    --Generate column names as a recordset
    declare @columns varchar(max), @sql varchar(max), @data_file varchar(100)
    select
    @columns=coalesce(@columns+',','')+column_name+' as '+column_name
    from
    information_schema.columns
    where
    table_name=@table_name
    select @columns=''''+replace(replace(@columns,' as ',''' as '),',',',''')
    print @Columns
    --Create a dummy file to have actual data
    select @data_file=substring(@file_name,1,len(@file_name)-charindex('\',reverse(@file_name)))+'\data_file.csv'
    --Generate column names in the passed EXCEL file
    set @sql='bcp "select * from (select ' + @columns + ') as header" queryout E:\test.csv -c -t, -T -S ' + @@servername
    exec master..xp_cmdshell @sql
    --Generate data in the dummy file
    set @sql='bcp "select * from CustomerTable where ReservationDate>''1/1/2013''" queryout E:\data_file.csv -c -t, -T -S' + @@servername
    exec master..xp_cmdshell @sql
    --Copy dummy file to passed EXCEL file
    set @sql= 'exec master..xp_cmdshell ''type '+@data_file+' >> "'+@file_name+'"'''
    exec(@sql)
    ----Delete dummy file
    set @sql= 'exec master..xp_cmdshell ''del '+@data_file+''''
    exec(@sql)
    --EXEC proc_generate_excel_with_columns 'CustomerTable','E:\test.csv'
    --Prashanth

  • Display error messages from Stored Procedures through ODBC

    I am working on a C++ application that uses an Oracle ODBC connection. In the exception part of a stored procedure I am using dbms_output.put_line ('error message'). Is there any way to display this message in the C++ application?
    Thanks.

    There are two parts.
    The stored proc must 'throw' an exception.
    And java must catch it.
    You probably already have the java part. That is the catch(SQLException).
    As for the stored proc you can use the following search string in the jdbc forum
    raise oracle
    You need to use 'raise' in the stored proc but I am not sure of the exact form, but one of the threads using the above search string is likely to have it.

  • Displaying data from stored procedure into textbox fields based on user input.

    I have a stored procedure that is selecting data from a table called "Vendor" in my database.  The data that is being returned are vendor names, vendor addresses, vendor Id's, etc...In my stored proc, I have one parameter that allows
    the user to enter a vendor name and then return all the data for that specific vendor.  The report that I'm building is going to look like a basic form with a bunch of textboxes on the screen labeled Vendor Address, Vendor Id, Vendor City, Vendor State,
    etc...In the report I'm trying to build, the user will enter in a vendor name and then it will return all of the vendor's data based on what the user searches for.  However, the report will only return ONE vendor's data at a time. 
    The problem is that some of the data in the database has very similiar vendor names, but different vendor addresses, vendor Id's, etc...In some instances the vendor name is actually
    exactly the same, but the vendor address, vendor city, vendor Id, is all different.  So what I did was added another parameter in my report that shows a drop down list of vendor names based on the wildcard search the user just did and
    allows the user to select the exact vendor name that he/she is looking for based on what they searched.  The problem I'm having is that I don't know what expression I need to put in each one of my textboxes to retrieve the correct data from
    the vendor table that the user selects from the drop down list.  So what I want to do is return the exact data from the vendor table based on the selection that the user makes from that drop down list.  It's like I somehow have to compare the
    drop down list parameter directly to the dataset but I don't know what expression needs to go in the textbox.  I've tried...=First(Fields!VendorName.Value, "DataSet1").EqualsParameters!DropDownList.Value(0) but I keep getting an error message.
    --Here is an example of the kind of thing the user might search for...when the user searches the word "sprint" it returns three different vendor names to the drop down list.
    1. sprint
    2. sprint
    3. sprint co
    Each one of those three vendor names has a different vendor address, vendor city, vendor ID, etc...but the vendor names are extremely similar and in some cases
    exactly the same. In my report now I can't get the textboxes to return the correct data based on what the user selects.  Any advice at all is greatly appreciated.
    P.S. I didn't even know what SQL Server was a month ago and had zero knowledge of SSRS at all.  I've learned a lot recently, but if you could explain a solution in the easiest way possible I would appreciate it. Thanks!

    Hi Jrcowles,
    If I understand you correctly, you wnat to list all the Vendor Name which like the user typed Vendor Name on a drop-down list, right? If in this case, we can use a cascading parameters to achieve your requirement. I have tested it on my local environment,
    the steps below are for you reference.
    Create an other stored procedure using the query below.
    CREATE PROCEDURE GetVendorName
    @VendorName NVARCHAR(50)
    AS BEGIN
    exec( 'SELECT * FROM Vendor WHERE VendorName LIKE ''%'+@VendorName+'%''')
    END
    Create another dataset DataSet2 and using the new created procedure.
    Create another parameter VendorName2 and check "Allow Multiple Values" for this parameter.
    On the Available Values tab, check "Get values from a query". Select corresponding dataset and field.
    On the Default Values tab, check "Get values from a query". Select corresponding dataset and field.
    The screenshots below are for you reference.
    Reference
    http://technet.microsoft.com/en-us/library/aa337169(v=sql.100).aspx
    http://www.msbiguide.com/2012/02/adding-cascading-parameters-to-ssrs-reports/
    Regards,
    Charlie Liao
    TechNet Community Support

  • Display select in a stored procedure

    Hello,
    I have a select statement that I wanna print in a stored procedure. The only way is to create a cursor in the SP, which holds the result of the select, and then iterate through the lines and print each line using dbms_output.put_line?
    Thanks.

    You can pass a ref cursor as an output parameter and print that.
    SQL> create or replace procedure p (p_c out sys_refcursor) as
      2  begin
      3    open p_c for
      4      with test_data as
      5      (
      6      select 1 n, 'a' s from dual union all
      7      select 2 n, 'b' s from dual union all
      8      select 5 n, 'x' s from dual
      9      )
    10      select n, s from test_data;
    11  end;
    12  /
    Procedure created.
    SQL> var c refcursor
    SQL> exec p(:c)
    PL/SQL procedure successfully completed.
    SQL> print c
             N S
             1 a
             2 b
             5 x

  • How to view the returned data from a stored procedure in TOAD?

    Hi,
    I created ref cursor in the stored procedure to return data. The stored procedure works fine, just want to view the result in TOAD. The BEGIN... EXEC... END can execute the stored procedure, but how to make the result display?
    Thanks!

    Right click the editor and choose
    "Prompt For Substitution Variables".
    Run for example the following code:
    DECLARE
    PROCEDURE p (cur OUT sys_refcursor)
    AS
    BEGIN
    OPEN cur FOR
    SELECT *
    FROM DUAL;
    END p;
    BEGIN
    p (:cur);
    END;
    The result will display in Toad's Data Grid!
    Regards Michael

Maybe you are looking for

  • HIS and AD hoc REPORTS in ABAP-HR

    hi all, can any body explain abt ad hoc and his reports? what is the use of these reports?

  • Every time i change though media or from i-product back to library I have to research the group that is playing, is there a way to fix this?

    Hi guys, The new itunes changed totally and this mostly brings some changes what is more than normal. But the thing i liked with the previous versions was: - You choose a group out the sidecolum and an album and then the song - You change from media

  • Octapad muting ultrabeat in logic

    My octapad II is not triggering sounds in ultrabeat. I see the notes. The drums are assigned correctly , but instead of playing the sound it mutes the drum. Any ideas? Thanks in advance.

  • How to - WAD chart type

    Hi, I would like to know how I can create this kind of application using WAD drop down list I would like to create a drop down list displaying the different chart types so that when I select the chart that I want it updates . I can achieve this with

  • RoboHelp 7 User Dictionary?

    Our department has just upgraded from RoboHelp 5 to Robohelp HTML 7 (as part of the Technical Communication Suite), and I'm trying to find a way to bring my old version 5 user dictionary into RoboHelp 7. There doesn't seem to be any way to select a u