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

Similar Messages

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Parameter index move while executing PL/SQL stored procedure/function

    Hello, community.
    Have a question for you. It looked like very easy to write some small JDBC-wrapper to handle stored procedure/functions call for Oracle.
    Here is the code snippet of it:
    import java.io.Serializable;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.util.HashMap;
    import java.util.Iterator;
    import javax.sql.DataSource;
    import oracle.jdbc.driver.OracleTypes;
    import org.apache.log4j.Logger;
    public class SmallHelper {
         public static final int CALL_TYPE__PROCEDURE = 1;
         public static final int CALL_TYPE__FUNCTION = 2;
         public static final int PARAMETER__IN = 1;
         public static final int PARAMETER__OUT = 2;
         private static final Logger log = Logger.getLogger(SmallHelper.class);
         private Connection con = null;
         private CallableStatement statement = null;
         private String name;
         private int type;
         private int resultType;
         private HashMap arguments = new HashMap();
          * Creates connection using data source as parameter.
          * @param ds - data source
          * @throws EhlApplicationException
         public SmallHelper(DataSource ds) throws Exception {
           try {
                   con = ds.getConnection();
              catch (SQLException e) {
                   ExceptionHelper.process(e);
         public void registerProcedure(String name) {
              this.name = name;
              this.type = CALL_TYPE__PROCEDURE;
         public void registerFunction(String name, int resultType) {
              this.name = name;
              this.resultType = resultType;
              this.type = CALL_TYPE__FUNCTION;
          * NB! When You're dealing with stored function index should start with number 2!
         public void registerArgument(int index, Object value, int type, int inOutType) {
              arguments.put(new Long(index), new CallableStatementArgument(value, type, inOutType));
         private String getSQL() {
              StringBuffer str = new StringBuffer("{ call  ");
              if ( type == CALL_TYPE__FUNCTION )
                   str.append(" ? := ");
              str.append(name).append("( ");
              for ( Iterator i = arguments.values().iterator(); i.hasNext(); ) {
                   i.next();
                   str.append("?");
                   if ( i.hasNext() )
                        str.append(", ");
              str.append(") }");
              return str.toString();
         public void execute() throws SQLException{
              String query = getSQL();
              statement = con.prepareCall(query);
              if ( type == CALL_TYPE__FUNCTION )
                   statement.registerOutParameter(1, resultType);
              for ( Iterator i = arguments.keySet().iterator(); i.hasNext(); ) {
                   Long index = (Long) i.next();
                   CallableStatementArgument argument = (CallableStatementArgument) arguments.get(index);
                   int type = argument.getType();
                   if ( argument.getInOutType() == PARAMETER__OUT )
                        statement.registerOutParameter(index.intValue(), type);
                   else if ( type != OracleTypes.CURSOR )
                        statement.setObject(index.intValue(), argument.getValue(), type);
              log.info("Executing SQL: "+query);
              statement.execute();
         public CallableStatement getStatement() {
              return statement;
         public void close() throws EhlApplicationException {
              try {
                   if (statement != null)
                        statement.close();
                   if (con != null)
                        con.close();
              catch (SQLException e) {
                   EhlSqlExceptionHelper.process(e);
         private class CallableStatementArgument implements Serializable{
              private Object value;
              private int type;
              private int inOutType;
              public CallableStatementArgument(Object value, int type, int inOutType) {
                   this.value = value;
                   this.type = type;
                   this.inOutType = inOutType;
              public int getType() {
                   return type;
              public Object getValue() {
                   return value;
              public int getInOutType() {
                   return inOutType;
    }It was really done in 10-15 mins, so don't be very angry at code quality :)
    Here is the problem.:
                   helper.registerProcedure("pkg_diagnosis.search_diagnosis");
                   helper.registerArgument(1, null, OracleTypes.CURSOR, EhlJdbcCallableStatementHelper.PARAMETER__OUT);
                   helper.registerArgument(2, pattern, OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(3, lang, OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(4, EhlSqlUtil.convertSetToString(langs, ","), OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(5, EhlSqlUtil.convertSetToString(diagnosisClass, ","), OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(6, parentId, OracleTypes.NUMBER, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.execute();
                   ResultSet rs = ((OracleCallableStatement) helper.getStatement()).getCursor(1);
                   procedure definition:
    procedure search_diagnosis (l_res OUT dyna_cur,
                               in_search_string IN VARCHAR2,
                               in_search_lang IN VARCHAR2,
                               in_lang_list IN VARCHAR2,
                               in_diag_class_list IN VARCHAR2,
                               in_parent_id IN NUMBER) Procedure call has inner check that fail because of som strange reason:
    in_search_string has 2 as index, that is correct. but procedure recieves is as number 3 in parameter list (what is in_search_lang). Other parameters are moved to. It seems like a cursor takes 2 places in definition. It's clear that if I put in_search_string as 1 parameter and cursor as 0 I'll get invalid parametr bindong(s) exception. So... any ideas why 2nd parameter is actually 3rd?
    Thanks beforehand.

    hmm...moreover:
    if we change procedure to function and call it in a simple way:
    CallableStatement stmnt = helper.getConnection().prepareCall("begin ? := pkg_diagnosis.search_diagnosis(?,?,?,?,?); end;");
                   stmnt.registerOutParameter(1, OracleTypes.CURSOR);
                   stmnt.setString(2, pattern);
                   stmnt.setString(3, lang);
                   stmnt.setString(4, langs);
                   stmnt.setString(5, diagnosisClass);
                   stmnt.setObject(6, parentId, OracleTypes.NUMBER);
                   stmnt.execute();
                   ResultSet rs = (ResultSet) stmnt.getObject(1);the exception is:
    [BEA][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 14:
    PLS-00382: expression is of wrong type
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredif we return some string or number - it works. but when we want cursor back - it fails.
    cursor is defined like ordinary dynamic cursor:
    TYPE dyna_cur IS REF CURSOR;

  • To pass new session variable value to stored proc before running a report.

    Hi,
    Below is summary of the report requirement -
    Database level design
    1. Created a view and a global temporary table (GTT)
    2. Created an Oracle package procedure to accept from and to business dates on basis of which it will fetch, process and populate the GTT.
    Repository level design
    1. Created a business model containing the view and the GTT (mentioned above)
    2. Created two SESSION variables "from_dt" and "to_dt" to be initialized by their respective init blocks. Each of the variable is initialized with a DATE column value (of type DATETIME) from a database lookup table. I have also set the option "Enable that variable to be set by any user" for both variables.
    Query for these variables :
    from_dt = select from_date from <table>
    to_dt = select add_months(from_date,12) from <table>
    Presentation level design
    1. Using a text box, i display the default/initialized values of these variables like this -
    Current business date:@{biServer.variables['NQ_SESSION.from_dt']} Future business dt:@{biServer.variables['NQ_SESSION.to_dt']}
    Dates get displayed in YYYY-MM-DD 00:00:00 format
    The text msg displays these default dates and allows the user to specift different date range for which i create prompts as shown below.
    2. Using any random two columns of date type from the business model, i create two date dashboard prompts with labels "From Dt" and "To Dt".
    i select Calender Controls for both; setting Default To = Report Defaults.
    The Set Variable is set to Presentation variables - such that pv_from_dt maps to "From Dt" and pv_to_dt maps to "To Dt".
    3. i create the report using the business model created above. In the report "Advanced Tab" => "Prefix" field i specify the following -
    SET VARIABLE from_dt='@{pv_from_dt}',to_dt='@{pv_to_dt}';
    Note : The logic here is to display the default dates and allow user to specify different date values which will be stored in presentation variables.
    If the user does specify different "from dt" and "to dt" values, then using the presentation variables, i want to "write" back these new values to the corresponding session variables mentioned above.
    If the user does not specify different date range, then the default/initialized dates must be considered.
    I also display the default and new date values in the report title.
    Back to Repository level design
    To execute the stored procedure that will load the GTT before running the report I need to pass two date parameters to the stored procedure on basis of which it will fetch data, process and populate the GTT.
    In the Connection Pool --> Connection Script Tab --> Execute before query, I wrote the below query using the repository variables FROM_DT and TO_DT to execute the procedure -
    DECLARE
    v_from_dt date;
    v_to_dt date;
    BEGIN
    v_from_dt := VALUEOF(From_Dt);
    v_to_dt := VALUEOF(To_Dt);
    package_name1.package_body(v_from_dt,v_to_dt);
    END;
    Now when i try to run the report i get the following error :
    [nQSError: 10058] A general error has occurred. [nQSError: 23006] The session variable, NQ_SESSION.to_dt, has no value definition. (HY000)..
    Need help on this.
    Is it possible to "write back" a new value to a session variable ?
    Any other alternatives.
    Thanks
    Nusrat
    Edited by: user10309945 on Jan 24, 2011 10:08 PM

    Sandeep, I found a several topics where users describe saving values in DB through stored procedure or function. For example, [How to store OBIEE presentation level variable values in DB |http://forums.oracle.com/forums/thread.jspa?threadID=892006] I tried it and get an error
    *10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 14551, message: ORA-14551: cannot perform a DML operation inside a query ORA-06512*
    It's not a BI error. This error are generated by Oracle DB. If I write next:
    SELECT MyPLSQLFunction(p1,p2) FROM DUAL
    I get the same error.
    Oracle doesn't allow DML operations in SELECT.
    Did you relalize this feature yourself? Where did I mistake?

  • How to set variable values in Stored Procs

    Hi all,
    please excuse my newbie questions - I've spent too long using SQL Server......
    Anyway,
    I'm playing with SP basics and was wondering how I can set a variable value in a stored proc, ideally getting a value from a table or some select .
    for instance...........
    CREATE OR REPLACE PROCEDURE RPT_SP_ANT_TESTING
    P1 IN NUMBER,
    P2 IN VARCHAR2
    IS
    TmpNum NUMBER;
    TmpStr VARCHAR2(255);
    BEGIN
    --How do set these?
    SET TMPNUM := SELECT Count( * ) FROM ALL_TABLES;
    SET TMPSTR := P2 + '_APPENDED';
    INSERT INTO TEST_TABLE
    ( STRINGFIELD, NUMBERFIELD )
    VALUES
    ( TmpStr, TMPNUM )
    END;
    Regards
    DC

    Some ways are...
    setting directly
    x := 1;
    setting from a select use INTO clause
    select 1 into x from dual
    setting from a select into a collection type use BULK COLLECT INTO
    select name bulk collect into lName from your_table.
    It would be better if you read the document.
    Thanks,
    Karthick.

  • 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.

  • Unable to pass the values to stored proc using presentation variable in OBI

    Hi All,
    Need your help regarding in resolving an issue in OBIEE 10.1.3.4.1
    There is an OBIEE requirement whereby two prompts need to be defined.
    1.     Textbox prompt
    2.     Drop-down prompt
    The dropdown values should be populated using textbox prompt. So, we have used presentation variable in textbox prompt and passing the same to select query of drop-down.
    Until this step, the report works just fine.
    Now, the value in both textbox and drop-down needs to be passed to stored proc.
    While trying to pass the values by using the presentation variable, the following error comes-up saying
    Session variable has no value definition.
    Note:Although the corresponding session variable has been set to default value,still the error appears.
    Please advise.
    Regards,
    Prasad

    "Session variable has no value definition" I'm assuming typo error and it should be presentation variable.
    Set default value for presentation variable that may work

  • Advice Please: Adding Few Static Values to Stored Proc Returned Result Set

    Hello -
    The Stored Proc below returns about 1000 rows of result set when a date is passed to the query. In addition to that, there are about 5 rows of data (which is in my excel file) needs to be added to the result set. What is the best possible way?
    What I have done is I created a new table which has that 5 static rows. It has just the addresses and amount and customer number. There is no invoice date in that table. I tried UNION and the query did not like the fact that I had something like that in
    the first table:
    SELECT
    '0' as 'TYPE'
    ,'TBCCA' as 'Acc ID'
    ,'12882' as 'BEID'
    , '' as ' # OF UNITS'
    , Circuit_Total as 'AMT'
    ,'D' as 'D or C'
    , '' as ' FDOC yyyymmdd'
    , '' as ' LDOC yyyymmdd'
    , Address as 'Brief Comment'
    , city as 'Tax City'
    , State as 'Tax State'
    , Zip_Code as 'Tax Zip Code'
    , INV_DATE as 'Invoice Date'
    FROM [dbo].[TBC_MonthlyCircuitDetail]
    WHERE INV_DATE = '2014-07-01'
    AND [Circuit_Total] >0
    UNION
    SELECT 0
    '0' as 'TYPE' --DID NOT LIKE THIS <<
    ,'TBCCA' as 'Acc ID'
    ,'12882' as 'BEID'
    , '' as ' # OF UNITS'
    , Circuit_Total as 'AMT'
    ,'D' as 'D or C'
    , '' as ' FDOC yyyymmdd'
    , '' as ' LDOC yyyymmdd'
    , Address as 'Brief Comment'
    , city as 'Tax City'
    , State as 'Tax State'
    , Zip_Code as 'Tax Zip Code'
    , '' INV_DATE as 'Invoice Date'
    FROM [dbo].[TBC_MonthlyCircuitDetailStaticValues]
    WHERE INV_DATE = '2014-07-01'
    AND [Circuit_Total] >0
    Stored Proc below:
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[SP_TBC_ORBIT Process Form]
    -- Add the parameters for the stored procedure here
    @INVOICE_DATE varchar(20)
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for procedure here
    SELECT
    '0' as 'TYPE'
    ,'TBCCA' as 'Acc ID'
    ,'12882' as 'BEID'
    , '' as ' # OF UNITS'
    , Circuit_Total as 'AMT'
    ,'D' as 'D or C'
    , '' as ' FDOC yyyymmdd'
    , '' as ' LDOC yyyymmdd'
    , Address as 'Brief Comment'
    , city as 'Tax City'
    , State as 'Tax State'
    , Zip_Code as 'Tax Zip Code'
    , INV_DATE as 'Invoice Date'
    FROM [dbo].[TBC_MonthlyCircuitDetail]
    WHERE INV_DATE IN (@INVOICE_DATE)
    AND [Circuit_Total] >0
    END
    GO
    So, what do you suggest? As you can tell, I am quite a novice but I am learning by researching, asking questions and doing it. Thanks in advance!
    Sanjeev Jha

    Your second Select statement is as below:
    SELECT 0
      '0' as 'TYPE'
    --DID NOT LIKE THIS <<
    ,'TBCCA' as
    'Acc ID'
    ,'12882' as
    'BEID'
    , '' as
    ' # OF UNITS'
    , Circuit_Total as
    'AMT'
    ,'D' as 'D or C'
    , '' as
    ' FDOC yyyymmdd'
    , '' as
    ' LDOC yyyymmdd'
    , Address as
    'Brief Comment'
    , city as 'Tax City'
    , State as
    'Tax State'
    , Zip_Code as
    'Tax Zip Code'
    , ''INV_DATE
    as 'Invoice Date'  -- CHANGE HERE
    FROM [dbo].[TBC_MonthlyCircuitDetailStaticValues]
    WHERE INV_DATE = '2014-07-01'
    AND [Circuit_Total] >0
    You are receiving Invoice date from INV_DATE column from table or you want to set it as blank?
    Change it to either - ( '' as
    'Invoice Date' ) or  (INV_DATE as
    'Invoice Date'  )
    -Vaibhav Chaudhari

  • 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

Maybe you are looking for

  • Errors ORA-39002,ORA-39070, ORA-29283, ORA-06512, ORA-29283 during import

    Hi all, I am getting errors during import to 10g database using impdp command. D:\>impdp nisa_lt/abc123@objtel1 directory=dtpump dumpfile=20120208_expobj.dmp full=y logfile=dbblog.log Import: Release 10.2.0.1.0 - Production on Monday, 13 February, 20

  • Tcode Impacted by the BADI  "MRM_PAYMENT_TERMS"

    Hello, Could you please tell me what are the T-code in which this BADI "MRM_PAYMENT_TERMS" is triggered or how i can get the list of all the tccode for which this BADI is called. As of i know two tcode MIRO and MIR7. I want to know is there any other

  • Subtotals in BEx Analyzer

    Hey! How can I create subtotals in BEx Analyzer? Thanks a lot, Sabine

  • Managing ldap user querying permission at BI server level

    Hello Guys I am trying to manage the corporate resource by limiting certain users to run query at certain time or certain size. I know it can be done using 'manage--security' to set the querying limit for each users that are defined in the Admin tool

  • Premiere CS4 is an insult to Mac users

    Adobe's lack of compatability with avchd and Quicktime is a joke. Do they really think they can get away with a product that doesn't work? I don't need to hear from the few Adobe and Windows apologists around here who can only state it is Apple's fau