PL/SQL STORED PROC..ERROR

can some let me know where i am going wrong...it gives compile warning.
I am trying to check if EMP_ID,CHK_DGT,PIN_NBR EXISITS IN EMPLOYER..If it exists i want to insert USER_EMAIL,PASSWORD,FIRSTNAME, LASTNAME...ETC INTO EMP_GATE_USERS TABLE..
THANKS
CREATE OR REPLACE PROCEDURE Sp_Insert_Emp_Gate_User118
p_EMP_ID     IN EMPLOYER.EMP_ID%TYPE,
p_CHK_DGT IN EMPLOYER.CHK_DGT%TYPE,
p_PIN_NBR IN EMPLOYER.PIN_NBR%TYPE,
p_USER_EMAIL IN EMP_GATE_USERS.USER_EMAIL%TYPE ,
p_USERPASSWORD IN EMP_GATE_USERS.USERPASSWORD%TYPE ,
p_FIRSTNAME IN EMP_GATE_USERS.FIRSTNAME%TYPE,
p_MIDDLEINITIALS IN EMP_GATE_USERS.MIDDLEINITIALS%TYPE,
p_LASTNAME IN EMP_GATE_USERS.LASTNAME%TYPE,
p_COMPANYNAME IN EMP_GATE_USERS.COMPANYNAME%TYPE,
p_ADDRESSLINE1 IN EMP_GATE_USERS.ADDRESSLINE1%TYPE,
p_ADDRESSLINE2 IN EMP_GATE_USERS.ADDRESSLINE2%TYPE,
p_CITY IN EMP_GATE_USERS.CITY%TYPE,
p_ZIP IN EMP_GATE_USERS.ZIP%TYPE,
p_PHONENUMBER IN EMP_GATE_USERS.PHONENUMBER%TYPE,
p_FAXNUMBER IN EMP_GATE_USERS.FAXNUMBER%TYPE,
p_SECURITYQUESTION IN EMP_GATE_USERS.SECURITYQUESTION%TYPE,
p_SECURITYANSWER IN EMP_GATE_USERS.SECURITYANSWER%TYPE,
cnumber OUT NUMBER
AS
BEGIN
WHERE EXISTS
SELECT NULL
FROM EMPLOYER
WHERE EMP_ID = p_EMP_ID AND CHK_DGT = p_CHK_DGT
AND PIN_NBR = p_PIN_NBR
INSERT INTO EMP_GATE_USERS
USER_EMAIL ,
USERPASSWORD ,
FIRSTNAME ,
MIDDLEINITIALS ,
LASTNAME ,
COMPANYNAME ,
ADDRESSLINE1 ,
ADDRESSLINE2 ,
CITY ,
ZIP ,
PHONENUMBER ,
FAXNUMBER ,
SECURITYQUESTION ,
SECURITYANSWER
VALUES(
p_USER_EMAIL,
p_USERPASSWORD,
p_FIRSTNAME,
p_MIDDLEINITIALS,
p_LASTNAME,
p_COMPANYNAME ,
p_ADDRESSLINE1,
p_ADDRESSLINE2 ,
p_CITY ,
p_ZIP ,
p_PHONENUMBER ,
p_FAXNUMBER ,
p_SECURITYQUESTION,
p_SECURITYANSWER
ELSE
cnumber := 9999;
END ;
COMMIT;
END Sp_Insert_Emp_Gate_User118;

user12358263 wrote:
can some let me know where i am going wrong...it gives compile warning.There is absolutely no need for SP.It can be done by simple INSERT. Anyway, SP:
CREATE OR REPLACE PROCEDURE Sp_Insert_Emp_Gate_User118
p_EMP_ID IN EMPLOYER.EMP_ID%TYPE,
p_CHK_DGT IN EMPLOYER.CHK_DGT%TYPE,
p_PIN_NBR IN EMPLOYER.PIN_NBR%TYPE,
p_USER_EMAIL IN EMP_GATE_USERS.USER_EMAIL%TYPE ,
p_USERPASSWORD IN EMP_GATE_USERS.USERPASSWORD%TYPE ,
p_FIRSTNAME IN EMP_GATE_USERS.FIRSTNAME%TYPE,
p_MIDDLEINITIALS IN EMP_GATE_USERS.MIDDLEINITIALS%TYPE,
p_LASTNAME IN EMP_GATE_USERS.LASTNAME%TYPE,
p_COMPANYNAME IN EMP_GATE_USERS.COMPANYNAME%TYPE,
p_ADDRESSLINE1 IN EMP_GATE_USERS.ADDRESSLINE1%TYPE,
p_ADDRESSLINE2 IN EMP_GATE_USERS.ADDRESSLINE2%TYPE,
p_CITY IN EMP_GATE_USERS.CITY%TYPE,
p_ZIP IN EMP_GATE_USERS.ZIP%TYPE,
p_PHONENUMBER IN EMP_GATE_USERS.PHONENUMBER%TYPE,
p_FAXNUMBER IN EMP_GATE_USERS.FAXNUMBER%TYPE,
p_SECURITYQUESTION IN EMP_GATE_USERS.SECURITYQUESTION%TYPE,
p_SECURITYANSWER IN EMP_GATE_USERS.SECURITYANSWER%TYPE,
cnumber OUT NUMBER
AS
BEGIN
INSERT INTO EMP_GATE_USERS
USER_EMAIL ,
USERPASSWORD ,
FIRSTNAME ,
MIDDLEINITIALS ,
LASTNAME ,
COMPANYNAME ,
ADDRESSLINE1 ,
ADDRESSLINE2 ,
CITY ,
ZIP ,
PHONENUMBER ,
FAXNUMBER ,
SECURITYQUESTION ,
SECURITYANSWER
SELECT
p_USER_EMAIL,
p_USERPASSWORD,
p_FIRSTNAME,
p_MIDDLEINITIALS,
p_LASTNAME,
p_COMPANYNAME ,
p_ADDRESSLINE1,
p_ADDRESSLINE2 ,
p_CITY ,
p_ZIP ,
p_PHONENUMBER ,
p_FAXNUMBER ,
p_SECURITYQUESTION,
p_SECURITYANSWER
FROM EMPLOYER
WHERE EMP_ID = p_EMP_ID AND CHK_DGT = p_CHK_DGT
AND PIN_NBR = p_PIN_NBR;
IF SQL%ROWCOUNT = 0
THEN
cnumber := 9999;
END ;
COMMIT;
END Sp_Insert_Emp_Gate_User118;SY.
P.S. It is a bad practice to commit/rollback in SP.

Similar Messages

  • Item Type Based on PL/SQL stored proc causing errors

    I am getting the following error when I add this item type based on a pl/sql stored proc that generates html based on the stored proc... the stored proc returns find but the other porlets get Error Message in there headers and in the porlet content I get:
    Error: The listener returned the following Message: 503 Service Unavailable....
    I also get the same error if I click on a link that is generated from my stored proc for the entire page I get the error:
    Error: The listener returned the following Message: 503 Service Unavailable
    and get nothing else returned...

    Greetings
    I suggest you take a look at the following page and have a look on how to create portlets. Since the PL/SQL PDK allows you to create your own portlets inside the Oracle Database there should be no problem for creating the content inside a portlet the way you want it.
    http://www.oracle.com/technology/products/ias/portal/pdk.html
    Best regards
    Johan

  • Cf caching ms sql stored procs,

    I'm having trouble with Cf caching ms sql stored procs,
    eg in this one:
      <cfstoredproc  procedure="getUser"   datasource="#datasource#" returncode="true">
          <cfprocparam type="in"  cfsqltype="CF_SQL_VARCHAR" value="#results.SAMAccountName[1]#">
          <cfprocresult name="sp">
        </cfstoredproc>
    I get the same 4 columns returned no matter what the actual sp is in the server.
    any ideas?

    Sorry, I'm not suggesting any corelation between a <cfquery> with a SELECT * in it and suggesting your proc had SELECT * in it.  Just perhaps that whatever mechanism in CF or the JDBC drivers that caches the expected columns from a SELECT * query might also cache them from a PROC call.  There's a loose parallel in that neither actually specify the expected column names, that's all I meant.
    Can you do me a favour? Can you do something like <cfquery datasource="yourDsn">THIS AIN'T VALID SQL</cfquery> and then re-run your proc.  Does that sort it out?  I seem to recall - and now I feel like I'm wasting your time a bit, because I'm really unsure of this - that if one caused an error over the JDBC connection, it cleared itself out and subsequent queries worked fine.  It might work the same for procs.  I'm not suggesting this as a solution: just more info gathering.  This is presupposing it is kinda related to the SELECT * issue.
    I'll try to do some experimentation when I get home tonight, but I've got some docs to write and stuff so not sure whether I'll get to it.
    Adam

  • Can we call a Java Stored Proc from a PL/SQL stored Proc?

    Hello!
    Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
    If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
    Thank you!

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' &#0124; &#0124; good_ids &#0124; &#0124; ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • BPEL process to Insert XML into DB using pl/sql stored proc

    Hi,
    We have created a BPEL process in which we are taking input request and store it into Oracle Database using PL/SQL proc.
    We have been unsuccessful in doing so because the data stored in table has root element missing.
    Has any body done this (insert xml into DB using pl/sql stored proc) successfully ?
    We can so this successfully if we do not use stored procedure and store data directly in table.
    Regards

    I have done this, stored it as a CLOB.
    Also I received the payload as an opaque schema, so I had to convert the message from binary into string.
    This way the root element doesn't get removed.
    cheers
    James

  • URGENT!! Generating XML in a PL/SQL stored proc

    Hi,
    I need to generate XML from a PL/SQL stored proc.
    I need to do it in Oracle 7.3.4 as well as 8.1.6 databases.
    I need to have my own defined tags in the xml.
    Say I have the table Person like
    Person (
    id number,
    fname varchar2(40),
    lname varchar2(40)
    I need a stored proc will will select * from Person and output the data in XML form as
    <Person Names>
    <Employee>
    <First Name personid="<<value from id field>>">
    <<value from fname field>>
    </First Name>
    <Last Name>
    << value from lname field>>
    </Last Name>
    </Employee>
    </Person Names>
    I want to minimise hard coding also.
    how can I do this ? any pointers ?
    Thanks in advance, Hari
    null

    Hi,
    We are not having a Web Agent here. So i am unable to use PLSXML utility.
    I installed XSU and is now able to create the XML, but with the table attribute names as the tags. So
    1. Is there a way I can transform this XML to another XML with custom tags ( using an XSL ) in a PL/SQL procedure ?
    2. Is there a way I can install and use PLSXML without the web agent ?
    Thanks, Hari

  • Arrays to pl/sql stored proc.

    How can I send a java array
    to a pl/sql stored proc.
    I've understood that I have to something like this
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor(<sql_type_name>, conn);
    ARRAY newArray = new ARRAY(desc, conn, java_array);
    But what do I use as sql_type_name ?
    /guha
    null

    I trust you have tried using java.sql.array datatype. This is the SQL3 datatype supported by the 8.1.6 drivers.
    You would find detailed pointers at http://technet.oracle.com/tech/java/jroadmap/jdbc/listing.htm
    Narayan.
    null

  • Save prompted sql stored proc parm values in rpt file from designer

    How can I save the last prompted sql stored proc parameter values from within the CR designer.  In other words I want to hard code some of the parameter values (the rest are passed) so that CR does not prompt at run time.  I am running CR Developer XI R2 SP1 from within VS.Net 2005 (Winforms)

    Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • JDBC receiver adapter with multiple stored procs error

    Hi all,
      I am doing a scenario IDOC-XI-JDBC. The destination system in MS SQL server 2000. I am passing variant config information to update the destination tables by triggering the same stored procedure multiple times with different parameters.
      Everything is correct, but JDBC adapter is giving me the following error
    Unable to execute statement for table or stored procedure. 'mk_EditAllowedLowerSpineImprintingOptions_proc' (Structure 'CallProc') due to java.lang.IllegalArgumentException
    My payload looks like this. This is just a partial payload, the blocks of CallProc continue till the CallsRemaining number reaches zero(0).
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_UPDATEPERSONAVARIANTS xmlns:ns0="urn:sd:sales:sapvarianttablestopersona">
    - <CallProc>
    - <Update_Persona_Variants action="EXECUTE">
      <table>mk_EditAllowedLowerSpineImprintingOptions_proc</table>
      <AlbumType type="CHAR">7SPEC</AlbumType>
      <UpperSpineImprintingOption type="CHAR">UST</UpperSpineImprintingOption>
      <LowerSpineImprintingOption type="CHAR">NOL</LowerSpineImprintingOption>
      <EffectiveDate type="DATE">20040503</EffectiveDate>
      <CallsRemaining type="INTEGER">27</CallsRemaining>
      </Update_Persona_Variants>
      </CallProc>
    - <CallProc>
    - <Update_Persona_Variants action="EXECUTE">
      <table>mk_EditAllowedLowerSpineImprintingOptions_proc</table>
      <AlbumType type="CHAR">7SENT</AlbumType>
      <UpperSpineImprintingOption type="CHAR">UST</UpperSpineImprintingOption>
      <LowerSpineImprintingOption type="CHAR">LSP</LowerSpineImprintingOption>
      <EffectiveDate type="DATE">20040503</EffectiveDate>
      <CallsRemaining type="INTEGER">26</CallsRemaining>
      </Update_Persona_Variants>
      </CallProc>
    - <CallProc>
    - <Update_Persona_Variants action="EXECUTE">
      <table>mk_EditAllowedLowerSpineImprintingOptions_proc</table>
      <AlbumType type="CHAR">7SPEC</AlbumType>
      <UpperSpineImprintingOption type="CHAR">UST</UpperSpineImprintingOption>
      <LowerSpineImprintingOption type="CHAR">LSP</LowerSpineImprintingOption>
      <EffectiveDate type="DATE">20040503</EffectiveDate>
      <CallsRemaining type="INTEGER">25</CallsRemaining>
      </Update_Persona_Variants>
      </CallProc>
    ......CallProc blocks continue till CallRemaining reaches zero.
    I also tried making CallProc element appear just once in XML and repeating <Update_Persona_Variants> blocks like below
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_UPDATEPERSONAVARIANTS xmlns:ns0="urn:sd:sales:sapvarianttablestopersona">
    - <CallProc>
    - <Update_Persona_Variants action="EXECUTE">
    </Update_Persona_Variants>
    <Update_Persona_Variants action="EXECUTE">
    </Update_Persona_Variants>
    </CallProc>
    </ns0:MT_UPDATEPERSONAVARIANTS >
    but still i get the same error.
    Can anyone guide me what is wrong.

    Well,
      The problem was with the way date was passed to the stored procedure, i just needed to format the date to yyyy-mm-dd and the error was solved. The error given by the JDBC adapter was not correct. I tried using logSQLStatement additional parameter, but for stored procedures it does not give out the actual SQL statement being fired. I was able to find the error in log files found on WAS server in transaction AL11.
       So i suggest to everyone having issues with JDBC adapter, please do not trust the error given in runtime workbench, always crosscheck in the logs in AL11 at the following location in your XI box
    DIR_INSTANCE\J2EE\CLUSTER\SERVER0\log. Here find date and time when you triggered your scenario and search for your table name or stored proc name, the java dump will give you a good information.
      I am giving points to everyone anyways.
    Thanks
    Pulin

  • Parsing Column Value. SQL / Stored Proc/ Function ?

    Hi,
    I just started writing SQL. Need your valuable input for the following query,
    Need to query a table and parse a column to produce a desired output.
    like suppose my column value is
    #ADFA
    /SDFGAS
    {ABC}: 123
    {BCA}: 456
    {DEF}: 789
    and i need to get an out put as follows
    {ABC} {BCA} {DEF}
    123 456 789
    so the patterns are defined.
    I some how tried and reached through SQL, but there should be better way than this. So posted this question.
    I tried using SQL itself (using substr, instr & decode functions in the select statement)... with out using stored proc/ function as i have not created one earlier.. I am just learning the syntax and trying it.
    The psuedo code i have planned is
    function substring(column_value, search_string)
    var start_index NUMBER;
    var end_index NUMBER;
    var result VARCHAR2;
    result = 'N/A';
    start_index = instr(column_value, search_string) + 4
    if start_index >= 4
    end_index = instr(substr(column_value, 0, start_index), CHR(13)-1)
    if start_index >= 4 && end_index >=0
    result = substr(column_value, start_index, end_index);
    return result;
    I just wrote it like writing in a programming language. Need to implement this through Stored Proc/ Function. Please let me know your comment on this

    Oops, I think regular expressions are not available in my current oracle version :-(
    I am having Oracle 9i.
    Got it.. Yes it is available from 10G onwards.. :-(
    Message was edited by:
    Thiru.Thiru

  • Passing int[] parameter to PL/SQL stored proc via SQLJ

    This should be easy. I want to pass an array of Java integers i.e. int[] as an IN parameter to a PL/SQL stored procedure that expects a TABLE OF INTEGER.
    But SQLJ keeps giving me an error when I try to call the procedure, saying that int[] is an unsupported Java type.
    Is this true? Is it really impossible to pass a simple int array into a PL/SQL procedure via SQLJ?
    All help will be gratefully received.
    Chris

    Yes, you cannot pass int[], since index-by-tables are not supported by either JDBC or by SQLJ.
    (Well, I lied just a little bit: if you use an 8.1.7 or later JDBC-OCI driver, then there is some support for scalar index-by-tables. But not with thin, kprb drivers, or with SQLJ.)
    null

  • Exposing/Publishing PL/SQL Stored Procs as Web Services

    Has anyone come up with a way to publish PL/SQL stored procedures as web services? Our team already has sufficient knowledge in deploying EJBs and exposing them as services but we're curious to see if we can create services without building and deploying an EJB as the provider mechanism.
    Any ideas/guidance are appreciated!

    In JDeveloper 10 you can do it. check that article
    But in 11g version they hide that option :(
    [some info|http://forums.oracle.com/forums/thread.jspa?messageID=3237164&#3237164]
    Edited by: August_ on Apr 19, 2009 11:52 PM

  • Passing parameters from Excel to SQL stored proc. to analyse resultset in PowerPivot

    Hi,
    Not sure if I posted this question at the right forum ...
    I would like to implement the following scenario:
    - Enter parameters @startdate and @enddate in cells in an Excel worksheet (i.e. cell A2 has the value for the startdate parameter; cell B2 has the value for the endate parameter).
    - Pass these parameters to a SQL stored procedure (using MSQuery?). See below.
    - Calling stored procedure in PowerPivot to get the resultset in PowerPivot.
    The SP calls some functions in SQL Server. See below.
    I have read several posts on several forums but I can't get the parameters from Excel (MSQuery?) to the SP.
    What's the best way to have PowerPivot picking up the resultset from the SP?
    How do I get the Excel cells A2 and B2 to the SP below?
    SP:
    USE [Test]
    GO
    /****** Object: StoredProcedure [dbo].[_Pink_SP_CapaciteitTest] Script Date: 29-7-2014 15:41:04 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[_Pink_SP_CapaciteitTest]
    @startdate DATETIME,
    @enddate DATETIME
    AS
    BEGIN
    SET NOCOUNT ON
    SET DATEFIRST 1
    DECLARE @TempCapacity TABLE
    ResourceNo INT,
    ResourceName NVARCHAR(60),
    JobCode NVARCHAR(12),
    JobDescription NVARCHAR(50),
    CostcenterCode NCHAR(8),
    CostcenterDescription NVARCHAR(50),
    CostcenterClass NVARCHAR(30),
    CostcenterClassDescription NVARCHAR(60),
    Date DATETIME,
    Weekday INT,
    WeekNo INT,
    Month INT,
    Year INT,
    Capacity FLOAT,
    ConsultancyTot FLOAT,
    ConsultancyTotReserved FLOAT,
    Sick FLOAT,
    Doctor FLOAT,
    Pregnant FLOAT,
    Vacation FLOAT,
    VacationCancellation FLOAT,
    SpecialLeave FLOAT,
    CompHours FLOAT,
    Support FLOAT
    INSERT INTO @TempCapacity
    SELECT h.res_id AS ResourceNo,
    h.fullname AS ResourceName,
    h.job_title AS JobCode,
    j.descr50 AS JobDescription,
    h.costcenter AS CostcenterCode,
    cc.oms25_0 AS CostcenterDescription,
    ccc.CostcenterClassCode AS CostcenterClass,
    ccc.Description AS CostcenterClassDescription,
    CONVERT(VARCHAR(10), t.datum, 105) AS [Date],
    DATEPART(DW, t.datum) AS [Weekday],
    (SELECT [dbo].[ISOWeekNumber] (t.datum)) AS WeekNo,
    MONTH(t.datum) AS [Month],
    YEAR(t.datum) AS [Year],
    (SELECT ROUND([dbo].[HRCapacityHours] (h.res_id, t.datum, t.datum), 2)) AS Capacity,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (50, h.res_id, t.datum, t.datum + 1), 0)) AS ConsultancyTot,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (51, h.res_id, t.datum, t.datum + 1), 0)) AS ConsultancyTotReserved,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (9538, h.res_id, t.datum, t.datum + 1), 0)) AS Sick,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8531, h.res_id, t.datum, t.datum + 1), 0)) AS Doctor,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (9924, h.res_id, t.datum, t.datum + 1), 0)) AS Pregnant,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8501, h.res_id, t.datum, t.datum + 1), 0)) AS Vacation,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8551, h.res_id, t.datum, t.datum + 1), 0)) AS VacationCancellation,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8511, h.res_id, t.datum, t.datum + 1), 0)) AS SpecialLeave,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (9518, h.res_id, t.datum, t.datum + 1), 0)) AS CompHours,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (3200, h.res_id, t.datum, t.datum + 1), 0)) AS Support
    FROM humres h (NOLOCK)
    LEFT OUTER JOIN hrjbtl j (NOLOCK) ON h.job_title = j.job_title
    LEFT OUTER JOIN kstpl cc (NOLOCK) ON h.costcenter = cc.kstplcode
    LEFT OUTER JOIN CostcenterClasses ccc (NOLOCK) ON cc.Class_01 = ccc.CostcenterClassCode AND ccc.ClassID = 1
    CROSS APPLY (SELECT * FROM [dbo].[AllDays] (@startdate, @enddate)) t
    WHERE h.ldatindienst <= t.datum
    AND ISNULL(h.ldatuitdienst, t.datum) >= t.datum
    AND h.fullname NOT LIKE '%inhuur%'
    AND h.emp_type IN ('E', 'C')
    AND h.job_title IN ('F09CONS', 'F09PRIN')
    ORDER BY h.fullname,
    t.datum
    SELECT * FROM TempCapacity
    END
    Thanks!

    Hi,
    According to your description, I think you want to call a store procedure in PowerPivot with the parameters which are stored in the cells of an Excel workbook.
    Are you using the PowerPivot add-in in Excel or PowerPivot in SQL Server?
    This forum is to discuss problems of Office development such as VBA, VSTO, Apps for Office .etc. If you are using Excel PowerPivot, since it is an add-in for Excel and it doesn't publish API for us, we cannot automatically call a stored procedure in Excel.
    We can get the data from Cells A2 and B2 with code, but it's hard to set it as the parameters of a SP when calling it from PowerPivot. About calling a SP from Excel manually, you could post in
    Excel IT pro forum for more effective responses.
    If you are using PowerPivot in SQL Server, I'm afraid your issue is more related to the feature of PowerPivot. We can get data from SQL Server database into Excel workbook, but I'm not sure whether we can get data from Excel cells in SQL Server. So I suggest
    you posting in
    SQL Server PowerPivot forum for more effective responses.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Button to call pl/sql stored proc using text box value as parameter

    I need to create a portal page with an input text box and a button (or a clickable pl/sql item). A user will enter a value in the text box and click the button, a stored pl/sql procedure will be executed that takes the value of the text box as an input parameter. The procedure output (basically a success or an error message) must be printed in a new window which the user can close after checking the output. No redirection to another page is required.
    I have no experience in developing portal pages and would appreciate if you point me in a right direction. Do I need to create an html form and obtain the value of the text box via p_session object? In this case what do I need to specify as ACTION for the form - the same page URL? Where should I place the call to the stored procedure? Or can I somehow use a pl/sql item?
    Thank you for your help

    Hi Arnaud
    Thank you for the reply. Could you please give me dome more details. I have created a procedure:
    create or replace procedure grant_roles (p_username varchar2) as
    begin
    <code>
    htp.p('Grant succeeded for username is '||p_username);
    exceptions when others then
    htp.p('Grant failed. '||v_err_msg);
    end;
    and an html portlet:
    <html>
    <body>
    <form name="input" action="/pls/portal/pls/portal_public.grant_roles_test?p_username=anna" method="get">
    <input type="text" name="t_username" size="20">
    <br>
    <input type="submit" value="Grant">
    </form>
    </body>
    </html>
    Obviously this is not the right way to call my procedure as it does not work. And of course I want to pass the value of the t_username text box to the procedure not the string "anna". I am also not sure where a procedure prints its output. Is it possible to open a new window to display the output?
    Thank you for your help,
    Anna

  • Select in pl/sql stored proc.

    Hi friends,
    I am new to oracle development and were trying to write some basic stored procedure,when i try to put a simple stored select statment in between my 'BEGIN' and 'END' clause it never let me do that,it says that 'INTO' clause is expected,I do not want to store andy specific value in any variable i just want a list of all records from that table,Is there any restriction regarding that,can't I do it,am I doing something wrong.?
    If any one of u gentalmen can help me,I will be obliged to u .
    Thanks a lot.

    This is somewhat basic.
    We always have to have a receptacle for the result set. In SQL*Plus that receptacle is the screen, hence we can dispense with an explicit INTO clause. PL/SQL is a batch process which doesn't write to the screen, so we have to define variables to hold the data.
    PL/SQL gives ius options. Wwe can define our SELECT statement as an explicit cursor, in case we don't need to include the INTO clause in our SELECT but we still have to FETCH the cursor INTO a record. Or we can use an implicit cursor, with an INTO clause.
    Those are the rules.
    You might find it helpful to read the manual. This link will take you to a page that includes some helpful info; one of the links will take you to the online Oracle documentation.
    Re: How to attach a java bean in forms6i
    Good luck, APC

Maybe you are looking for