OLEDB Insert with Parameters

I am using Oracle 9i with Visual Basic.NET 2002 and the .NET Framwork v1.0 on an XP Pro system. When I try to do an Insert using Parameters I get an OleDbException error in system.data.dll. Below is the distilled code and what my table looks like in Oracle. Any help is greatly appreciated.
SQL> describe groups
Name Null? Type
GROUPID NOT NULL CHAR(36)
Imports System.Data.OleDb
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Conn As OleDbConnection
Dim Cmd As OleDbCommand
Dim intRowsAffected As Integer
Conn = New OleDbConnection("Provider=MSDAORA;Data Source=MyHDB;User ID=Scott;Password=tiger")
Conn.Open()
strDummySQL = "INSERT INTO GROUPS(GROUPID) VALUES(?)"
Cmd = New OleDbCommand(strDummySQL, Conn)
Cmd.CommandType = CommandType.Text
Cmd.Parameters.Add("GROUPID", OleDb.OleDbType.Char, 36).Value = Nothing
strDummy = "CB691384-8679-430D-BC44-63B83086C82D"
Cmd.Parameters("GROUPID").Value = strDummy
intRowsAffected = Cmd.ExecuteNonQuery()
End Sub
When the code reaches the last line "intRows...." I get the following error:
"An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"
Any Ideas on What I should do?

I solved the problem. The code was fine. I had two databases within Oracle, one that my code was accessing and one where I was building the tables. Sorry for the trouble.

