Select * and Insert question

I have my ResultSet and Query to get the data form an Oracle database. Would I use the same rs for an executeUpdate statement? Or how would I go about doing that?
Basically I'm querying the database, getting the resultset, processing the data around, and then inputing the processed data as a new row in the same database. I have the first part down pat, but I'm a little hazy on the 2nd part, the INSERT INTO bit.
Any help would be greatly appreciated.

This is my code:
public class LimitCheck extends HttpServlet
     private static int UsageAmount = 0;
     private static double TotalPurchased = 0.00;
     private static String Maybe = "Blurbo!";
     private static String Third = "Snafu!";
     private static int CustID = 0;
     private static void loadOracleJDBCDriver () {
System.out.println ("Loading database driver...");
try {
     DriverManager.registerDriver ( new oracle.jdbc.driver.OracleDriver());
System.out.println ("Database driver loaded...");
catch (SQLException e) {
System.err.println (e.getMessage ());
System.exit (1); // Driver error
private static Connection getConnected () {
System.out.println ("LC getting connection...");
try {
String jdbc_url = "jdbc:oracle:thin:@localhost:1521:oracle";
Connection conn = DriverManager.getConnection (jdbc_url, "scott", "tiger");
System.out.println ("LC connection created ...");
return conn;
catch (SQLException e) {
System.err.println (e.getMessage () ) ;
System.exit (1); // Driver failure
return null;     // never happen
     private static Statement makeStatement (Connection conn) {
try {
System.out.println ("LC Making a Statement...");
Statement stmt = conn.createStatement ();
System.out.println ("LC Statement created...");
return stmt;
catch (SQLException e) {
System.err.println (e.getMessage () ) ;
System.exit (2); // Driver failure
return null;     // never happen
private static ResultSet openResultSet (Statement stmt, String query, String update) {
try {
System.out.println ("LC Creating resultSet...");
ResultSet rs = stmt.executeQuery (query);
               stmt.executeUpdate(update);
System.out.println ("LC Resultset created...");
return rs;
catch (SQLException e) {
System.err.println (e.getMessage () ) ;
System.exit (3); // ResultSet error
return null;     // never happen
     private static void processResultSet (ServletOutputStream out, ResultSet rs)
try {
System.out.println ("\n\n+++++ Processing ResultSet for LimitCheck+++++\n");
               while (rs.next() )
                    CustID = (rs.getInt(2));
                    System.out.println(rs.getInt(2));
                    UsageAmount = UsageAmount + 1;
                    System.out.println(rs.getString(5));
                    System.out.println(rs.getDouble(4));
                    TotalPurchased = TotalPurchased + rs.getDouble(4);
System.out.println ("\n\n+++++ ResultSet Processed for LimitCheck+++++\n");
          catch (SQLException e) {
System.err.println (e.getMessage () ) ;
System.exit (5); // Processing error
private static void closeThingsDown (ResultSet rs, Statement stmt, Connection conn) {
try {
System.out.println ("LC Closing Things Down...");
rs.close();
System.out.println ("LC ResultSet Closed...");
stmt.close ();
System.out.println ("LC Statement closed...");
conn.close();
System.out.println ("LC Connection closed...");
catch (SQLException e) {
System.err.println (e.getMessage () ) ;
System.exit (5); // Closure failure
Then I have my doGet, and in it I have:
ResultSet rs = openResultSet (stmt, query, update);
processResultSet (out, rs);               
closeThingsDown (rs, stmt, conn);
When I javac it, I don't get any errors, but when I try to run it, my server craps out and the page can't be displayed. The problem is in my openResultset somewhere, but I can't see where.
I have a sneaking suspicion that the update is supposed to come after I processResultSet, but it complains if I move the update to after it.

Similar Messages

  • How to use direct select and insert or load to speedup the process instead of cursur

    Hi friends,
    I have stored procedure .In SP i am using cursur to load data from Parent to several child table.
    I have attached the script with this message.
    And my problem is how to use direct select and insert or load to speedup the process instead of cursur.
    Can any one please suggest me how to change this scripts pls.
    USE [IconicMarketing]
    GO
    /****** Object: StoredProcedure [dbo].[SP_DMS_INVENTORY] Script Date: 3/6/2015 3:34:03 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <ARUN,NAGARAJ>
    -- Create date: <11/21/2014>
    -- Description: <STORED PROCEDURE FOR DMS_INVENTORY>
    -- =============================================
    ALTER PROCEDURE [dbo].[SP_DMS_INVENTORY]
    @Specific_Date varchar(20) ,
    @DealerNum Varchar(6),
    @Date_Daily varchar(50)
    AS
    BEGIN
    SET NOCOUNT ON;
    --==========================================================================
    -- INVENTORY_CURSUR
    --==========================================================================
    DECLARE
    @FileType varchar(50),
    @ACDealerID varchar(50),
    @ClientDealerID varchar(50),
    @DMSType varchar(50),
    @StockNumber varchar(50),
    @InventoryDate datetime ,
    @StockType varchar(100),
    @DMSStatus varchar(50),
    @InvoicePrice numeric(18, 2),
    @CostPack varchar(50),
    @SalesCost numeric(18, 2),
    @HoldbackAmount numeric(18, 2),
    @ListPrice numeric(18, 2),
    @MSRP varchar(max),
    @LotLocation varchar(50),
    @TagLine varchar(max),
    @Certification varchar(max),
    @CertificationNumber varchar(max),
    @VehicleVIN varchar(50),
    @VehicleYear bigint ,
    @VehicleMake varchar(50),
    @VehicleModel varchar(50),
    @VehicleModelCode varchar(50),
    @VehicleTrim varchar(50),
    @VehicleSubTrimLevel varchar(max),
    @Classification varchar(max),
    @TypeCode varchar(100),
    @VehicleMileage bigint ,
    @EngineCylinderCount varchar(10) ,
    @TransmissionType varchar(50),
    @VehicleExteriorColor varchar(50),
    @VehicleInteriorColor varchar(50),
    @CreatedDate datetime ,
    @LastModifiedDate datetime ,
    @ModifiedFlag varchar(max),
    @InteriorColorCode varchar(50),
    @ExteriorColorCode varchar(50),
    @PackageCode varchar(50),
    @CodedCost varchar(50),
    @Air varchar(100),
    @OrderType varchar(max),
    @AgeDays bigint ,
    @OutstandingRO varchar(50),
    @DlrAccessoryRetail varchar(50),
    @DlrAccessoryCost varchar(max),
    @DlrAccessoryDesc varchar(max),
    @ModelDesc varchar(50),
    @Memo1 varchar(1000),
    @Memo2 varchar(max),
    @Weight varchar(max),
    @FloorPlan numeric(18, 2),
    @Purchaser varchar(max),
    @PurchasedFrom varchar(max),
    @InternetPrice varchar(50),
    @InventoryAcctDollar numeric(18, 2),
    @VehicleType varchar(50),
    @DealerAccessoryCode varchar(50),
    @AllInventoryAcctDollar numeric(18, 2),
    @BestPrice varchar(50),
    @InStock bigint ,
    @AccountingMake varchar(50),
    @GasDiesel varchar(max),
    @BookValue varchar(10),
    @FactoryAccessoryDescription varchar(max),
    @TotalReturn varchar(10),
    @TotalCost varchar(10),
    @SS varchar(max),
    @VehicleBody varchar(max),
    @StandardEquipment varchar(max),
    @Account varchar(max),
    @CalculatedPrice varchar(10),
    @OriginalCost varchar(10),
    @AccessoryCore varchar(10),
    @OtherDollar varchar(10),
    @PrimaryBookValue varchar(10),
    @AmountDue varchar(10),
    @LicenseFee varchar(10),
    @ICompany varchar(max),
    @InvenAcct varchar(max),
    @Field23 varchar(max),
    @Field24 varchar(max),
    @SalesCode bigint,
    @BaseRetail varchar(10),
    @BaseInvAmt varchar(10),
    @CommPrice varchar(10),
    @Price1 varchar(10),
    @Price2 varchar(10),
    @StickerPrice varchar(10),
    @TotInvAmt varchar(10),
    @OptRetail varchar(max),
    @OptInvAmt varchar(10),
    @OptCost varchar(10),
    @Options1 varchar(max),
    @Category varchar(max),
    @Description varchar(max),
    @Engine varchar(max),
    @ModelType varchar(max),
    @FTCode varchar(max),
    @Wholesale varchar(max),
    @Retail varchar(max),
    @Draft varchar(max),
    @myerror varchar(500),
    @Inventoryid int,
    @errornumber int,
    @errorseverity varchar(500),
    @errortable varchar(50),
    @errorstate int,
    @errorprocedure varchar(500),
    @errorline varchar(50),
    @errormessage varchar(1000),
    @Invt_Id int,
    @flatfile_createddate datetime,
    @FtpDate date,
    @Inv_cur varchar(1000),
    @S_Year varchar(4),
    @S_Month varchar(2),
    @S_Date varchar(2),
    @Date_Specfic varchar(50),
    @Param_list nvarchar(max),
    @Daily_Date Varchar(50);
    --====================================================================================
    --DECLARE CURSUR FOR SPECIFIC DATE (OR) DEALER-ID WITH SPECIFIC DATE (OR) CURRENT DATE
    --====================================================================================
    set @Date_Specfic = Substring(@Specific_Date,1,4) +'-'+Substring(@Specific_Date,5,2)+'-'+Substring(@Specific_Date,7,2);
    set @Daily_Date = SUBSTRING(@Date_Daily,14,4) + '-' + SUBSTRING(@Date_Daily,18,2)+ '-' + SUBSTRING(@date_Daily,20,2)
    IF @Daily_Date IS NOT NULL
    BEGIN
    Delete From [dbo].[DMS_INVENTORY_DETAILS]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[DMS_INVENTORY_AMOUNT]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[ICONIC_INVENTORY_VEHICLE]
    Where DMSInventoryVehicleID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[DMS_INVENTORY_VEHICLE]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[ICONIC_EQUITY_INVENTORY_COMPARE]
    Where InventoryVehicleId in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[DMS_INVENTORY]
    Where ID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    DECLARE Inventory_Cursor CURSOR FOR
    SELECT * from [dbo].[FLATFILE_INVENTORY] where
    CONVERT (date,flatfile_createddate) = CONVERT (date,GETDATE()) order by flatfile_createddate;
    END
    Else
    BEGIN
    if (@Date_Specfic IS NOT NULL AND @DealerNum != '?????')
    BEGIN
    Delete From [dbo].[DMS_INVENTORY_DETAILS]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[DMS_INVENTORY_AMOUNT]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[ICONIC_INVENTORY_VEHICLE]
    Where DMSInventoryVehicleID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[DMS_INVENTORY_VEHICLE]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[ICONIC_EQUITY_INVENTORY_COMPARE]
    Where InventoryVehicleId in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[DMS_INVENTORY]
    Where ID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    DECLARE Inventory_Cursor CURSOR FOR
    SELECT * from [dbo].[FLATFILE_INVENTORY] where FtpDate=@Date_Specfic AND ACDealerID='ACTEST' + @DealerNum;
    END
    ELSE
    BEGIN
    Delete From [dbo].[DMS_INVENTORY_DETAILS]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[DMS_INVENTORY_AMOUNT]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[ICONIC_INVENTORY_VEHICLE]
    Where DMSInventoryVehicleID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[DMS_INVENTORY_VEHICLE]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[ICONIC_EQUITY_INVENTORY_COMPARE]
    Where InventoryVehicleId in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[DMS_INVENTORY]
    Where ID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    DECLARE Inventory_Cursor CURSOR FOR
    SELECT * from [dbo].[FLATFILE_INVENTORY] where FtpDate=@Date_Specfic;
    END
    END
    OPEN Inventory_Cursor
    FETCH NEXT FROM Inventory_Cursor
    INTO
    @FileType ,
    @ACDealerID ,
    @ClientDealerID ,
    @DMSType ,
    @StockNumber ,
    @InventoryDate ,
    @StockType ,
    @DMSStatus ,
    @InvoicePrice ,
    @CostPack ,
    @SalesCost ,
    @HoldbackAmount ,
    @ListPrice ,
    @MSRP ,
    @LotLocation ,
    @TagLine ,
    @Certification ,
    @CertificationNumber ,
    @VehicleVIN ,
    @VehicleYear ,
    @VehicleMake ,
    @VehicleModel ,
    @VehicleModelCode ,
    @VehicleTrim ,
    @VehicleSubTrimLevel ,
    @Classification ,
    @TypeCode ,
    @VehicleMileage ,
    @EngineCylinderCount ,
    @TransmissionType ,
    @VehicleExteriorColor ,
    @VehicleInteriorColor ,
    @CreatedDate ,
    @LastModifiedDate ,
    @ModifiedFlag ,
    @InteriorColorCode ,
    @ExteriorColorCode ,
    @PackageCode ,
    @CodedCost ,
    @Air ,
    @OrderType ,
    @AgeDays ,
    @OutstandingRO ,
    @DlrAccessoryRetail ,
    @DlrAccessoryCost ,
    @DlrAccessoryDesc ,
    @ModelDesc ,
    @Memo1 ,
    @Memo2 ,
    @Weight ,
    @FloorPlan ,
    @Purchaser ,
    @PurchasedFrom ,
    @InternetPrice ,
    @InventoryAcctDollar ,
    @VehicleType ,
    @DealerAccessoryCode ,
    @AllInventoryAcctDollar ,
    @BestPrice ,
    @InStock ,
    @AccountingMake ,
    @GasDiesel ,
    @BookValue ,
    @FactoryAccessoryDescription ,
    @TotalReturn ,
    @TotalCost ,
    @SS ,
    @VehicleBody ,
    @StandardEquipment ,
    @Account ,
    @CalculatedPrice ,
    @OriginalCost ,
    @AccessoryCore ,
    @OtherDollar ,
    @PrimaryBookValue ,
    @AmountDue ,
    @LicenseFee ,
    @ICompany ,
    @InvenAcct ,
    @Field23 ,
    @Field24 ,
    @SalesCode ,
    @BaseRetail ,
    @BaseInvAmt ,
    @CommPrice ,
    @Price1 ,
    @Price2 ,
    @StickerPrice ,
    @TotInvAmt ,
    @OptRetail ,
    @OptInvAmt ,
    @OptCost ,
    @Options1 ,
    @Category ,
    @Description ,
    @Engine ,
    @ModelType ,
    @FTCode ,
    @Wholesale ,
    @Retail ,
    @Draft ,
    @flatfile_createddate,
    @FtpDate;
    WHILE @@FETCH_STATUS = 0
    BEGIN
    --==========================================================================
    -- INSERT INTO INVENTORY (PARENT TABLE)
    --==========================================================================
    BEGIN TRY
    INSERT INTO [dbo].[DMS_INVENTORY]
    DMSDealerID,
    StockNumber,
    DMSType,
    InventoryDate,
    FtpDate
    VALUES (@ClientDealerID,@StockNumber,@DMSType,@InventoryDate,@FtpDate);
    END TRY
    BEGIN CATCH
    SELECT
    @errornumber = ERROR_NUMBER(),
    @errorseverity = ERROR_SEVERITY(),
    @errortable = 'DMS_INVENTORY',
    @errorstate = ERROR_STATE(),
    @errorprocedure = ERROR_PROCEDURE(),
    @errorline = ERROR_LINE(),
    @errormessage = ERROR_MESSAGE();
    --==========================================================================
    -- INSERT ERRORS INTO DMSLOG_INVENTORY_ERROR
    --==========================================================================
    EXEC [SP_DMS_INVENTORY_ERROR] @FileType,@ACDealerID,@ClientDealerID,@DMSType,@StockNumber,@InventoryDate,@StockType,@DMSStatus,@InvoicePrice,@CostPack,
    @SalesCost,@HoldbackAmount,@ListPrice,@MSRP,@LotLocation,@TagLine,@Certification,@CertificationNumber,@VehicleVIN,@VehicleYear,@VehicleMake,@VehicleModel,@VehicleModelCode,
    @VehicleTrim,@VehicleSubTrimLevel,@Classification,@TypeCode,@VehicleMileage,@EngineCylinderCount,@TransmissionType,@VehicleExteriorColor,@VehicleInteriorColor,
    @CreatedDate,@LastModifiedDate,@ModifiedFlag,@InteriorColorCode,@ExteriorColorCode,@PackageCode,@CodedCost,@Air,@OrderType,@AgeDays,@OutstandingRO,
    @DlrAccessoryRetail,@DlrAccessoryCost,@DlrAccessoryDesc,@ModelDesc,@Memo1,@Memo2,@Weight,@FloorPlan,@Purchaser,@PurchasedFrom,@InternetPrice,
    @InventoryAcctDollar,@VehicleType,@DealerAccessoryCode,@AllInventoryAcctDollar,@BestPrice,@InStock,@AccountingMake,@GasDiesel,@BookValue,
    @FactoryAccessoryDescription,@TotalReturn,@TotalCost,@SS,@VehicleBody,@StandardEquipment,@Account,@CalculatedPrice,@OriginalCost,@AccessoryCore,
    @OtherDollar,@PrimaryBookValue,@AmountDue,@LicenseFee,@ICompany,@InvenAcct,@Field23,@Field24,@SalesCode,@BaseRetail,@BaseInvAmt,@CommPrice,@Price1,
    @Price2,@StickerPrice,@TotInvAmt,@OptRetail,@OptInvAmt,@OptCost,@Options1,@Category,@Description,@Engine,@ModelType,@FTCode,@Wholesale,@Retail,@Draft,
    @ERRORNUMBER,@ERRORSEVERITY,@ERRORTABLE,@ERRORSTATE,@ERRORPROCEDURE,@ERRORLINE,@errormessage,@FtpDate
    END CATCH
    -- PRINT @errornumber;
    -- PRINT @errorseverity;
    -- PRINT @errortable;
    -- PRINT @errorprocedure;
    -- PRINT @errorline;
    -- PRINT @errormessage;
    -- PRINT @errorstate;
    set @myerror = @@ERROR;
    -- This -- PRINT statement -- PRINTs 'Error = 0' because
    -- @@ERROR is reset in the IF statement above.
    -- PRINT N'Error = ' + @myerror;
    set @Inventoryid = scope_identity();
    -- PRINT @Inventoryid;
    --==========================================================================
    -- INSERT INTO DMS_INVENTORY_DETAILS (CHILD TABLE)
    --==========================================================================
    BEGIN TRY
    INSERT INTO [dbo].[DMS_INVENTORY_DETAILS]
    DMSInventoryID,
    StockType,
    DMSStatus,
    LotLocation,
    TagLine,
    Certification,
    CertificationNumber,
    CreatedDate,
    LastModifiedDate,
    ModifiedFlag,
    PackageCode,
    OrderType,
    AgeDays,
    OutstandingRO,
    Memo1,
    Memo2,
    Purchaser,
    PurchasedFrom,
    DealerAccessoryCode,
    InStock,
    AccountingMake,
    SS,
    Account,
    AccessoryCore,
    ICompany,
    InvenAcct,
    Field23,
    Field24,
    SalesCode,
    Draft,
    FTCode,
    FtpDate
    VALUES (
    @InventoryID,
    @StockType,
    @DMSStatus,
    @LotLocation,
    @TagLine,
    @Certification,
    @CertificationNumber,
    @CreatedDate,
    @LastModifiedDate,
    @ModifiedFlag,
    @PackageCode,
    @OrderType,
    @AgeDays,
    @OutstandingRO,
    @Memo1,
    @Memo2,
    @Purchaser,
    @PurchasedFrom,
    @DealerAccessoryCode,
    @InStock,
    @AccountingMake,
    @SS,
    @Account,
    @AccessoryCore,
    @ICompany,
    @InvenAcct,
    @Field23,
    @Field24,
    @SalesCode,
    @Draft,
    @FTCode,
    @FtpDate
    END TRY
    BEGIN CATCH
    SELECT
    @errornumber = ERROR_NUMBER(),
    @errorseverity = ERROR_SEVERITY(),
    @errorstate = ERROR_STATE(),
    @errortable = 'DMS_INVENTORY_DETAILS',
    @errorprocedure = ERROR_PROCEDURE(),
    @errorline = ERROR_LINE(),
    @errormessage = ERROR_MESSAGE();
    --==========================================================================
    -- INSERT ERRORS INTO DMSLOG_INVENTORY_ERROR
    --==========================================================================
    EXECUTE [SP_DMS_INVENTORY_ERROR] @FileType,@ACDealerID,@ClientDealerID,@DMSType,@StockNumber,@InventoryDate,@StockType,@DMSStatus,@InvoicePrice,@CostPack,
    @SalesCost,@HoldbackAmount,@ListPrice,@MSRP,@LotLocation,@TagLine,@Certification,@CertificationNumber,@VehicleVIN,@VehicleYear,@VehicleMake,@VehicleModel,@VehicleModelCode,
    @VehicleTrim,@VehicleSubTrimLevel,@Classification,@TypeCode,@VehicleMileage,@EngineCylinderCount,@TransmissionType,@VehicleExteriorColor,@VehicleInteriorColor,
    @CreatedDate,@LastModifiedDate,@ModifiedFlag,@InteriorColorCode,@ExteriorColorCode,@PackageCode,@CodedCost,@Air,@OrderType,@AgeDays,@OutstandingRO,
    @DlrAccessoryRetail,@DlrAccessoryCost,@DlrAccessoryDesc,@ModelDesc,@Memo1,@Memo2,@Weight,@FloorPlan,@Purchaser,@PurchasedFrom,@InternetPrice,
    @InventoryAcctDollar,@VehicleType,@DealerAccessoryCode,@AllInventoryAcctDollar,@BestPrice,@InStock,@AccountingMake,@GasDiesel,@BookValue,
    @FactoryAccessoryDescription,@TotalReturn,@TotalCost,@SS,@VehicleBody,@StandardEquipment,@Account,@CalculatedPrice,@OriginalCost,@AccessoryCore,
    @OtherDollar,@PrimaryBookValue,@AmountDue,@LicenseFee,@ICompany,@InvenAcct,@Field23,@Field24,@SalesCode,@BaseRetail,@BaseInvAmt,@CommPrice,@Price1,
    @Price2,@StickerPrice,@TotInvAmt,@OptRetail,@OptInvAmt,@OptCost,@Options1,@Category,@Description,@Engine,@ModelType,@FTCode,@Wholesale,@Retail,@Draft,
    @ERRORNUMBER,@ERRORSEVERITY,@ERRORTABLE,@ERRORSTATE,@ERRORPROCEDURE,@ERRORLINE,@errormessage,@FtpDate
    END CATCH
    --==========================================================================
    -- INSERT INTO DMS_INVENTORY_AMOUNT (CHILD TABLE)
    --==========================================================================
    BEGIN TRY
    INSERT INTO [dbo].[DMS_INVENTORY_AMOUNT]
    DMSInventoryID,
    AllInventoryAcctDollar,
    OtherDollar,
    PrimaryBookValue,
    AmountDue,
    LicenseFee,
    CalculatedPrice,
    OriginalCost,
    BookValue,
    TotalReturn,
    TotalCost,
    DlrAccessoryRetail,
    DlrAccessoryCost,
    DlrAccessoryDesc,
    InternetPrice,
    InventoryAcctDollar,
    BestPrice,
    Weight,
    FloorPlan,
    CodedCost,
    InvoicePrice,
    CostPack,
    SalesCost,
    HoldbackAmount,
    ListPrice,
    MSRP,
    BaseRetail,
    BaseInvAmt,
    CommPrice,
    Price1,
    Price2,
    StickerPrice,
    TotInvAmt,
    OptRetail,
    OptInvAmt,
    OptCost,
    Wholesale,
    Retail,
    FtpDate
    VALUES (
    @InventoryID,
    @AllInventoryAcctDollar,
    @OtherDollar,
    @PrimaryBookValue,
    @AmountDue,
    @LicenseFee,
    @CalculatedPrice,
    @OriginalCost,
    @BookValue,
    @TotalReturn,
    @TotalCost,
    @DlrAccessoryRetail,
    @DlrAccessoryCost,
    @DlrAccessoryDesc,
    @InternetPrice,
    @InventoryAcctDollar,
    @BestPrice,
    @Weight,
    @FloorPlan,
    @CodedCost,
    @InvoicePrice,
    @CostPack,
    @SalesCost,
    @HoldbackAmount,
    @ListPrice,
    @MSRP,
    @BaseRetail,
    @BaseInvAmt,
    @CommPrice,
    @Price1,
    @Price2,
    @StickerPrice,
    @TotInvAmt,
    @OptRetail,
    @OptInvAmt,
    @OptCost,
    @Wholesale,
    @Retail,
    @FtpDate
    END TRY
    BEGIN CATCH
    SELECT
    @errornumber = ERROR_NUMBER(),
    @errorseverity = ERROR_SEVERITY(),
    @errortable = 'DMS_INVENTORY_AMOUNT',
    @errorstate = ERROR_STATE(),
    @errorprocedure = ERROR_PROCEDURE(),
    @errorline = ERROR_LINE(),
    @errormessage = ERROR_MESSAGE();
    --==========================================================================
    -- INSERT ERRORS INTO DMSLOG_INVENTORY_ERROR
    --==========================================================================
    EXEC [SP_DMS_INVENTORY_ERROR] @FileType,@ACDealerID,@ClientDealerID,@DMSType,@StockNumber,@InventoryDate,@StockType,@DMSStatus,@InvoicePrice,@CostPack,
    @SalesCost,@HoldbackAmount,@ListPrice,@MSRP,@LotLocation,@TagLine,@Certification,@CertificationNumber,@VehicleVIN,@VehicleYear,@VehicleMake,@VehicleModel,@VehicleModelCode,
    @VehicleTrim,@VehicleSubTrimLevel,@Classification,@TypeCode,@VehicleMileage,@EngineCylinderCount,@TransmissionType,@VehicleExteriorColor,@VehicleInteriorColor,
    @CreatedDate,@LastModifiedDate,@ModifiedFlag,@InteriorColorCode,@ExteriorColorCode,@PackageCode,@CodedCost,@Air,@OrderType,@AgeDays,@OutstandingRO,
    @DlrAccessoryRetail,@DlrAccessoryCost,@DlrAccessoryDesc,@ModelDesc,@Memo1,@Memo2,@Weight,@FloorPlan,@Purchaser,@PurchasedFrom,@InternetPrice,
    @InventoryAcctDollar,@VehicleType,@DealerAccessoryCode,@AllInventoryAcctDollar,@BestPrice,@InStock,@AccountingMake,@GasDiesel,@BookValue,
    @FactoryAccessoryDescription,@TotalReturn,@TotalCost,@SS,@VehicleBody,@StandardEquipment,@Account,@CalculatedPrice,@OriginalCost,@AccessoryCore,
    @OtherDollar,@PrimaryBookValue,@AmountDue,@LicenseFee,@ICompany,@InvenAcct,@Field23,@Field24,@SalesCode,@BaseRetail,@BaseInvAmt,@CommPrice,@Price1,
    @Price2,@StickerPrice,@TotInvAmt,@OptRetail,@OptInvAmt,@OptCost,@Options1,@Category,@Description,@Engine,@ModelType,@FTCode,@Wholesale,@Retail,@Draft,
    @ERRORNUMBER,@ERRORSEVERITY,@ERRORTABLE,@ERRORSTATE,@ERRORPROCEDURE,@ERRORLINE,@errormessage,@FtpDate
    END CATCH
    --==========================================================================
    -- INSERT INTO DMS_INVENTORY_VEHICLE (CHILD TABLE)
    --==========================================================================
    BEGIN TRY
    INSERT INTO [dbo].[DMS_INVENTORY_VEHICLE]
    DMSInventoryID,
    InteriorColorCode,
    ExteriorColorCode,
    Air,
    ModelDesc,
    VehicleType,
    VehicleVIN,
    VehicleYear,
    VehicleMake,
    VehicleModel,
    VehicleModelCode,
    VehicleTrim,
    VehicleSubTrimLevel,
    Classification,
    TypeCode,
    VehicleMileage,
    FtpDate,
    EngineCylinderCount
    VALUES (
    @InventoryID,
    @InteriorColorCode,
    @ExteriorColorCode,
    @Air,
    @ModelDesc,
    @VehicleType,
    @VehicleVIN,
    @VehicleYear,
    @VehicleMake,
    @VehicleModel,
    @VehicleModelCode,
    @VehicleTrim,
    @VehicleSubTrimLevel,
    @Classification,
    @TypeCode,
    @VehicleMileage,
    @FtpDate,
    @EngineCylinderCount
    END TRY
    BEGIN CATCH
    SELECT
    @errornumber = ERROR_NUMBER(),
    @errorseverity = ERROR_SEVERITY(),
    @errortable = 'DMS_INVENTORY_VEHICLE',
    @errorstate = ERROR_STATE(),
    @errorprocedure = ERROR_PROCEDURE(),
    @errorline = ERROR_LINE(),
    @errormessage = ERROR_MESSAGE();
    --==========================================================================
    -- INSERT ERRORS INTO DMSLOG_INVENTORY_ERROR
    --==========================================================================
    EXEC [SP_DMS_INVENTORY_ERROR] @FileType,@ACDealerID,@ClientDealerID,@DMSType,@StockNumber,@InventoryDate,@StockType,@DMSStatus,@InvoicePrice,@CostPack,
    @SalesCost,@HoldbackAmount,@ListPrice,@MSRP,@LotLocation,@TagLine,@Certification,@CertificationNumber,@VehicleVIN,@VehicleYear,@VehicleMake,@VehicleModel,@VehicleModelCode,
    @VehicleTrim,@VehicleSubTrimLevel,@Classification,@TypeCode,@VehicleMileage,@EngineCylinderCount,@TransmissionType,@VehicleExteriorColor,@VehicleInteriorColor,
    @CreatedDate,@LastModifiedDate,@ModifiedFlag,@InteriorColorCode,@ExteriorColorCode,@PackageCode,@CodedCost,@Air,@OrderType,@AgeDays,@OutstandingRO,
    @DlrAccessoryRetail,@DlrAccessoryCost,@DlrAccessoryDesc,@ModelDesc,@Memo1,@Memo2,@Weight,@FloorPlan,@Purchaser,@PurchasedFrom,@InternetPrice,
    @InventoryAcctDollar,@VehicleType,@DealerAccessoryCode,@AllInventoryAcctDollar,@BestPrice,@InStock,@AccountingMake,@GasDiesel,@BookValue,
    @FactoryAccessoryDescription,@TotalReturn,@TotalCost,@SS,@VehicleBody,@StandardEquipment,@Account,@CalculatedPrice,@OriginalCost,@AccessoryCore,
    @OtherDollar,@PrimaryBookValue,@AmountDue,@LicenseFee,@ICompany,@InvenAcct,@Field23,@Field24,@SalesCode,@BaseRetail,@BaseInvAmt,@CommPrice,@Price1,
    @Price2,@StickerPrice,@TotInvAmt,@OptRetail,@OptInvAmt,@OptCost,@Options1,@Category,@Description,@Engine,@ModelType,@FTCode,@Wholesale,@Retail,@Draft,
    @ERRORNUMBER,@ERRORSEVERITY,@ERRORTABLE,@ERRORSTATE,@ERRORPROCEDURE,@ERRORLINE,@errormessage,@FtpDate
    END CATCH
    --==========================================================================
    -- MOVE CURSUR TO NEXT RECORD
    --==========================================================================
    FETCH NEXT FROM Inventory_Cursor
    INTO @FileType ,
    @ACDealerID ,
    @ClientDealerID ,
    @DMSType ,
    @StockNumber ,
    @InventoryDate ,
    @StockType ,
    @DMSStatus ,
    @InvoicePrice ,
    @CostPack ,
    @SalesCost ,
    @HoldbackAmount ,
    @ListPrice ,
    @MSRP ,
    @LotLocation ,
    @TagLine ,
    @Certification ,
    @CertificationNumber ,
    @VehicleVIN ,
    @VehicleYear ,
    @VehicleMake ,
    @VehicleModel ,
    @VehicleModelCode ,
    @VehicleTrim ,
    @VehicleSubTrimLevel ,
    @Classification ,
    @TypeCode ,
    @VehicleMileage ,
    @EngineCylinderCount ,
    @TransmissionType ,
    @VehicleExteriorColor ,
    @VehicleInteriorColor ,
    @CreatedDate ,
    @LastModifiedDate ,
    @ModifiedFlag ,
    @InteriorColorCode ,
    @ExteriorColorCode ,
    @PackageCode ,
    @CodedCost ,
    @Air ,
    @OrderType ,
    @AgeDays ,
    @OutstandingRO ,
    @DlrAccessoryRetail ,
    @DlrAccessoryCost ,
    @DlrAccessoryDesc ,
    @ModelDesc ,
    @Memo1 ,
    @Memo2 ,
    @Weight ,
    @FloorPlan ,
    @Purchaser ,
    @PurchasedFrom ,
    @InternetPrice ,
    @InventoryAcctDollar ,
    @VehicleType ,
    @DealerAccessoryCode ,
    @AllInventoryAcctDollar ,
    @BestPrice ,
    @InStock ,
    @AccountingMake ,
    @GasDiesel ,
    @BookValue ,
    @FactoryAccessoryDescription ,
    @TotalReturn ,
    @TotalCost ,
    @SS ,
    @VehicleBody ,
    @StandardEquipment ,
    @Account ,
    @CalculatedPrice ,
    @OriginalCost ,
    @AccessoryCore ,
    @OtherDollar ,
    @PrimaryBookValue ,
    @AmountDue ,
    @LicenseFee ,
    @ICompany ,
    @InvenAcct ,
    @Field23 ,
    @Field24 ,
    @SalesCode ,
    @BaseRetail ,
    @BaseInvAmt ,
    @CommPrice ,
    @Price1 ,
    @Price2 ,
    @StickerPrice ,
    @TotInvAmt ,
    @OptRetail ,
    @OptInvAmt ,
    @OptCost ,
    @Options1 ,
    @Category ,
    @Description ,
    @Engine ,
    @ModelType ,
    @FTCode ,
    @Wholesale ,
    @Retail ,
    @Draft ,
    @flatfile_createddate,
    @FtpDate;
    END
    CLOSE Inventory_Cursor;
    DEALLOCATE Inventory_Cursor;
    SET ANSI_PADDING OFF
    END
    Arunraj Kumar

    Thank you.
    And another question if the data is already there in the child table if i try to load alone it must delete the old data in the child tablee and need to get load the new data and 
    How to do this ?
    Arunraj Kumar
    You can do that with an IF EXISTS condition
    IF EXISTS (SELECT 1
    FROM YourChildTable c
    INNER JOIn @temptable t
    ON c.Bkey1 = t.Bkey1
    AND c.Bkey2 = t.Bkey2
    DELETE t
    FROM YourChildTable c
    INNER JOIn @temptable t
    ON c.Bkey1 = t.Bkey1
    AND c.Bkey2 = t.Bkey2
    INSERT INTO YourChildTable
    where Bkey1,Bkey2 etc forms the business key of the table
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • ESB performance issue: takes too long to select and insert records in DBs

    Hi,
    I have an ESB service which has to select data from seven different tables(using join operations) of one database and insert it into a single table of another database.
    It takes unduly long time to do this operation.
    For ex: it takes over 2 hours to select and insert 3000 records.
    When ran the same query to select the records from the tables using SQL developer, it took only 23 seconds.
    Do I need to change any configuration settings in the enterprise manager or someother place to increase the performance. Someone please advice.
    I am using Oracle SOA Suite 10.1.3.4
    Thanks,
    RV

    Hi,
    I have an ESB service which has to select data from seven different tables(using join operations) of one database and insert it into a single table of another database.
    It takes unduly long time to do this operation.
    For ex: it takes over 2 hours to select and insert 3000 records.
    When ran the same query to select the records from the tables using SQL developer, it took only 23 seconds.
    Do I need to change any configuration settings in the enterprise manager or someother place to increase the performance. Someone please advice.
    I am using Oracle SOA Suite 10.1.3.4
    Thanks,
    RV

  • Change the value of column from select and insert different

    Hi All,
    I have written a procedure where i am selecting values from some table and inserting in a new table. The code is below
    If you see the line 54 in code, you will find the combined_bu_code is is coming from one procedure and the value of BU is stored in prod.SEM_BACKLOG_LOG table. I have to check, if the combined_bu_code is coming as PWR then insert as POWER in BACKLOG_OTD_NEW table not as PWR.
    Looking for a help on this. Thanks in advance
    Regards
    Edited by: User_Apex on Jun 23, 2011 3:03 AM
    Edited by: User_Apex on Jun 23, 2011 3:53 AM

    Hi Martin,
    sorry i wrote wrong at that time
    If you see my code you will find alias of prod.SEM_BACKLOG_LOG is 'a' not 'b' and BU is coming from 'a'
    I just want a if startement to be written in this column "SMTC_OTD_CHART.get_combined_bu_code (a.BU)COMBINED_BU_CODE" that if the a.BU is PWR insert as POWER in the BACKLOG_OTD_NEW table
    Regards
    Edited by: User_Apex on Jun 23, 2011 3:02 AM

  • Resize only one object in selection, and other questions. InDesign CC

    I recently changed from InDesign CS4 to CC. I'm having a few problems with the interface and can't figure them out.
    1) This one is really annoying me: I select multiple items, like a picture and some text, to move them somewhere. I then want to maybe change the size of the text box, or crop the picture a little. What used to happen in CS4 was exactly what I wanted to happen: whichever item I clicked on to edit would be edited. In CC, it resizes everything selected! If I want to resize ALL the items, I'll group them. Is there an option to turn that off? I've looked through every menu I could find but didn't see anything that would refer to that.
    2) In the same vein: When I select a couple items, like a text box on top of a burst or an ellipse or something, and I then want to edit some of the text. In CS4 I could double click and it would turn into the type tool and I could edit text. It still works the same in CC, but only if I have just the text box selected. If there's anything else selected, it just doesn't work.
    3) I complained about this one when I changed from CS2 to CS4, but it's still a problem: When I print, and put in a particular page range, it prints those pages. Now, when I go back to print again, it has defaulted back to printing all pages. I'd really like to be able to hit CTRL-P then Enter, instead of using the mouse to select my page range again. Is there some option that I can change somewhere for that? It works fine in Print Booklet, and Export to PDF. It's only when I print normally this happens.
    4) Every time I open the program, all my windows (Pages, Swatches, Stroke, etc...) are always minimized. It's annoying to have to open them every time. I couldn't find anywhere to change that either.
    These are kind of minor inconveniences I guess, but it would be nice if I could change them. Other than these few things CC has been pretty good. I definitely like that it's 64 bit. I got out of memory errors a lot with CS4. Anyhow, thanks for taking the time to read my questions!

    TopePrinting wrote:
    1) This one is really annoying me: I select multiple items, like a picture and some text, to move them somewhere. I then want to maybe change the size of the text box, or crop the picture a little. What used to happen in CS4 was exactly what I wanted to happen: whichever item I clicked on to edit would be edited. In CC, it resizes everything selected! If I want to resize ALL the items, I'll group them. Is there an option to turn that off? I've looked through every menu I could find but didn't see anything that would refer to that.
    I have InDesign CS5.5 - and when I select more than 1 object I get a bounding box for all the items - it's impossible to resize just one item without affecting everything selected.
    TopePrinting wrote:
    2) In the same vein: When I select a couple items, like a text box on top of a burst or an ellipse or something, and I then want to edit some of the text. In CS4 I could double click and it would turn into the type tool and I could edit text. It still works the same in CC, but only if I have just the text box selected. If there's anything else selected, it just doesn't work.
    I really don't see this behaviour at all.
    TopePrinting wrote: 3) I complained about this one when I changed from CS2 to CS4, but it's still a problem: When I print, and put in a particular page range, it prints those pages. Now, when I go back to print again, it has defaulted back to printing all pages. I'd really like to be able to hit CTRL-P then Enter, instead of using the mouse to select my page range again. Is there some option that I can change somewhere for that? It works fine in Print Booklet, and Export to PDF. It's only when I print normally this happens.
    No - this is the way it works - annoying!
    What's really frustrating is that it will remember the amount of copies you've input too! I would like that reset to 1 after I print 100 copies. All too often I've opened a file from last year to print a copy and hit Ctrl+P and then Return as the shortcuts - and I get 100 copies printed again!!!
    4) Every time I open the program, all my windows (Pages, Swatches, Stroke, etc...) are always minimized. It's annoying to have to open them every time. I couldn't find anywhere to change that either.
    Once you have the screen setup the way you like it go to Window>Workspaces and click "New Workspace"
    Save as it something unique to you.
    Everytime you open InDesign this should be the default panel settings.
    These are kind of minor inconveniences I guess, but it would be nice if I could change them. Other than these few things CC has been pretty good. I definitely like that it's 64 bit. I got out of memory errors a lot with CS4. Anyhow, thanks for taking the time to read my questions!
    They are minor for sure - and we all have niggly bits in InDesign that frustrate us.
    But unfortunately this is a user-to-user forum so it's unlikely to be picked up by Adobe employees.
    I suggest you put it in the feature request forums - http://forums.adobe.com/community/indesign/indesign_feature_requests
    There's the Adobe Feature Request page - https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    That's about as much as you can do.

  • Select and insert statments

    I am running PHP 4.3.9 and Orace 10g.<p>
    I have a simple select query to check for the existence of a unique row.<p>
     $idCheck="select * from fuel.trip_segment where id='$id'";     <br>     
          $statementa= OCIParse($c, $idCheck);<br>
          OCIExecute($statementa);<br>
          $rows = OCIFetchStatement($statementa, $results);<br>
      echo "row: ".$rows ;<p>
    The output should be "1" when a row is found. But for some reason it always returns "0" regardless. If i execute this query ($idCheck) with out database/sql interface software, it will return the row of the given id. <p>
    Problem 2<br>
    I also have an insert query which will work if put directly into the database/sql interface software, but will not work when executed in PHP.<p>
     $upload="insert into fuel.trip_segment (id, unitno, downloaddate, drive_time, distance, fuel, idle_time, idle_fuel, idle_percent, load_factor, ave_speed, ave_Dspeed, max_speed, max_rpm, start_time, end_time, start_odo, end_odo)<br>
     values ('$id', '$unit', to_date('$dateFormatted', 'dd-mon-yyyy hh:mi AM'), '$drive_time', '$distance', '$fuel', '$idle_time', '$idle_fuel', '$idle_percent', '$load_factor', '$ave_speed',     '$ave_Dspeed', max_speed', '$max_rpm', '$start_time', '$end_time', '$start_odo', '$end_odo')";<p>
     $statementb= OCIParse($c, $upload);<p>
     OCIExecute($statmentb);<p>
    The information is not being inserted at all.<p>
    Any help would be great.<p>
    Disclaimer: Oracle novice
    Message was edited by:
    tckephart

    Hello!
    Problem 1:
    Try to use select id and not to use select *
    then try to use a while maybe the result is more than one row
    $idCheck="select id from fuel.trip_segment where id='$id'";
    $statementa= OCIParse($c, $idCheck);
    OCIExecute($statementa);
    while(OCIFetchInto($statementa, $results))
    echo "id: ".$results[0];
    } //end while
    Problem 2
    Maybe you have wrong the query insert, max_speed need $.
    but anyway try this:
    $upload="insert into fuel.trip_segment
    values
    '".$id."',
    '".$unit."',
    to_date('".$dateFormatted."', 'dd-mon-yyyy hh:mi AM'),
    '".$drive_time."',
    '".$distance."',
    '".$fuel."',
    '".$idle_time."',
    '".$idle_fuel."',
    '".$idle_percent."',
    '".$load_factor."',
    '".$ave_speed."',
    '".$ave_Dspeed."',
    '".$max_speed.'",
    '".$max_rpm."',
    '".$start_time."',
    '".$end_time."',
    '".$start_odo."',
    '".$end_odo."'
    $statementb= OCIParse($c, $upload);
    OCIExecute($statmentb);
    $record_insert = @OCIRowCount($statmentb);
    This count how many record you have inserted.
    Have a nice work
    Angelo

  • Toplink Select and Insert Order

    Hi,
    We have a situation where we have to insert a row into database with a sequence primary key and do a select on the same record with the newly generated sequence number. (Here sequence is generated via TopLink's SQLCall class, but not through work bench at runtime.) When we try this with TopLink it was trying to select first with the new sequnce number and then insert. So we are getting a NULL back. Is there a way to force toplink to create first and then do selects? Please let me know ASAP.
    Thanks..

    I am not sure why you want to do a select of an object you just committed. When you register an object in a Unit Of Work, you get an object back from the function of type Object. Caste that object to the "real" type. After you make the commit call, toplink will grab the next sequence and put the value into the object that was returned from the register function.
    Anyway, if that does not work for you. Create your object in a Unit of Work, and then commit that. In a Client Session object, do your query function. That will force your changes to happen prior to the query. Hope that helps.

  • In training, PL/SQL create table and insert question. (easy for some of you

    I have an empty table called messages. The task is this:
    a)Insert the numbers 1 to 10, excluding 6 and 8.
    b)Commit before the end of the block.
    I did this:
    SET SERVEROUTPUT ON
    SET VERIFY OFF
    BEGIN
    INSERT INTO messages VALUES (1,2,3,4,5,6,7,9,10);
    END;
    Which fails at messages. The table is there, I checked and it's empty. ORA-06550:

    Hello,
    c1 is not a valid column name I posted as an example , you need to provide valid column name of your table.
    Either post your table structure or replace c1, c2, c3 ... with valid column name from your table.
    INSERT INTO MESSAGES (c1, c2, c3, c4, c5, c9, c10)
    or
    insert into messages (your table column name1 , column name2 ,....) values (....);Regards
    Edited by: OrionNet on Feb 21, 2009 9:51 PM

  • Returing clause with select and insert

    Hi,
    I am trying to use the following query but its not working.I want to know whether this syntax is valid.
    Insert into t_name( , , ,)
    Select , , , from t_name2
    Returing into , , , .
    There is only one row I am dealing with.
    Thanks a Lot !!!
    Edited by: user10619253 on Jan 16, 2009 12:52 AM

    Hi user michaels2,
    Whwn I am trying with the above example its working but for more then 1 column its not working
    SQL> declare
    2 x int;
    3 begin
    4 insert into emp (empno,ENAME)
    5 values ( ( select 100,'ABC' from dual ) )
    6 returning empno into x;
    7 dbms_output.put_line ('Last Value Inserted: '||to_char (x));
    8 end;
    9 /
    values ( ( select 100,'ABC' from dual ) )
    ERROR at line 5:
    ORA-06550: line 5, column 8:
    PL/SQL: ORA-00947: not enough values
    ORA-06550: line 4, column 4:
    PL/SQL: SQL Statement ignored
    SQL>
    Thanks !!!

  • Difference between SELECT .. INTO and INSERT.. SELECT

    Hi All,
    I am on SQL Server 2008 R2. I have a very basic question.
    What is the difference between SELECT ... INTO command and INSERT ... SELECT command, when inserting data into a tamp table or even a normal table? Or what is the difference between them in general?
    When should I use SELECT ... INTO and when should I use INSERT... SELECT ?
    Please guide.
    Thanks in advance

    Generally both are the same . There is some optimizations in case of heaps.When inserting into a heap, the storage engine needs to find free space for new rows. It keeps track
    of the last page on which a row was inserted, and if that page has space, it will insert on that page. If there is no space, it will have to look at the PFS pages to find space available, and if it cannot find space, it needs to allocate a new page. This can
    be pretty slow  so SQL Server has an optimization named minimally logging.. Instead of allocating one page at a time,it is used a mechanism which allocates upto 64 pages (8 extents)
    at a time, and keeps these pages in a cache, so that it allocates from that cache first.
    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

  • How do I select and email a whole lot of photos on my iPad from my iPad emails? It seems I have to go into Email and then insert one photo at a time? Isn't there a way to select all in the photos and then email the batch.?

    How do I select and email a whole lot of photos on my iPad from my iPad emails? It seems I have to go into Email and then insert one photo at a time? Isn't there a way to select all in the photos and then email the batch.?

    Actually, you can email up to 5 at a time from the Photos app. Select any more and the email share option will not appear.
    If you explain why you need to email large numbers of photos, we might be able to offer an alternative.

  • How do I select a field and between selected rows insert auto-incremented numbers?

    I have a spreadsheet in Numbers '09 and I want to number the rows so that I can sort by the original order after I've already sorted by different items. In Excel this is fairly easy, but how do you do this in Numbers? How do I select a series of rows in a column and tell it to automatically insert numbers incremented from one to the total number of rows?
    Thanks,
    Philip

    Hi Philip,
    As an alternative to the method Yvan pointed out, you could use a formula.
    (NOTE: This takes longer to write than to do.
    (CAUTION: Make sure you use Copy/Paste Values to replace the formulas with the calculated numbers before sorting.))
    Choose a column in which to place the numbers.
    In the first non-header cell in the column enter the formula:
       =ROW()
    Select the whole column by clicking its column reference tab.
    Then use command-click to deselect the header cells above the one where you placed the formula.
    With the cell containing the formula and all of the column below it selected, go:
       Insert (menu) > Fill > Fill Down
    The formula will be filled into the rest of the column and the numbers calculated.
    With the cells still selected, COPY, then go Edit > Paste Values.
    This replaces the 'live' formulas with the numbers themselves, and prevents the numbers being recalculated when the rows are sorted.
    Regards,
    Barry

  • How to Select from Oracle 8i database and insert into Sql Server 2005 datab

    Hi how to Select from Oracle 8i and insert into Sql Server 2005.
    Source db as Oracle 8i
    Target db as Sql Server 2005.
    I need to select one table data from Oracle 8i & insert into Sql Server 2005
    Thanks

    Thanks Khan..
    Is there is any query (OPENQUERY) available for that?
    Regards..

  • Which option do I have to select If I buy the latest iPad with cellular feature for international use? If I choose verizon can I just change the sim card and insert one from another country?

    Which option do I have to select If I buy the latest iPad with cellular feature for international use? If I choose verizon can I just change the sim card and insert one from another country?

    I would guess you need the A1460 model
    see here
    http://www.apple.com/ipad/LTE/

  • How to Insert-Select and Updade base table

    Hi All,
    How is the best way to do this?
    I have a table A that has 1million rows.
    I need to Insert-Select into table B from a Group by on table A,
    and Update all rows in table A that were used into Insert with a flag.
    (select a hundred from A and insert 10 thousands into B)
    What to do?
    1-Update table A with flag before Insert-Select?
    2-Insert-Select group by into table B, before Update?
    3-Another way?
    Thanks in advance,
    Edson

    Either way. But you may find that updating the source flag first and then using that flag as part of your where clause when extracting rows to put in the destination table is a bit faster.
    In any case, you will commit only once after all of the work is done.

Maybe you are looking for

  • How can I delete the image in my e-mails?

    I'm having difficulty deleting or changing the e-mail image that appears automatically in e-mails. I gather they appear on e-mails sent to other Mac Mail uses, but not otherwise. I'd like to simply remove the image. Yet even when I delete the image a

  • Safari 7 Crashes on Opening - Help Please!

    Hi, Safari is inexplicably crashing. The icon barely bounces and I get the message below. After looking at another thread, I thought it might have been my "Clean My Mac" app update that was causing the problem. I completely uninstalled that, but the

  • Integration with ECC 6.0 and SRM 5.0

    Dear Experts, We have ECC 6.0 implemented. We want to implement SAP SRM 5.0. Kindly anybody can guide us to know the Customisation/ configuration of both the systems. For extended classic senario what setting to be done.. For other scenario what sett

  • Does Sun ONE Web Proxy Server have built-in log analysis tools? What kind o

    Sun ONE Web Proxy Server automatically logs all requests using either the common log-file format or an extended log-file format. The extended log-file format includes the referrer field and user agent. You can also create your own log file format by

  • How to view WiFi password, stored in the Microsoft cloud?

    For a time I used Windows 8.1 on my laptop, i found my WiFi pass automatic synced. But as I installed Windows 10 Technical Preview, I found that my pass wasn't synced. Is there a way to extract it from the cloud somehow? The point is I have no access