Insert record using stored procedure

Dear all,
I want to insert record using stored procedure in form6i,
any help or suggestion will be appreciated.
regards
Kashif Ali

Kashif,
Could you please explain what you are trying to accomplish? Inserting records into a table from Forms is as simple as executing an INSERT statement in a Forms trigger or as complicated as overriding the Forms default INSERT functionality by defining your own On-Insert trigger. Your requirements will dictate where and how you do your INSERT.
Craig...

Similar Messages

  • Inserting data using stored procedure

    Using SQL Server Express 2014, I'm creating a stored procedure to accept parameters and convert data from a staging table to a production table. The parameters specify the table names and a field to lookup in another table. This is the first stored procedure
    I've tried to create by myself though and I'm basing it on a guide. Here's what I've got so far:
    CREATE PROCEDURE [dbo].[stp_UpdateAggregatePerf]
    @prod_tbl NVARCHAR(250), @stg_tbl NVARCHAR(250), @customer NVARCHAR(20)
    AS
    BEGIN
    DECLARE @p NVARCHAR(250), @s NVARCHAR(250), @c NVARCHAR(20), @cid int, @sql NVARCHAR(MAX)
    SET @p = @prod_tbl
    SET @s = @stg_tbl
    SET @c = @customer
    SET @cid = 'SELECT [dbo].[Customers].[CustomerID]
    FROM dbo.customers
    WHERE [dbo].[Customers].[CustomerName] LIKE ' + @c
    SET @sql = 'INSERT INTO ' + @prod_tbl + '
    SELECT CONVERT (datetime,TimeIndex,103) AS TimeIndex,
    CONVERT(decimal(10,3),user_reads,3) AS Reads,
    CONVERT(decimal(10,3), user_writes,3) AS Writes,
    CONVERT(decimal,10,3),total_transfers,3) AS Total,
    CONVERT(decimal(10,3),cp_reads,3) AS CPReads,
    SUBSTRING(AggregateName,1,25),
    SUBSTRING(ControllerName,1,25),
    SUBSTRING(@cid,1,25)
    FROM' + @stg_tbl
    EXEC sp_executesql @sql
    SET @sql = 'DROP TABLE' + @stg_tbl
    EXEC sp_executesql @sql
    END
    So it should accept the parameters, take the customer name parameter and look up the customer ID field from another table to use in the last column, then generate and run the INSERT INTO statement to convert and transfer data, then drop the staging table.
    I'm not sure how to go about using the INSERT statement with variables though, or even if I'm concatenating the string together correctly.
    Here's my CREATE statements for the tables:
    prod table:
    CREATE TABLE [dbo].[AggregatePerf](
    [AggrPerfID] [int] IDENTITY(1,1) NOT NULL,
    [AggregateName] [varchar](25) NOT NULL,
    [TimeIndex] [datetime] NOT NULL,
    [Reads] [decimal](10, 3) NOT NULL,
    [Writes] [decimal](10, 3) NOT NULL,
    [Total] [decimal](10, 3) NOT NULL,
    [CPReads] [decimal](10, 3) NOT NULL,
    [ControllerName] [varchar](25) NOT NULL,
    [CustomerID] [varchar](10) NOT NULL,
    CONSTRAINT [PK_AggregatePerf] PRIMARY KEY CLUSTERED
    [AggrPerfID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    Staging:
    CREATE TABLE [dbo].[$tablename] (
    [TimeIndex] VARCHAR(100)
    , [user_reads] VARCHAR(100)
    , [user_writes] VARCHAR(100)
    , [cp_reads] VARCHAR(100)
    , [total_transfers] VARCHAR(100)
    , [AggregateName] VARCHAR(100)
    , [ControllerName] VARCHAR(100)
    The staging table is generated from PowerShell to import CSVs but I'm past that stage of the project now. I hope you can help  me get an understanding here as once I wrap my around one table I can apply the same technique to others.
    Thanks in advance
    Adam

    Why do you provide a tables as a parameters? I think you may avoid using dynamic sql and simple use a static one.
    Where do you use @cid
    variable?
    Static SQL may look like
    SELECT @cid=
    [dbo].[Customers].[CustomerID]
    FROM dbo.customers
    WHERE [dbo].[Customers].[CustomerName] LIKE '%'+@c+'%'
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Adding Records Using Stored Procedure (or Cursor?)

    Also, I would like to have a second example of a stored procedure that will add random rows to a table (that is, create duplicates of information already in the table).
    For example,
    IF p_value1 = 'FIRST_VALUE' then
    add this record (incl. seq_no for key);
    ELSIF p_value2 = 'SECOND_VALUE' then
    add that record (incl. seq_no for key);
    and on and on.
    This procedure should also be able to handle random insertion up to several thousand rows. So, I know that I need to loop, say:
    while v_ctr < 1000
    or
    for 1...999
    Much thanks to anyone who can help.
    Many thanks to anyone who can help.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Colin Berrouard ([email protected]):
    You should look in a PL/SQl book,
    There are a lot of examples that can help you
    <HR></BLOCKQUOTE>
    I have already, but when trying to self-learn without not any familiarity with certain concepts and being at most a visual learner, I'm not getting this concept at this point...hence the reason why I asked.
    Thanks.

  • INSERT'ing using Stored Procedure

    I want to make my VB.NET application performing INSERT's by calling a Stored Procedure. How do I supply the column values (without using numerous IN parameters) ?
    E.g.
    create procedure my_ins(my_row my_tab%rowtype)
    is
    How do I call this procedure from VB.NET ?
    Any help appreciated!
    Runar Emgård
    [email protected]

    It contains multiple datatypes, according to the columns of the underlying table "my_tab".

  • How can i inserts record using procedure in adf

    how can i insert record using procedure
    hi i have the following i what to insert record using store procedure, i try this
    am in JDeveloper Studio 11.1.2.1.0
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="SmsPartyAddressView"
      Version="11.1.2.60.81"
      BindingStyle="OracleName"
      CustomQuery="true"
      PageIterMode="Full"
      UseGlueCode="false"
      RowClass="sms1100.SmsPartyAddressViewRowImpl"
      ComponentClass="sms1100.SmsPartyAddressViewImpl"
      DefClass="sms1100.SmsPartyAddressViewDefImpl"
      RowInterface="sms1100.common.SmsPartyAddressViewRow"
      ClientRowProxyName="sms1100.client.SmsPartyAddressViewRowClient">
      <DesignTime>
        <Attr Name="_isExpertMode" Value="true"/>
        <Attr Name="_codeGenFlag2" Value="Access|Def|Coll|Prog|VarAccess"/>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
      <Properties>
        <SchemaBasedProperties>
          <LABEL
            ResId="sms1100.SmsPartyAddressView_LABEL"/>
        </SchemaBasedProperties>
      </Properties>
      <ViewAccessor
        Name="Sub_lov1"
        ViewObjectName="sms1100.Sub_lov"
        RowLevelBinds="true"/>
      <ListBinding
        Name="LOV_Town"
        ListVOName="Sub_lov1"
        ListRangeSize="-1"
        ComboRowCountHint="10"
        NullValueFlag="none"
        MRUCount="0">
        <AttrArray Name="AttrNames">
          <Item Value="Town"/>
        </AttrArray>
        <AttrArray Name="DerivedAttrNames">
          <Item Value="Suburb"/>
          <Item Value="PostalCode"/>
          <Item Value="TowId"/>
        </AttrArray>
        <AttrArray Name="ListAttrNames">
          <Item Value="Town"/>
          <Item Value="Suburb"/>
          <Item Value="PostalCode"/>
          <Item Value="Id"/>
        </AttrArray>
        <AttrArray Name="ListDisplayAttrNames">
          <Item Value="Town"/>
          <Item Value="Suburb"/>
          <Item Value="PostalCode"/>
          <Item Value="DsdRegion"/>
          <Item Value="ServiceDeliveryArea"/>
        </AttrArray>
        <DisplayCriteria/>
      </ListBinding>
      <SQLQuery><![CDATA[SELECT
           SmsPartyAddress.ADDRESS_LINE1,
           SmsPartyAddress.ID,
           SmsPartyAddress.ADDRESS_LINE2,
           SmsPartyAddress.ADDRESS_LINE3,
           SmsPartyAddress.ADDRESS_LINE4,
           SmsPartyAddress.ADDRESS_TYPE_IND,
           SmsPartyAddress.PAR_ID,
           SmsPartyAddress.PROP_ID,
           SmsPartyAddress.START_DT,
             SmsProperties.ERF_NO,
           SmsProperties.ADDRESS_LINE,
           SmsProperties.ZONE,
           SmsProperties.GPS_LONGITUDE,
           SmsProperties.GPS_LATITUDE,
           SmsProperties.TOW_ID,
           SmsProperties.WAR_ID,
            DECODE(TOW1.TOWN,NULL,TOW.TOWN,TOW1.TOWN)TOWN ,
           TOW.TOWN SUBURB,
           POSTAL_CODE
    FROM SMS_PARTY_ADDRESS SmsPartyAddress,
         SMS_PROPERTIES SmsProperties,
          SMS_TOWNS TOW
        ,SMS_TOWNS TOW1
        ,SMS_POSTAL_CODES PCOD
          WHERE TOW.PCOD_ID = PCOD.ID
        AND TOW.TOW_ID = TOW1.ID (+)
        --and TOW1.ID = SMSPROPERTIES.TOW_ID(+)
        and TOW.ID = SMSPROPERTIES.TOW_ID
        and SMSPARTYADDRESS.PROP_ID = SMSPROPERTIES.ID
         CONNECT BY PRIOR TOW.TOW_ID = TOW.ID]]></SQLQuery>
      <EntityUsage
        Name="SmsPartyAddress"
        Entity="sms1100.SmsPartyAddress"/>
      <ViewAttribute
        Name="AddressLine1"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE1"
        Expression="ADDRESS_LINE1"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Id"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="java.math.BigInteger"
        ColumnType="NUMBER"
        AliasName="ID"
        Expression="ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="AddressLine2"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE2"
        Expression="ADDRESS_LINE2"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressLine3"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE3"
        Expression="ADDRESS_LINE3"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressLine4"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="50"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE4"
        Expression="ADDRESS_LINE4"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="50"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressTypeInd"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="java.math.BigInteger"
        ColumnType="NUMBER"
        AliasName="ADDRESS_TYPE_IND"
        Expression="ADDRESS_TYPE_IND"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="ParId"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        AliasName="PAR_ID"
        Expression="PAR_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="PropId"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="java.math.BigInteger"
        ColumnType="NUMBER"
        AliasName="PROP_ID"
        Expression="PROP_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="StartDt"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.sql.Timestamp"
        ColumnType="DATE"
        AliasName="START_DT"
        Expression="START_DT"
        SQLType="DATE"/>
      <ViewAttribute
        Name="ErfNo"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="80"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ERF_NO"
        Expression="ERF_NO"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="80"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressLine"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="120"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE"
        Expression="ADDRESS_LINE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="120"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Zone"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="20"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ZONE"
        Expression="ZONE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="20"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="GpsLongitude"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="40"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="GPS_LONGITUDE"
        Expression="GPS_LONGITUDE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="40"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="GpsLatitude"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="40"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="GPS_LATITUDE"
        Expression="GPS_LATITUDE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="40"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="TowId"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="java.math.BigInteger"
        ColumnType="NUMBER"
        AliasName="TOW_ID"
        Expression="TOW_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="WarId"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.Integer"
        ColumnType="NUMBER"
        AliasName="WAR_ID"
        Expression="WAR_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="Town"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="60"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="TOWN"
        Expression="TOWN"
        SQLType="VARCHAR"
        LOVName="LOV_Town">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="60"/>
        </DesignTime>
        <Properties>
          <SchemaBasedProperties>
            <CONTROLTYPE
              Value="combo_lov"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>
      <ViewAttribute
        Name="Suburb"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="60"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="SUBURB"
        Expression="SUBURB"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="60"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="PostalCode"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="4"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="POSTAL_CODE"
        Expression="POSTAL_CODE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="4"/>
        </DesignTime>
      </ViewAttribute>
      <ResourceBundle>
        <PropertiesBundle
          PropertiesFile="SmsFrontService.SmsFrontServiceBundle"/>
      </ResourceBundle>
    </ViewObject>my calling method is
    public class SmsPartyAddressViewRowImpl extends ViewRowImpl implements SmsPartyAddressViewRow {
        protected void callNewProperty(String stmt, Object[] bindVars) {
                   PreparedStatement st;
                   st = null;
                   try {
                       // 1. Create a JDBC PreparedStatement for
                       st = getDBTransaction().createPreparedStatement("begin " + stmt + ";end;", 0);
                       if (bindVars != null) {
                           // 2. Loop over values for the bind variables passed in, if any
                           for (int z = 0; z < bindVars.length; z++) {
                               // 3. Set the value of each bind variable in the statement
                               st.setObject(z + 1, bindVars[z]);
                       // 4. Execute the statement
                       st.executeUpdate();
                   } catch (SQLException e) {
                       throw new JboException(e);
                   } finally {
                       if (st != null) {
                           try {
                               // 5. Close the statement
                             st.close();
                           } catch (SQLException e) {
        protected void callInsertProcedure(TransactionEvent e) {
           // String Addressline = null;
            String Zone = "UNDERF";
            Date StartDt = null;
           // EntityDefImpl SmsPropertiesDef = SmsPropertiesImpl.getDefinitionObject();
           // SmsPropertiesImpl newSmsProperties = (SmsPropertiesImpl)SmsPropertiesDef.createInstance2(getDBTransaction(), null);
        callNewProperty("Sms_Location.newProp(?,?,?,?,?,?,?,?,?,?,?,?)",
        new Object[] { getParId(), getAddressTypeInd(), getAddressLine1(),
        getAddressLine2(), getAddressLine3(), getAddressLine4(),getAddressLine(),getSuburb(),getTown(),getPostalCode(),getTowId(),Zone,StartDt });
    Edited by: ADF007 on 2012/08/13 6:59 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    that solution was based on the hr schema now am inserting using my schema
    inserting record in a view using procedure
    hi i have the folowing view, i what to insert record using procedure,this is what i what ,i what to insert record using the view but pass those view variable to procedure. my view is
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="smsproppartyview"
      Version="11.1.2.60.81"
      BindingStyle="OracleName"
      CustomQuery="true"
      PageIterMode="Full"
      UseGlueCode="false"
      RowClass="sms1100.smsproppartyviewRowImpl"
      ComponentClass="sms1100.smsproppartyviewImpl"
      RowInterface="sms1100.common.smsproppartyviewRow"
      ClientRowProxyName="sms1100.client.smsproppartyviewRowClient">
      <DesignTime>
        <Attr Name="_isExpertMode" Value="true"/>
        <Attr Name="_codeGenFlag2" Value="Access|Coll|Prog|VarAccess"/>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
      <Properties>
        <SchemaBasedProperties>
          <LABEL
            ResId="sms1100.smsproppartyview_LABEL"/>
        </SchemaBasedProperties>
      </Properties>
      <ViewAccessor
        Name="Sub_lov1"
        ViewObjectName="sms1100.Sub_lov"
        RowLevelBinds="true"/>
      <ListBinding
        Name="LOV_Town"
        ListVOName="Sub_lov1"
        ListRangeSize="-1"
        ComboRowCountHint="10"
        NullValueFlag="none"
        MRUCount="0">
        <AttrArray Name="AttrNames">
          <Item Value="Town"/>
        </AttrArray>
        <AttrArray Name="DerivedAttrNames">
          <Item Value="Suburb"/>
          <Item Value="PostalCode"/>
          <Item Value="TowId"/>
        </AttrArray>
        <AttrArray Name="ListAttrNames">
          <Item Value="Town"/>
          <Item Value="Suburb"/>
          <Item Value="PostalCode"/>
          <Item Value="Id"/>
        </AttrArray>
        <AttrArray Name="ListDisplayAttrNames">
          <Item Value="Town"/>
          <Item Value="Suburb"/>
          <Item Value="PostalCode"/>
          <Item Value="DsdRegion"/>
          <Item Value="ServiceDeliveryArea"/>
        </AttrArray>
        <DisplayCriteria/>
      </ListBinding>
      <SQLQuery><![CDATA[SELECT
           SmsPartyAddress.ID,
           SmsPartyAddress.ADDRESS_LINE2,
           SmsPartyAddress.ADDRESS_LINE3,
           SmsPartyAddress.ADDRESS_LINE4,
           SmsPartyAddress.ADDRESS_LINE1,
            SmsProperties.ADDRESS_LINE,     
            DECODE(TOW1.TOWN,NULL,TOW.TOWN,TOW1.TOWN)TOWN ,
           TOW.TOWN SUBURB,
           POSTAL_CODE,
            SmsPartyAddress.PAR_ID,
           SmsPartyAddress.PROP_ID,
            SmsProperties.ID AS ID1,
           SmsPartyAddress.ADDRESS_TYPE_IND,      
           SmsPartyAddress.START_DT,
           SmsProperties.TOW_ID,
           SmsProperties.ERF_NO,
           SmsProperties.WAR_ID,
           SmsProperties.ZONE
    FROM SMS_PARTY_ADDRESS SmsPartyAddress, SMS_PROPERTIES SmsProperties,
    SMS_TOWNS TOW
        ,SMS_TOWNS TOW1
        ,SMS_POSTAL_CODES PCOD
    WHERE SmsPartyAddress.PROP_ID = SmsProperties.ID
    and TOW.PCOD_ID = PCOD.ID
        AND TOW.TOW_ID = TOW1.ID (+)
        --and TOW1.ID = SMSPROPERTIES.TOW_ID(+)
        and TOW.ID = SMSPROPERTIES.TOW_ID
        and SmsPartyAddress.prop_id = SmsProperties.id
         CONNECT BY PRIOR TOW.TOW_ID = TOW.ID]]></SQLQuery>
      <ViewAttribute
        Name="Id"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        AliasName="ID"
        SQLType="NUMERIC">
        <RecalcCondition><![CDATA[true]]></RecalcCondition>
        <TransientExpression><![CDATA[(new oracle.jbo.server.SequenceImpl("SMS_MAST1_SEQ",adf.object.getDBTransaction())).getSequenceNumber()]]></TransientExpression>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressLine2"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE2"
        Expression="ADDRESS_LINE2"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressLine3"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE3"
        Expression="ADDRESS_LINE3"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressLine4"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="50"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE4"
        Expression="ADDRESS_LINE4"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="50"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressLine1"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="100"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE1"
        Expression="ADDRESS_LINE1"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="100"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressLine"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="120"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ADDRESS_LINE"
        Expression="ADDRESS_LINE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="120"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Town"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="60"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="TOWN"
        Expression="TOWN"
        SQLType="VARCHAR"
        LOVName="LOV_Town">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="60"/>
        </DesignTime>
        <Properties>
          <SchemaBasedProperties>
            <CONTROLTYPE
              Value="combo_lov"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>
      <ViewAttribute
        Name="Suburb"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="60"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="SUBURB"
        Expression="SUBURB"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="60"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="PostalCode"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="4"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="POSTAL_CODE"
        Expression="POSTAL_CODE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="4"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="ParId"
        IsPersistent="false"
        PrecisionRule="true"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        AliasName="PAR_ID"
        Expression="PAR_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="PropId"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        AliasName="PROP_ID"
        Expression="PROP_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="Id1"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        AliasName="ID1"
        SQLType="NUMERIC">
        <RecalcCondition><![CDATA[true]]></RecalcCondition>
        <TransientExpression><![CDATA[(new oracle.jbo.server.SequenceImpl("SMS_MAST1_SEQ",adf.object.getDBTransaction())).getSequenceNumber()]]></TransientExpression>
      </ViewAttribute>
      <ViewAttribute
        Name="AddressTypeInd"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        AliasName="ADDRESS_TYPE_IND"
        Expression="ADDRESS_TYPE_IND"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="StartDt"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.sql.Timestamp"
        ColumnType="DATE"
        AliasName="START_DT"
        SQLType="DATE">
        <RecalcCondition><![CDATA[true]]></RecalcCondition>
        <TransientExpression><![CDATA[adf.currentDate]]></TransientExpression>
      </ViewAttribute>
      <ViewAttribute
        Name="TowId"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="38"
        Scale="0"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        AliasName="TOW_ID"
        Expression="TOW_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="ErfNo"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="80"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ERF_NO"
        Expression="ERF_NO"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="80"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="WarId"
        IsPersistent="false"
        PrecisionRule="true"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        AliasName="WAR_ID"
        Expression="WAR_ID"
        SQLType="NUMERIC"/>
      <ViewAttribute
        Name="Zone"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="20"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="ZONE"
        Expression="ZONE"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="20"/>
        </DesignTime>
      </ViewAttribute>
      <ResourceBundle>
        <PropertiesBundle
          PropertiesFile="SmsFrontService.SmsFrontServiceBundle"/>
      </ResourceBundle>
    </ViewObject>this is what i have try
    public class smsproppartyviewImpl extends ViewObjectImpl {
        protected void callNewProperty(String stmt, Object[] bindVars) {
                   PreparedStatement st;
                   st = null;
                   try {
                       // 1. Create a JDBC PreparedStatement for
                       st = getDBTransaction().createPreparedStatement("begin " + stmt + ";end;", 0);
                       if (bindVars != null) {
                           // 2. Loop over values for the bind variables passed in, if any
                           for (int z = 0; z < bindVars.length; z++) {
                               // 3. Set the value of each bind variable in the statement
                               st.setObject(z + 1, bindVars[z]);
                       // 4. Execute the statement
                       st.executeUpdate();
                   } catch (SQLException e) {
                       throw new JboException(e);
                   } finally {
                       if (st != null) {
                           try {
                               // 5. Close the statement
                             st.close();
                           } catch (SQLException e) {
        protected void callInsertProcedure(TransactionEvent e) {
            String Addressline = null;
            String Zone = "UNDERF";
            String Town = null;
            String Suburb = null;
            String PostalCode = null;
            String Addressline1 = null;
            String Addressline2 = null;
            String Addressline3 = null;
            String Addressline4 = null;
            Integer AddressTypeInd = null;
            Integer parid = null;
            //Date StartDt = null;
            Integer towid = null;
            ApplicationModuleHandle handle = null;
                               handle = Configuration.createRootApplicationModuleHandle
                               ("sms1100.sms1100Moduleold", "sms1100ModuleShared");
                               ApplicationModule sam = handle.useApplicationModule();
                               sam.processChangeNotifications();
            ViewObject svo = sam.findViewObject("smsproppartyview1");
            svo.executeQuery();
            Row row = svo.first();
            if (svo != null){
                Addressline = (String)row.getAttribute("AddressLine");
                Zone = (String)row.getAttribute("Zone");
                Town = (String)row.getAttribute("Town");
                Suburb = (String)row.getAttribute("Suburb");
                PostalCode = (String)row.getAttribute("PostalCode");
                towid = (Integer)row.getAttribute("TowId");
                Addressline1 = (String)row.getAttribute("Addressline1");
                Addressline2 = (String)row.getAttribute("Addressline2");
                Addressline3 = (String)row.getAttribute("Addressline3");
                Addressline4 = (String)row.getAttribute("Addressline4");
                AddressTypeInd = (Integer)row.getAttribute("AddressTypeInd");
                parid = (Integer)row.getAttribute("ParId");
            //EntityDefImpl SmsPropertiesDef = SmsPropertiesImpl.getDefinitionObject();
            //SmsPropertiesImpl newSmsProperties = (SmsPropertiesImpl)SmsPropertiesDef.createInstance2(getDBTransaction(), null);
            //newSmsProperties.setAddressLine(Addressline);
            //newSmsProperties.setTowId(towid);
        callNewProperty("Sms_Location.newProp(?,?,?,?,?,?,?,?,?,?,?,?)",
        new Object[] { parid, AddressTypeInd, Addressline1,
        Addressline2, Addressline3, Addressline4,Addressline,Town,Suburb,PostalCode,towid,Town,Suburb,PostalCode,towid,Zone });
    }am in Jdeveloper 11.1.2.1.0

  • Help: Using stored procedure to add new record in DB

    I am using stored procedures for a form. In DB, I have select and update procedures work without problems. However, for the insert procedure, it does not seem work right. Here is how things work for the insert procedure:
    1. On the form, I have an add record button, when this button is pressed, it calls the trigger "KEY_CREREC" with "create_record."
    2. A blank record is then shown on form. I then put in some test date. Apparently, this will cause "SYSTEM.STATUS" set to "CHANGED." when calling for commit, it only calls the DB update procedure.
    My question is how to make it call the insert procedure.
    Any suggestions are greatly appreciated.

    I just added to lines in key_commit to check the system.form_status:
    set_alert_property('AL_STOP', alert_message_text,'System Status: '||:system.form_status);
    al_button := show_alert('AL_STOP');
    After do_key('create_record') and some changes in fields, the :system.form_status shows "CHANGED.'
    Just wondering what will make the auto generated insert_procedure for the block to trigger. So far, no problems to do query and update with the DB stored procedure, but the insert does not seem working.
    Any help is greatly appreciated.
    P.S. The new post might be more clear:
    http://forums.oracle.com/forums/thread.jspa?threadID=675578&tstart=0
    Message was edited by:
    WJH

  • How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?

    Hi
    How to Insert date in 'DD/MM/YYYY' format in oracle using stored procedure?
    This is my Input data.
    11/25/2007.
    By using below query, it is inserted into database.
    sql>Insert into tblname values(to_date('11/25/2007','MM/DD/YYYY'));
    But using stored procedure, the same query is not running.
    It shows error like
    ORA-01843: not a valid month ORA-06512: at line 1
    Procedure:
    create or replace procedure Date_Test(datejoin in DATE) is
    begin
    insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    end Date_Test;
    I had used 'nls_date_language = american' also.
    Prcodeure is created but not worked in jsp. The same error is thrown.
    Pls provide a solution

    This might help you....
    SQL> Create Table DateTest(col1 Date);
    Table created.
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'MM/DD/YYYY'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    BEGIN Date_Test('11/25/2007'); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    BEGIN Date_Test(To_Date('11/25/2007','mm/dd/yyyy')); END;
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at "CTBATCH.DATE_TEST", line 3
    ORA-06512: at line 1
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in DATE) is
    2 begin
    3 insert into datetest values(datejoin);
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test(To_Date('11/25/2007','mm/dd/yyyy'));
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> Select * from DateTest;
    COL1
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL> create or replace procedure Date_Test(datejoin in VarChar2) is
    2 begin
    3 insert into datetest values(to_date(datejoin,'mm/dd/yyyy'));
    4 end ;
    5 /
    Procedure created.
    Elapsed: 00:00:00.00
    SQL> exec Date_Test('11/25/2007');
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select * from DateTest;
    COL1
    25-NOV-07
    25-NOV-07
    Elapsed: 00:00:00.00
    SQL>

  • Can we have an example of using update, insert, and delete stored procedure

    I would like to see an example of using retrieve (return resultset), update, insert, and delete stored procedures in JSF. I need to see syntax how JSF can call those stored procedures. This option is absolutely important when building web-application. Currently, I haven't found resource to do for this purpose yet. The database can be any such Oracle, DB2, pointbase, etc that support stored procedures.
    Anyone knows?
    Thanks,
    Tue Vu

    Hi ttv,
    I asked around a bit and here's some more info:
    To bind a ResultSet to a read only Data Table component just set the "value" property of the Data Table component to point at it, and JSF will synthesize a DataModel around it.
    * Note that because we can't call the stored procedure at design time, Creator can't do the fancy table layout stuff it does for rowsets. You'll need to hand craft the columns just like the Google Client example.
    * As I mentioned previously, you will have to manually code the stored procedure access in your java code - see the code clip I mentioned in previous reply (and if this is via a stored procedure, then any textbook about JDBC will undoubtedly have examples). Simplest way might be a getter method on the page bean that contains the call to the stored procedure and returns the resulting ResultSet object.
    * Don't forget to close the result set - we typically do this at the end of the request (i.e. add a close in the afterRenderResponse() method.
    * Don't throw exceptions - or if you have to, make sure you close the result set in a finally clause (thrown exceptions bypass the afterRenderResponse method in the lifecycle).
    * You give up on the caching provided by our RowSetDataModel (which can't be connected to a ResultSet even manually), so I would recommend that you only use datatables to display the data and then go to a single row page to do edits/deletes (similar to the TwoPage example in AppModel and the Update, Insert Delete tutorial).
    And yes please do submit an example - we will gladly post it!!! :) The best way to submit this kind of thing would be through:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
    on the right side, Related Links, under Creator Heros, click Submit Content and there you can send it in!
    Hope this helps!
    Val

  • Bulk insert using stored procedure or trigger

    Hi ,
    I have to insert around 40,000 rows in a table querying other database using database link.
    Please advice whether I do using stored procedure or trigger.
    Thanks.

    Here is a basic benchmark that illustrates the difference between maximising SQL, or doing it in PL/SQL instead.
    Care needs to be taken with such a benchmark in order for physical I/O not to negatively impact a test, and then have no impact in the second test as that data read from disk now sits in the cache.
    So I ran it a couple of times in order to "warm up" the cache. I also put the maximise-SQL test first in order to show that it is still faster, despite any physical I/O it may do (which will likely be faster logical I/O with the second test).
    Run on Oracle XE 10.2.0.1.
    SQL> drop table my_objects_copy purge;
    Table dropped.
    SQL> create table my_objects_copy as select * from all_objects;
    Table created.
    SQL>
    SQL> set timing on
    SQL> begin
    2 delete from my_objects_copy;
    3
    4 insert into my_objects_copy
    5 select * from all_objects;
    6
    7 commit;
    8 end;
    9 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.11
    SQL> set timing off
    SQL>
    SQL> drop table my_objects_copy purge;
    Table dropped.
    SQL> create table my_objects_copy as select * from all_objects;
    Table created.
    SQL>
    SQL> set timing on
    SQL> declare
    2 cursor c is select * from all_objects;
    3 objRow ALL_OBJECTS%ROWTYPE;
    4 begin
    5 delete from my_objects_copy;
    6
    7 open c;
    8 loop
    9 fetch c into objRow;
    10 exit when c%NOTFOUND;
    11
    12 insert into my_objects_copy
    13 values objRow;
    14
    15 end loop;
    16 commit;
    17 end;
    18 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:03.21
    SQL>
    The cursor-fetch-loop is almost 3 times slower. The more rows there are to process, the slower the cursor-fetch-loop will become, as it will create more and more context switching and copying data between the SQL and PL engines and back.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Using stored procedures for insert, update and delete

    Hello all;
    We have a question from our customer (who is the DBA), who has not in the past used TopLink, about whether it makes sense to tie TopLink into existing stored procedures to save and retrieve informations.
    Is it possible?
    Is there any circumstance under which it is a good idea?
    Thanks

    In TopLink any operation for which TopLink generates SQL, can be replaced by custom SQL, or a stored procedure call.
    Custom SQL or stored procedures can be used for each of the descriptor's CRUD operations, but also for mapping queries and named queries. The Mapping Workbench only supports defining custom SQL for the descriptor CRUD operations and named queries, so many of the stored procedures call from the descriptor and mappings will need to be done through amendment methods.
    Whether it makes sense or not depends on the application and the company and their requirements. It will add significant overhead to the development process to have to define and maintain all of the stored procedures, and the stored procedure calls in the descriptors. You may wish develop your application using TopLink generated SQL, and once you have the model and queries stabilized then switch to using stored procedures.
    Whether it is a good idea depends on the application and the company and their requirements. Stored procedures may give the DBA more freedom to change the data-model once in production, and may allow for adding database-level security checks. In general using stored procedures will not improve performance if the procedures contain the same SQL that would have be executed anyway, but they may allow for the DBA to tune the SQL better.

  • Why Dynamic Parameter is not working, when i create report using stored procedure ?

    Post Author: Shashi Kant
    CA Forum: General
    Hi all
    Why Dynamic Parameter is not working, when i create report XI using stored procedure ?
    Only i shaw those parameters which i used in my stored procedure, the parameter which i create dynamic using stored procedure
    is not shown to me when i referesh the report for viewing the results.
    I have used the same procedure which i mention below but can not seen the last screen which is shown in this .
    ============================================================================================
    1. Select View > Field Explorer2. Right-click on Parameter Fields and select New from the right-click menu.3. Enter u201CCustomer Nameu201D as the name for your parameter4. Under u201CList of Valuesu201D select u201CDynamicu201D5. Under the Value column, click where is says u201Cclick here to add itemu201D and select Customer Name from the drop-down list. The dialog shown now look like the one shown below in Figure 1. Click OK to return to your report design.
    Dynamic Parameter Setup6. Next, select Report > Select Expert, select the Customer Name field and click OK.7. Using the drop-down list beside select u201CIs Equal Tou201D and using the drop-down list, select your parameter field (it should be the first field). 8. Click OK to return to your report design and see the parameter dialog.The parameter dialog will appear and show you a dynamic list of values that is updated each time your run your report. It couldnu2019t be easier! In our next tutorial, we will be looking at how to use this feature to create cascading parameter fields, where the values are filtered by the preceding selection.
    Dynamic Parameters in Action
    My question is that whether dynamic parameter is working with storedprocedure or not.
    When i added one table and try to fetch records using dyanmic prameters. after that i am not be able to find the dynamic parameter option when i referesh my report.
    One more thing when i try the static parameter for my report, the option i see when i referesh the screen.
    Please reply soon , it's urgent
    Regards
    shashi kant

    Hi Kishore,
    I have tested the issue step by step by following you description, while the first issue works well in my local environment. Based on my research, this can be caused by the lookup expression or it indeed return Male value based on the logic. If you use the
    expression below, it will indeed only return the Male record. So please try to double-check the record in the two datasets and the expression in your environment:
    =lookup(first(Fields!ProgramID.Value,"DataSet1"),Fields!ProgramID.Value,Fields!Gender.Value,"DataSet2")
    As to the second issue, please try to use the following expression:
    =Count(Lookup(fields!ProgramID.value,fields!ProgramID.value,fields!Gender.value,"DataSet2"))
    Besides, if this issue still exist, in order to trouble shoot this issue more efficiently, could you please post both the .rdl  file with all the size properties to us by the following E-mail address?  It is benefit for us to do further analysis.
    E-mail: [email protected]
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Unable to run SSIS Package using Stored Procedure

    Hi Guys,
            I have create one simple SSIS Package(Move the first table record to second table).It will execute fine in locally.
    But, If i'm going call/execute .dtsx file using stored procedure. I'm getting Error. so please let me know the valuable solution.
    My Package Path : D:\Temp\SSIS_TESTING\TESTSSIS\TESTSSIS\Package.dtsx
    Stored Procedure
    ================
    CREATE PROCEDURE SPEXECUTESSISPACKAGE
    @FILEPATH VARCHAR(8000)
    ,@STATUS VARCHAR(500) = NULL OUTPUT
    AS
    BEGIN
    DECLARE @SQLQUERY VARCHAR(8000)
    DECLARE @STATUSCODE INT
    SET @SQLQUERY = 'DTEXEC /FILE "'+ @FILEPATH +'"'
    SELECT @SQLQUERY AS 'SSIS FULL PATH'
    EXEC @STATUSCODE = master..xp_cmdshell @SQLQUERY
    SELECT @STATUSCODE AS 'STATUSCODE'
    IF @STATUSCODE <> 0
    BEGIN
    SET @STATUS = 'PACAKGE EXECUTE FAILED'
    PRINT @STATUS
    END
    ELSE
    BEGIN
    SET @STATUS = 'PACAKGE EXECUTE SUCCESS'
    PRINT @STATUS
    END
    END
    GO
    RUN
    ============================================================================
    EXEC SPEXECUTESSISPACKAGE 'D:\Temp\SSIS_TESTING\TESTSSIS\TESTSSIS\Package.dtsx', NULL
    Error
    =============================================================================
    Microsoft (R) SQL Server Execute Package Utility
    Version 9.00.4035.00 for 32-bit
    Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
    NULL
    Started:  5:06:26 AM
    Error: 2014-11-14 05:06:26.07
       Code: 0xC0011007
       Source: {1244CD18-F96A-4DAD-8FC2-35F794015CA1}
       Description: Unable to load the package as XML because of package does not have a valid XML format. A specific XML parser error will be posted.
    End Error
    Error: 2014-11-14 05:06:26.07
       Code: 0xC0011002
       Source: {1244CD18-F96A-4DAD-8FC2-35F794015CA1}
       Description: Failed to open package file "D:\Temp\SSIS_TESTING\TESTSSIS\TESTSSIS\Package.dtsx" due to error 0x80070003 "The system cannot find the path specified.".  This happens when loading a package and the file cannot
    be opened or loaded correctly
    into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.
    End Error
    Could not load package "D:\Temp\SSIS_TESTING\TESTSSIS\TESTSSIS\Package.dtsx" because of error 0xC0011002.
    Description: Failed to open package file "D:\Temp\SSIS_TESTING\TESTSSIS\TESTSSIS\Package.dtsx" due to error 0x80070003 "The system cannot find the path specified.".  This happens when loading a package and the file cannot be opened
    or loaded correctly int
    o the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.
    Source: {1244CD18-F96A-4DAD-8FC2-35F794015CA1}
    Started:  5:06:26 AM
    Finished: 5:06:26 AM
    Elapsed:  0.047 seconds
    NULL
    I'm getting Execte SSIS Package Status : 4
    ===================================
    4

    Two things to check
    1. The account executing the package has access to the path. If package is stored in different server you need to pass the UNC path (ie like \\machinename\...)
    2. Make sure the version of SSIS service is the same in both the servers ie where package is created/stored and where its getting executed. A lower version SSIS service will not be able to load and execute higher version package and it will throw you similar
    error messages as you posted above.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • SSIS 2012 ETL is failing only at one server (No BIDS) but running successfully from BIDS on different sever . In this ETL, I have used Stored Procedure in OLEDB Source.

    Hi Guys,
    SSIS 2012 ETL is failing only at one server (No BIDS) but running successfully from BIDS on different sever . In this ETL, I have used Stored Procedure in OLEDB Source.
    Note: I have couple of ETLs developed in 2005 using same logic and upgraded to 2012, working perfectly.
    I am getting Error Message:
    SSIS
    Error Code
    DTS_E_OLEDBERROR. 
    An OLE DB
    error has occurred.
    Error code: 0x80004005.
    An
    OLE DB
    record is available. 
    Source: "Microsoft OLE DB Provider for SQL Server" 
    Hresult: 0x80004005 
    Description: "Error converting data type varchar to datetime.".
    Unable
    to retrieve
    column information
    from the data
    source. Make
    sure your target
    table in
    the database is
    available.
    "OLE DB Source"
    failed validation
    and returned
    validation status
    "VS_ISBROKEN".
    I tried below word around and found It is working perfectly.
    I loaded data into a table (dbo.TEMP) using Stored procedure and then I used this dbo.TEMP table in OLEDB source and then found no issue.
    MY SP Details: (This SP I am calling in OLEDB source of ETL) and when I run it from one server IT is working fine and when I run from ETL dedicated Server getting error:   Guys Help me out.
    USE
    [TEST_DB]
    GO
    SET
    ANSI_NULLS ON
    GO
    SET
    QUOTED_IDENTIFIER ON
    GO
    ALTER
    PROCEDURE  [DBO].[SP_TEST]
    --EXEC [DBO].[SP_TEST] '2014-09-30','2014-10-01'
    @FROMDATETIME
    DATETIME,
    @TODATETIME
    DATETIME
    AS
    SET
    NOCOUNT ON
    BEGIN
    DECLARE
    @FROMDATEKEY INT,
    @TODATEKEY INT,
    SET
    @FROMDATEKEY=
    CONVERT(VARCHAR(10),@FROMDATETIME,112)
    SET
    @TODATEKEY=
    CONVERT(VARCHAR(10),@TODATETIME,112)
    IF 1 = 1
    BEGIN
    SELECT
    CAST(NULL
    AS DATETIME) 
    AS TXN_DATE
    , CAST(NULL
    AS DATETIME
    ) AS PROCESS_DATE     
    , CAST(NULL
    AS money)
    AS  S1_AMT
    , CAST(NULL
    AS money)
    AS  S2_AMOUNT
    , CAST(NULL
    AS money)
    AS  S2_INVALID_AMOUNT
    , CAST(NULL
    AS money)
    AS  INVALID_MOVED_IN_VALID_S2_AMOUNT
    , CAST(NULL
    AS VARCHAR(20))
    AS SYSTEM_ID
    , CAST(NULL
    AS money)
    AS  S3_AMT
    END
    SELECT
    TXN_DATE
    ,PROCESS_DATE
    ,S1_AMT
    ,S2_AMOUNT
    ,S2_INVALID_AMOUNT
    ,INVALID_MOVED_IN_VALID_S2_AMOUNT
    ,SYSTEM_ID
    S3_AMT
    FROM
    DBO.TABLE_1
    WHERE TNX_DATE_KEY
    BETWEEN @FROMDATEKEY
    and @TODATEKEY
    UNION
    ALL
    SELECT
    TXN_DATE
    ,PROCESS_DATE
    ,S1_AMT
    ,S2_AMOUNT
    ,S2_INVALID_AMOUNT
    ,INVALID_MOVED_IN_VALID_S2_AMOUNT
    ,SYSTEM_ID
    S3_AMT
    FROM
    DBO.TABLE_2
    WHERE TNX_DATE_KEY
    BETWEEN @FROMDATEKEY
    and @TODATEKEY
    UNION
    ALL
    SELECT
    TXN_DATE
    ,PROCESS_DATE
    ,S1_AMT
    ,S2_AMOUNT
    ,S2_INVALID_AMOUNT
    ,INVALID_MOVED_IN_VALID_S2_AMOUNT
    ,SYSTEM_ID
    S3_AMT
    FROM
    DBO.TABLE_3
    WHERE TNX_DATE_KEY
    BETWEEN @FROMDATEKEY
    and @TODATEKEY
    END
    Data Source Mode: SQL Command for Variable
    "EXEC [DBO].[SP_TEST]  '"+ (DT_WSTR, 24) @[User::V_EXTRACT_FROM_DT]  +"','"+ (DT_WSTR, 24) @[User::V_EXTRACT_TO_DT]  +"'"
    Where variable @[User::V_EXTRACT_FROM_DT] and @[User::V_EXTRACT_TO_DT] is defined as DATETIME 
    Thanks Shiven:) If Answer is Helpful, Please Vote

    Hi,
    Yes you are right. At one sever where I was getting error, DateTime was in USA format and Where It was running successfully was in AUS format.
    I changed from USA to AUS and I did another changes:
    Data Source Mode: SQL
    Command
    EXEC  [DBO].[SP_TEST] 
    @FROMDATETIME = ?,
    @TODATETIME = ?
    and It is working fine.
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • Using Stored Procedure Universe in Reports

    Hi Friends,
    I got some issues using SP's in Universe and WebI Report.
    Case #1:
    Can we execute dynamic SQL using stored procedure universe..?
    I use SQL server as the DB for my reports.I created a SP which will execute on getting a input value from the user.This input value will frame the SQL dynamically in the SP.for executing the dynamic SQL i use sp_executesql inside the SP.The SP wexecutes successfuly in the DB but when i try executing it in the Universe i get a error message as follows: "Exception : DBD,[Microsoft][SQL SErver Native Client 10.0][SQL Server]Incorrect syntax  nesr 'FROM'.State:42000"
    The script i used for creating SP for your reference:
    CREATE PROCEDURE P_S_GetCodeValueList
              @s_table nvarchar(75)
    as
    begin
              declare @s_sqlCommand nvarchar(1000)
              declare @s_tablename nvarchar(75)
              declare @s_code nvarchar(75)
              set @s_tablename=@s_table
              set @s_code = '*'
              set @s_sqlCommand= 'SELECT ' + @s_code + ' FROM ' + @s_tablename
              exec sp_executesql @s_sqlCommand
    end
    Case #2:
    AIl also tried creating reports using the SP Universe which needs to get the parameter when the user refesh the report.
    But every time the report is refreshed the report fetches the data which was produced when the SP is executed in the Universe for the first time.
    I need to get the prompt in the report , to which the user could give a value and the SP gets executed for that value.
    Is there any option in BO to do this?
    It will be very helpful if you could give me some work arounds on this.
    Regards,
    Sugumar

    Hi Sugumar,
    I can answer you for your 2nd question:
    When you create the Stored procedure in the Universe and test it on retreiving data by inserting variable input you can check if the user could insert new value for the SP parameters.
    Hope this helps!
    Regards
    Giuseppe

  • Best approach for performing DMLs using stored procedures

    Hi,
    I have a really general question and would like to hear your say about this.
    I want my application to manipulate or read data using stored procedures (or packages in that manner) and not directly using queries against the DB.
    Let's say I have a table with many columns:
    create table test (pkid number(10),col1 varchar2(30), col2 number(10), col3 date,...);For such a DML procedure, is it best to do something like
    procedure do_update(i_pkid IN number,i_col1 IN varchar2, i_col2 IN number, i_col3 IN date,...) as
    begin
       update test
       set col1=i_col1,
            col2=i_col2,
            col3=i_col3...
       where pkid=i_pkid;
       commit;
    end;Or do a selective update, meaning update only a certain column every time, given only 1 column actually changes? (and how to do that - separate procedures for each column? [columns can be nulls])
    Also, is it better to work with test.col1%type instead of specifying the data type in the procedure?
    And one last question - If I have a table with 100 columns and I don't want to create a procedure with 100 parameters - the best approach would be to use a record?
    I just need to be set on the way I start implementing things in order to do it well from the start.
    Many thanks.
    Edited by: Pyrocks on Nov 17, 2010 1:58 PM

    Pyrocks wrote:
    One last clarification (although it may be more related to c/c++ developers - maybe one of you will know):
    We are working with C++ and VB against a SQLServer and my part is to translate all the existing procedures to Oracle in order to migrate the application to work with Oracle DB.
    The existing procedures use an IN parameter for each column in the table and I would really like to use rowtype like you mentioned.
    Since I'm not a c/c++/vb developer - is there an easy way of working with such types, or even User-Defined Types, from c/c++/vb (as in passing a rowtype record from c++ to a SP ?)
    I'm not looking for the actual way - just want to know how hard it would be and how much code needs to be changed in order to be able to convince the developers that this is the RIGHT way to work.
    PS. none of our developers have experience with ORACLE so they wouldn't know the answer...Not actually an Oracle server-side (SQL language or PL/SQL language) question - but a client one. And it has been a long time since I wrote a fat client using C/C++ or Delphi.
    The OCI (<i>Oracle Call Interface</i>) supports advance (user defined) SQL data types. Has since Oracle 8i. So in that respect, yes the client can support custom SQL data types.
    How well it does depends entirely on that client language's features wrt OCI integration. For example, Delphi 4 was release around Oracle 8i and supported custom SQL types. I would expect that most languages today (like Java and C#) will provide support for it.
    As for usiong +%ROWTYPE+ - this is a PL/SQL clause as far as I know. Unsure whether it is supported by the OCI. What could support it is a pre-compiler like Pro*C. These enable you to mix pseudo SQL source code with client language source code. The pre-compilation step then replaces the pseudo SQL code with native client language calls to the OCI. The code is then compiled by that client language's compiler. Pre-compilers can pull all kinds of interesting "tricks" with their pseudo SQL code support.
    The best would be to consult the applicable client language's manuals that describe the interface it supports (via OCI) to Oracle.

Maybe you are looking for

  • No Printers are installed / How to Installed printers in HFM (Urgent)

    Hi, we have 2 printers, both are working locally but not from HFM. After login/out it says no printers are installed. Thanks in Advance.

  • Linksys WRT610N V2 problem please help me

    i have Linksys WRT610N V2 now i got problem the power light flashing still keep cannot use but wifi and wan and lan no light but 1 light power only still keep power flashing blinking no stable why how to fix please help me now i using adsl modem dir

  • Add a Help Link to a Discoverer Portlet

    How can I add a Help Link in a Discoverer Portlet? Even if I have checked the 'Show Help Link on Portlet Headers' in the Portlet Display Options this does not appear in the Portlet.

  • Adding an HP 7310 Printer

    Im having sugnificant issues adding an HP 7310 printer. HP have done all they can over the past 10 days and have now drawn a black because the printer driver seems to load for a 'brief' second in the Setup Utility before disapearing. They have theref

  • Webservices in Reports

    Dear Sir, I created a jar file for a wsdl url and then did import java class file, placed the jar file in the classpath and also set the pat of the jar file in the forms/server/default.env file. In the forms the when i call the Stored proc of the web