Similar Messages

  • Calling stored procedures with parameters with the Database Connectivi​ty Toolkit

    Hi all,
    I am new to the forum and am having difficulty finding a solution to a particular problem I am having regarding using the LabVIEW Database Connectivity Toolkit on a project I am currently working on at my job.  I have a database in which I have tables and stored procedures with parameters.  Some of these stored procedures have input, output, and return parameters.
    I have been trying to follow this example but to no avail:  http://digital.ni.com/public.nsf/allkb/07FD1307460​83E0686257300006326C4?OpenDocument
    One such stored procedure I am working on implementing is named "dbo.getAllowablePNs", which executes "SELECT * from DeviceType" (DeviceType is the table).  In this case, it does not require an input parameter, it has an output parameter that generates the table [cluster], and has a return parameter which returns an integer value (execution status code) to show if an error occurred.  The DeviceType table has 3 columns; ID (PK, int, not null), PN (nvarchar(15), null), and NumMACAddresses (int, null).  I have gone over many examples and have talking to NI support to try to implement this and similar stored procedures in LabVIEW but have not been successful.  I am able to connect to the database with the Open Connection VI without error, but am running into some confusion following this step.  I am then trying to use the Create Parameterized Query VI to call the stored procedure and set the parameters.  I assume I would then use the Set Parameter Value VI for each parameter that is wired into the parameters input on the previous Parameterized Query VI?  I am also having some confusion during and following these steps as well.  I would greatly appreciate any advice or suggestions anyone might have in regards to this situation as I am not a SQL expert.  Also, I would be happy to provide any more information that would be helpful.
    Regards,
    Jon
    Solved!
    Go to Solution.

    Also, I don't know if this would be helpful but here is the actual stored procedure in SQL:
    CREATEPROCEDURE [dbo].[getLastSequenceNumber]
    @p1 nvarchar(10)='WO-00000'
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SETNOCOUNTON;
    -- Insert statements for procedure here
    selectmax(SequenceNumber)from Devices where WorkOrderNumber= @p1
    END
    GO

  • Error ORA-01460 warning ORA-01461 during running a mapping with parameters

    Oracle 10g release2(10.2.0.1.0), OWB 10.2.0.1.31, Workflow server 2.6.4
    I have a simple process flow ( start -> mapping -> end).
    The mapping consists of 4 input groups(3 ordinary tables<INGRP1, INGRP2, INGRP3> and 1 mapping input parameter operator <INGRP4>), a joiner, a filter, an expression operator and 1 output group.
    I want to use two variables in join condition, so I bound two mapping input parameters(<INGRP4.SRC_SYS_CDE> and <INGRP4.ADMIN_ORG_NUM>) with two parameters of the process flow's start activity.
    Those two mapping input parameters are of type char, one is 4-char long and the other is 2-char long. So I set both of the two parameters of the start activity as String, one as 08, another as 7504.
    My join condition is:
    INGRP1.ORGIDT = INGRP2.SOURCEORGANIZATIONNO AND
    INGRP2.SOURCESYSTEMCODE = INGRP4.SRC_SYS_CDE AND
    INGRP2.ADMINORGANIZATIONNO = INGRP4.ADMIN_ORG_NUM AND
    INGRP1.CURCDE = INGRP3.NUM(+)
    There are no errors and warnings in validation, generation and deployment process, but when I run the process flow, it always finishes blankly(zero insert) with no error and warning messages. It should insert more than 20,000 rows.
    When I run the mapping and set the parameters 08 and 7504 at the parameter prompt, then start, the following error and warning occurs.
    Error ORA-01460: unimplemented or unreasonable conversion requested
    Warning ORA-01461: can bind a LONG value only for insert into a LONG column
    So what's the problem? How can I fix it?

    The problem was mapping input parameter type.
    VARCHAR2-type mapping input parameter works with String-type PF parameter. But CHAR-type won't.

  • T-sql 2008 r2 place results from calling a stored procedure with parameters into a temp table

    I would like to know if the following sql can be used to obtain specific columns from calling a stored procedure with parameters:
    /* Create TempTable */
    CREATE TABLE #tempTable
    (MyDate SMALLDATETIME,
    IntValue INT)
    GO
    /* Run SP and Insert Value in TempTable */
    INSERT INTO #tempTable
    (MyDate,
    IntValue)
    EXEC TestSP @parm1, @parm2
    If the above does not work or there is a better way to accomplish this goal, please let me know how to change the sql?

    declare @result varchar(100), @dSQL nvarchar(MAX)
    set @dSQL = 'exec @res = TestSP '''+@parm1+''','' '''+@parm2+' '' '
    print @dSQL
      EXECUTE sp_executesql @dSQL, N'@res varchar(100) OUTPUT', @res = @result OUTPUT
    select @result
    A complicated way of saying
    EXEC @ret = TestSP @parm1, @parm2
    SELECT @ret
    And not only compliacated, it introduces a window for SQL injection.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • ADF how can i execute a query with parameters when the page renders

    hi
    i am using ADF web 11g
    i need to execute a query with parameters when the page renders
    thanks

    hello,
    I'm a fan of Java code, I really am.
    But when you use ADF, you decided to move to a more declarative environment.
    So why not do it declarative, the adf way?
    In your pagedef insert a action binding.
    This can be anything, a call to the application module, a call on the iterator(Like executeWithparams, etc.)
    Create an invokeAction in your pagedef and set the condition.
    This example refreshes(Action 2 is execute query) the data.
    First the method binding:
        <action IterBinding="PersoonIterator" id="Execute" InstanceName="LSAppModuleDataControl.Persoon"
                DataControl="LSAppModuleDataControl" RequiresUpdateModel="true" Action="2"/>And the invoke action
        <invokeAction Binds="Execute" id="refreshData"/>This always refreshes the data on page entry, but anything is possible, you can set condictions for the invokeAction.
    -Anton
    PS Yes I know that pagedefs become backing beans in the end and yes that is Java code, but if you wanna play the ADF way, the goal is the reduction of Java code and the increased performance of declarative programming.

  • How to create a view with parameters; read the documentation but nothing!

    Hello!
    I'm new to the Oracle world but together with my coworkers we need to very quickly study Oracle to figure out whether we'll add Oracle to our list of supported databases or not.
    Question: How do I create a view with parameters?
    I've read the documentation but I could not find this! I found the sql syntax to create a view but no parameters whatsoever...
    I have found on the web some very complicated way of doing this, but doesn't Oracle support Views with parameters?
    The goal here is to return a recordset, don't forget, so,please don't speak about stored procedures unless you are going to tell me how to get a recordset out of a stored procedure! ;)
    Thanks for all your help and attention!
    Jorge C.

    You can set up a parameterized view via context as follows:
    1. Set up a procedure to set your context values:
    create or replace procedure p_set_context (p_context IN VARCHAR2,p_param_name IN VARCHAR2,p_value IN VARCHAR2)
    as
    BEGIN
    sys.dbms_session.set_context(p_context,p_param_name,p_value);
    END;
    2. Create your context using the procedure you just created
    create or replace context my_ctx using p_set_context
    3. This is the test table I'll use
    create table my_table(col1 number)
    and populate it:
    begin
    for v_index in 1..10
    loop
    insert into my_table values(v_index);
    end loop;
    end;
    and the view that will be parameterised
    create or replace view v_my_table as select col1 from my_table where col1 between sys_context('my_ctx','start_range') and sys_context('my_ctx','end_range')
    4. Now set the parameters using the procedure above.
    begin
    p_set_context('my_ctx','start_range','1');
    p_set_context('my_ctx','end_range','5');
    end;
    5. Selecting from my_table will give you 1 to 10 (no surprise there :-) )
    selectng from v_my_table will give you 1 to 5
    You can use the context to set formats etc using the same principle. A common gotcha to watch for is trying to set the context directly using DBMS_SESSION.SET_CONTEXT instead of creating a procedure. This belongs to SYS and SYS won't have the privileges to set your context so you get an insufficient privileges result leading to much headscratching and unnecessary grants (at least that's my understanding of it).
    Sorry Jorge, as you're new to Oracle I should also have pointed out for completeness sake, that you can change the parameters at any time through recalling the p_set_context, for example, following on from above, after your "select * from v_my_table" and seeing 1 to 5, you could then do
    begin
    p_set_context('my_ctx','start_range','3');
    end;
    and when you requery 'Select * from v_my_table' you will now see rows 3 to 5.
    Bit of a simplistic example, but you can see how easy it is. :-)
    Message was edited by:
    ian512

  • My CLOB insert with PreparedStatements WORKS but is SLOOOOWWW

    Hi All,
    I am working on an application which copies over a MySQL database
    to an Oracle database.
    I got the code to work including connection pooling, threads and
    PreparedStatements. For tables with CLOBs in them, I go through the
    extra process of inserting the CLOBs according to Oracle norm, i.e.
    getting locator and then writing to that:
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html (Good Example for BLOBs, CLOBs)
    However, for tables with such CLOBs, I only get a Record per second insert
    of about 1/sec!!! Tables without CLOBs (and thus, without the round-about-way)
    of inserting CLOBs are approx. 10/sec!!
    How can I improve the speed of my clob inserts / improve the code? At the moment, for
    a table of 30,000 records (with CLOBs) it takes about 30,000 which is 8 hours!!!!
    Here is my working code, which is run when my application notices that the table has
    CLOBs. The record has already been inserted with all non-clob fields and the "EMPTY_BLOB()"
    blank for the CLOB. The code then selects that row (the one just inserted), gets a handle on the
    EMPTY_BLOB location and writes the my CLOB content (over 4000 characters) to that handles
    and then closes the handle. At the very end, I do conn.commit().
    Any tips for improving speed?
    conn.setAutoCommit(false);
    * This first section is Pseudo-Code. The actual code is pretty straight
    * forward. (1) I create the preparedStatement, (2) I go record by record
    * - for each record, I (a) loop through each column and run the corresponding
    * setXXX to set the preparedStatement parameters, (b) run
    * preparedStatement.executeUpdate(), and (c) if CLOB is present, run below
    * actual code.
    * During insertion of the record (executeUpdate), if I notice that
    * a Clob needs to be inserted, I insert a "EMPTY_CLOB()" placeholder and set
    * the flag "clobInTheHouse" to true. Once the record is inserted, if "clobInTheHouse"
    * is actually "true," I go to the below code to insert the Blob into that
    * newly created record's "EMPTY_CLOB()" placeholder
    // clobSelect = "SELECT * FROM tableName WHERE "uniqueRecord" LIKE '1'
    // I create the above for each record I insert and have this special uniqueRecord value to
    // identify what record that is so I can get it below. clobInTheHouse is true when, where I
    // insert the records, I find that there is a CLOB that needs to be inserted.
    if(clobInTheHouse){
         ResultSet lobDetails = stmt.executeQuery(clobSelect);
         ResultSetMetaData rsmd = lobDetails.getMetaData();
         if(lobDetails.next()){
              for(int i = 1; i <= rsmd.getColumnCount(); i++){
                 // if column name matches clob name, then go and do the rest
                   if(clobs.contains(rsmd.getColumnName(i))){
                        Clob theClob = lobDetails.getClob(i);
                        Writer clobWriter = ((oracle.sql.CLOB)theClob).getCharacterOutputStream();
                        StringReader clobReader = new StringReader((String) clobHash.get(rsmd.getColumnName(i)));
                        char[] cbuffer = new char[30* 1024]; // Buffer to hold chunks of data to be written to Clob, the slob
                        int nread = 0;
                        try{
                             while((nread=clobReader.read(cbuffer)) != -1){
                                  clobWriter.write(cbuffer,0,nread);
                        }catch(IOException ioe){
                           System.out.println("E: clobWriter exception - " + ioe.toString());
                        }finally{
                             try{
                                  clobReader.close();
                                  clobWriter.close();
                                  //System.out.println("   Clob-slob entered for " + tableName);
                             }catch(IOException ioe2){
                                  System.out.println("E: clobWriter close exception - " + ioe2.toString());
         try{
              stmt.close();
         }catch(SQLException sqle2){
    conn.commit();

    Can you use insert .. returning .. so you do not have to select the empty_clob back out.
    [I have a similar problem but I do not know the primary key to select on, I am really looking for an atomic insert and fill clob mechanism, somone said you can create a clob fill it and use that in the insert, but I have not seen an example yet.]

  • Performance of insert with spatial index

    I'm writing a test that inserts (using OCI) 10,000 2D point geometries (gtype=2001) into a table with a single SDO_GEOMETRY column. I wrote the code doing the insert before setting up the index on the spatial column, thus I was aware of the insert speed (almost instantaneous) without a spatial index (with layer_gtype=POINT), and noticed immediately the performance drop with the index (> 10 seconds).
    Here's the raw timing data of 3 runs in each 3 configuration (the clock ticks every 14 or 15 or 16 ms, thus the zero when it completes before the next tick):
                                       truncate execute commit
    no spatial index                     0.016   0.171   0.016
    no spatial index                     0.031   0.172   0.000
    no spatial index                     0.031   0.204   0.000
    index (1000 default for batch size)  0.141  10.937   1.547
    index (1000 default for batch size)  0.094  11.125   1.531
    index (1000 default for batch size)  0.094  10.937   1.610
    index SDO_DML_BATCH_SIZE=10000       0.203  11.234   0.359
    index SDO_DML_BATCH_SIZE=10000       0.094  10.828   0.344
    index SDO_DML_BATCH_SIZE=10000       0.078  10.844   0.359As you can see, I played with SDO_DML_BATCH_SIZE to change the default of 1,000 to 10,000, which does improve the commit speed a bit from 1.5s to 0.35s (pretty good when you only look at these numbers...), but the shocking part of the almost 11s the inserts are now taking, compared to 0.2s without an index: that's a 50x drop in peformance!!!
    I've looked at my table in SQL Developer, and it has no triggers associated, although there has to be something to mark the index as dirty so that it updates itself on commit.
    So where is coming the huge overhead during the insert???
    (by insert I mean the time OCIStmtExecute takes to run the array-bind of 10,000 points. It's exactly the same code with or without an index).
    Can anyone explain the 50x insert performance drop?
    Any suggestion on how to improve the performance of this scenario?
    To provide another data point, creating the index itself on a populated table (with the same 10,000 points) takes less than 1 second, which is consistent with the commit speeds I'm seeing, and thus puzzles me all the more regarding this 10s insert overhead...
    SQL> set timing on
    SQL> select count(*) from within_point_distance_tab;
      COUNT(*)
         10000
    Elapsed: 00:00:00.01
    SQL> CREATE INDEX with6CDF1526$point$idx
      2            ON within_point_distance_tab(point)
      3    INDEXTYPE IS MDSYS.SPATIAL_INDEX
      4    PARAMETERS ('layer_gtype=POINT');
    Index created.
    Elapsed: 00:00:00.96
    SQL> drop index WITH6CDF1526$POINT$IDX force;
    Index dropped.
    Elapsed: 00:00:00.57
    SQL> CREATE INDEX with6CDF1526$point$idx
      2            ON within_point_distance_tab(point)
      3    INDEXTYPE IS MDSYS.SPATIAL_INDEX
      4    PARAMETERS ('layer_gtype=POINT SDO_DML_BATCH_SIZE=10000');
    Index created.
    Elapsed: 00:00:00.98
    SQL>

    Thanks for your input. We are likely to use partioning down the line, but what you are describing (partition exchange) is currently beyond my abilities in plain SQL, and how this could be accomplished from an OCI client application without affecting other users and keep the transaction boundaries sounds far from trivial. (i.e. can it made transparent to the client application, and does it require privileges the client does have???). I'll have to investigate this further though, and this technique sounds like one accessible to a DBA only, not from a plain client app with non-privileged credentials.
    The thing that I fail to understand though, despite your explanation, is why the slow down is not entirely on the commit. After all, documentation for the SDO_DML_BATCH_SIZE parameter of the Spatial index implies that the index is updated on commit only, where new rows are fed 1,000 or 10,000 at a time to the indexing engine, and I do see time being spent during commit, but it's the geometry insert that slow down the most, and that to me looks quite strange.
    It's so much slower that it's as if each geometry was indexed one at a time, when I'm doing a single insert with an array bind (i.e. equivalent to a bulk operation in PL/SQL), and if so much time is spend during the insert, then why is any time spent during the commit. In my opinion it's one or the other, but not both. What am I missing? --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Office control ms_word - runmacro, calling a macro with parameters

    How can I call word macro with parameters?
    I have ms word document with macro, for example:
    Sub Makro1(ByVal bookmark As String, ByVal text As String)
    ' Makro1 Makro
        Selection.GoTo What:=wdGoToBookmark, Name:=bookmark
        Selection.TypeText text:=text
        ActiveDocument.Bookmarks(bookmark).Delete
    End Sub
    I try call this macro from webdynpro:
      TRY.
          CALL METHOD
    wd_this->document->IF_IOS_APPLICATIONPROPERTIES~RUNMACRO
            EXPORTING
              NAME             = 'Makro1("z1","test")'
              ERRORINFORMATION = co_error_getcontent_stru
       IMPORTING
         RESULT           =
        CATCH CX_IOS_APPLICATIONPROPERTIES .
        CATCH CX_IOS_COMMUNICATIONWRAPPER .
        CATCH CX_IOS_ENVIRONMENT .
      ENDTRY.
    This macro cannot call. )
    Calling a macro without parameters is ok.
    Sub Makro2()
    Call Makro1("z1", "test")
    End Sub
          CALL METHOD
    wd_this->document->IF_IOS_APPLICATIONPROPERTIES~RUNMACRO
            EXPORTING
              NAME             = 'Makro2'
              ERRORINFORMATION = co_error_getcontent_stru
       IMPORTING
         RESULT           =
    Greats Radek

    1. Yes. Download from some location as binary file.
    2. Unzip by class CL_ABAP_ZIP. For filling bookmarks i need file 'word/document.xml'.
      CL_ABAP_ZIP->GET
    Unzipped files are only in memory.
    3. For parsing and filling bookmarks i use classes and interfaces cl_ixml, if_ixml*
    * create a DOM from the xstring
      lr_ixml = cl_ixml=>create( ).
      lr_stream_factory = lr_ixml->create_stream_factory( ).
      lr_istream  = lr_stream_factory->create_istream_xstring( iv_docx ).
      lr_document = lr_ixml->create_document( ).
      gr_document = lr_document.
      lr_parser = lr_ixml->create_parser( document       = lr_document
                                          istream        = lr_istream
                                          stream_factory = lr_stream_factory ).
      CALL METHOD LR_PARSER->ADD_PRESERVE_SPACE_ELEMENT
        RECEIVING
          RVAL   = lv_rval.
      IF lv_rval <> abap_true.
    * Err in parser XML
      ENDIF.
    CALL METHOD LR_PARSER->SET_XML_SPACE_AWARE.
    IF lv_rval <> abap_true.
    * Err in parser XML
    ENDIF.
    * Finding and filling bookmarks
      lr_root     = gr_document->get_root_element( ).
    * All elements "w:bookmarkStart"
      lr_elements = LR_ROOT->GET_ELEMENTS_BY_TAG_NAME(
    *      DEPTH     = 0
          NAME      = 'bookmarkStart'
          NAMESPACE = 'w'
      lr_itr_bookmarkStart = lr_elements->create_iterator( ).
      DO.
        lr_node = lr_itr_bookmarkStart->get_next( ).
        IF lr_node IS INITIAL. EXIT. ENDIF.
        lr_attributes = lr_node->get_attributes( ).
    * Read attribute "w:name" of element "w:bookmarkStart"
        lr_attribute = lr_attributes->get_named_item(
          NAME      = 'name'
          NAMESPACE = 'w'
        lv_name = lr_attribute->get_value( ).
        if iv_name <> lv_name. continue. endif.
    * Element "w:fldSimple" was found, iv_name = Name of bookmark to fill
        lv_bookmark_found = abap_true.
        lr_node_bookmarkStart = lr_node.
    * Read attribute "w:id" of element "w:bookmarkStart"
        lr_attribute = lr_attributes->get_named_item(
          NAME      = 'id'
          NAMESPACE = 'w'
        lv_id_start = lr_attribute->get_value( ).
    clear lv_id_end.
    * .... work with parser
    * find element w:bookmarkEnd for relevant w:bookmarkStart, bookmarkEnd with the same id as bookmarkStart
            lr_node_next = lr_node->get_next( ).
            do.
              IF lr_node_next IS INITIAL. EXIT. ENDIF.
              lr_node = lr_node_next.
              lv_name = lr_node->get_name( ).
              if lv_name = 'bookmarkEnd'.
                lr_attributes = lr_node->get_attributes( ).
    * Read attribute "w:id" of element "w:bookmarkEnd"
                lr_attribute = lr_attributes->get_named_item(
                  NAME      = 'id'
                  NAMESPACE = 'w'
                lv_id_end = lr_attribute->get_value( ).
              endif.
              if lv_id_start = lv_id_end.
                lr_node_parent = lr_node->get_parent( ).
                lr_node_bookmarkEnd = lr_node.
                er_node_bookmarkEnd = lr_node.
                exit.
              else.
                lr_node_next = lr_node->get_next( ).
    * remove elements between bookmarkStart and bookmarkEnd
                lr_node->remove_node( ).
              endif.
            enddo.
    * insert new elements between boomarkStart and bookmarkEnd
    CALL METHOD me->XML_RUN_TEXT_ADD
              EXPORTING
                IR_PARENT = lr_node_parent
                IR_REF    = lr_node_bookmarkEnd
                IV_VALUE  = iv_value
              IMPORTING
                EV_OK     = lv_bookmark_ok.
      EXIT.
    ENDDO.
    For example, XML with bookmark:
    <w:bookmarkStart w:id="0" w:name="testing123"/>
    <w:r>
    <w:t>This is sentence two.</w:t>
    </w:r>
    </w:p>
    <w:p>
    <w:r>
    <w:t xml:space="preserve">This </w:t>
    </w:r>
    <w:bookmarkEnd w:id="0"/>
    4. replace file 'word/document.xml' in zip (.docx) with class CL_ABAP_ZIP.
    CL_ABAP_ZIP->DELETE
    CL_ABAP_ZIP->ADD
    5. You can store result where you need.
    6. You can use for editing by users classic dynpro with container with word.

  • Passing databse functions with parameters as custom parameters from comand

    Hi,
    I have a database function get_id(ichar varchar2) which will return a number which I am trying to pass to a mapping as custom inout parameter using the following command:
    @SQLplus_exec_template.sql RTUSER RTLOC PLSQL mapname "," "INPUT_ID=sample_pkg.get_id('I')"
    and I get the following error
    ------ start----------
    Session altered.
    Role set.
    override_custom_input_params(l_audit_execution_id, 'IN_FROM_DATE=1999/01/0108:00,IN_TO_DATE=2003/12/3108:00,BL_LOAD_ID=bl_job_control.get_bl_load_id('I')');
    ERROR at line 215:
    ORA-06550: line 215, column 155:
    PLS-00103: Encountered the symbol "I" when expecting one of the following:
    . ( ) , * @ % & | = - + < / > at in is mod not range rem =>
    .. <an exponent (**)> <> or != or ~= >= <= <> and or like
    between ||
    The symbol ". was inserted before "I" to continue.
    ------ end ----------
    However, the command line with NO parameter to the function like the following command works perfect:
    @SQLplus_exec_template.sql RTUSER RTLOC PLSQL mapname "," "INPUT_ID=sample_pkg.get_id"
    Will OWB commandline not accept function call with parameters? Please treat this as urgent and advice ASAP.
    Thanks.

    Thanks, Mark. It works.However facing another issue. I try to pass to_char(sysdate\,''yyyy/mm/ddhh:mi:ss'') as one of the custom parameters to the mapping as
    @SQLplus_exec_template.sql RTUSER RTLOC PLSQL mapname "," "INPUT_STDT=2002/10/2010:10:03,INPUT_enddt=to_char(sysdate\,''yyyy/mm/ddhh:mi:ss'')"
    and it erros out as
    ------ start ------
    ORA-01841: (full) year must be between -4713 and +9999, and not be 0 ORA-06512: at line 1
    ------ end ------
    Questions:
    1. Why does a simple to_char(sysdate\,'yyyy/mm/ddhh:mi:ss') as an input parameter fail?
    2.what is the date format that OWB expects when we pass date as an input parameter.Can the format be modified?
    OWB seems to accept the format yyyy/dd/mm only. If I pass as different format, it errors with ORA 1861 Text: literal does not match format string.
    3. Where can I change the format in OWB if it can be changed.
    NOTE: OWB complains only about INPUT_ENDDT and not INPUT_STDT because, if I hardcode INPUT_ENDDT like 2003/11/178:00 it works.
    example:
    @SQLplus_exec_template.sql RTUSER RTLOC PLSQL mapname "," INPUT_STDT=2002/10/2008:00,INPUT_ENDDT=2003/11/1706:45:59"
    works fine.
    Am I missing something here?
    Thanks again.

  • PreparedStatements with parameters inside functions

    With PreparedStatements, can I use parameters inside of functions. For example, instead of doing:
    stmt = conn.prepareStatement("INSERT INTO MyTable (EncData) VALUES (ENCRYPTBYKEY(KEY_GUID('MyKey'), 'ABCDEF''))");
    I want to do:
    stmt = conn.prepareStatement("INSERT INTO MyTable (EncData) VALUES (ENCRYPTBYKEY(KEY_GUID('MyKey'), ?))");
    stmt.setString(1, "ABCDEF");
    I am getting a 'String or binary data would be truncated' exception when trying this.
    Thanks,
    Kevin

    OK ... let me take you a couple steps back ...
    I can get PreparedStatements to work in Java (J2SE1.5):
    stmt = conn.prepareStatement("INSERT INTO MyTable (Data) VALUES (?)");
    stmt.setString(1, "ABCDEF");
    However, the previous example does not work through SQL Server Management Studio ... it gives a syntax error:
    INSERT INTO MyTable (Data) VALUES (?)
    Moving onto my issue, how do I get PreparedStatement parameters to work within a function:
    stmt = conn.prepareStatement("INSERT INTO MyTable (EncData) VALUES (ENCRYPTBYKEY(KEY_GUID('MyKey'), ?))");
    stmt.setString(1, "ABCDEF");
    And as mentioned earlier, the following works fine in Java J2SE 1.5
    stmt = conn.prepareStatement("INSERT INTO MyTable (EncData) VALUES (ENCRYPTBYKEY(KEY_GUID('MyKey'), 'ABCDEF'))");
    So, in conclusion:
    I can successfully make PreparedStatements perform inserts using parameters in Java
    I can successfully make PreparedStatements perform inserts in Java using the encryption function
    However, I cannot make PreparedStatements perform inserts using parameters in the encryption function in Java
    I cannot get a simple example of PreparedStatements to work in SQL Server Management Studio ... and wouldn't expect to ...
    Thanks,
    Kevin

  • Discoverer report with parameters and functions

    I am new to Discoverer. Is there a way to create a report (with parameters) of one line per customer such that the following data will be displayed for each customer?
    Among the parameters is: from_date (month & year) ,to_date
    The basic query gives totals for each date (month & year) for every customer.
    Among the fields displayed:
    1-customer_id,
    2-balance until from_date,
    3-total activity between from_date and to_date
    I have a function to calculate the total balance until from_date, but then I cannot get the total activity on the same line. I tried using another function and I tried using a total calculation but to no success.
    Is this possible?
    Thanks.

    Hi Markus
    You need to determine whether you can in fact call a Discoverer report using a URL before linking it in Portal. You need to run the report in Viewer first and then see copy the URL from the address line of the browser. Then you open another browser and paste the URL. You may well be prompted for a username and password but hopefully the correct report with the right parameters will then execute.
    Assuming this works you then paste the same URL link into Portal and you should be able to get the report to run.
    Best wishes
    Michael

  • Multi-table INSERT with PARALLEL hint on 2 node RAC

    Multi-table INSERT statement with parallelism set to 5, works fine and spawns multiple parallel
    servers to execute. Its just that it sticks on to only one instance of a 2 node RAC. The code I
    used is what is given below.
    create table t1 ( x int );
    create table t2 ( x int );
    insert /*+ APPEND parallel(t1,5) parallel (t2,5) */
    when (dummy='X') then into t1(x) values (y)
    when (dummy='Y') then into t2(x) values (y)
    select dummy, 1 y from dual;
    I can see multiple sessions using the below query, but on only one instance only. This happens not
    only for the above statement but also for a statement where real time table(as in table with more
    than 20 million records) are used.
    select p.server_name,ps.sid,ps.qcsid,ps.inst_id,ps.qcinst_id,degree,req_degree,
    sql.sql_text
    from Gv$px_process p, Gv$sql sql, Gv$session s , gv$px_session ps
    WHERE p.sid = s.sid
    and p.serial# = s.serial#
    and p.sid = ps.sid
    and p.serial# = ps.serial#
    and s.sql_address = sql.address
    and s.sql_hash_value = sql.hash_value
    and qcsid=945
    Won't parallel servers be spawned across instances for multi-table insert with parallelism on RAC?
    Thanks,
    Mahesh

    Please take a look at these 2 articles below
    http://christianbilien.wordpress.com/2007/09/12/strategies-for-rac-inter-instance-parallelized-queries-part-12/
    http://christianbilien.wordpress.com/2007/09/14/strategies-for-parallelized-queries-across-rac-instances-part-22/
    thanks
    http://swervedba.wordpress.com

  • How to call PDF Report with parameters in jdeveloper 10.1.3

    Hi all,
    how to call PDF Report with parameters in jdeveloper 10.1.3
    for example I have Report name is repdept.pdf with parameter as deptno
    and I want call this Report from JSP page ?
    thanks
    frank

    Hi all,
    how to call PDF Report with parameters in jdeveloper 10.1.3
    for example I have Report name is repdept.pdf with parameter as deptno
    and I want call this Report from JSP page ?
    thanks
    frank

  • I cann't execute javac with parameters. please help !!

    Hi All!!
    I can't understand how to execute application or bat file (javac.exe for example) WITH parameters correctly.
    I can execute javac.exe or bat file - WITHOUT parameters :
    Process p = Runtime.getRuntime().exec(WIN_PATH + " " + WIN_FLAG + " " + "javac.exe");
    But I can't execute correctly the command like:
    "javac.exe -classpath C:\Alex; Test.java"
    I tried to use exec(str,env[]) and exec(cmd[]) methods, but there were different errors as a result :(((
    How can I execute the command "javac.exe -classpath C:\Alex; Test.java" ? Is it possible?
    Please help me by a good idea.
    Thank you.

    right you are! That's why we use "\\" instead "\" :)
    If i try to execute this command -
    cmd=WIN_PATH + " " + WIN_FLAG + " " + "c:/j2sdk1.4.0/deleteMe/javac.exe -classpath C:/WORK/jboss-3.0.3/client/jboss-j2ee.jar;S:/Alexander/jars/sys.jar;S:/Alexander/jars/ejb_conf_dev.jar;S:/Alexander/jars/; C:/j2sdk1.4.0/deleteMe/aaBean.java";
    my OS Windows 2000 returns na error - "Error opening icon..."
    What's wrong?
    Thank you...

Maybe you are looking for