DEFAULT Constraint using CAST is changed to CONVERT

I am wondering if anyone knows why it happens that if you create a DEFAULT constraint with CAST in the DDL, the next time you script the DEFAULT constraint, the CAST is changed to CONVERT? I know that is really doesn't matter, except for when trying to do
schema comparisons.
Here is a trivial example.
ALTER TABLE [X] ADD CONSTRAINT [DF_Y] DEFAULT (CAST '12345' AS int) FOR [z];goEXEC sp_helptext DF_Y; --The result is--(CONVERT([int],'12345',0))
I realize that internally, calls to CAST are calls to CONVERT, but I am mystified why the DDL would be changed to use CONVERT.

Constraints and computed-column expressions are not stored as is, but they are stored in a normalised form.
I guess that CAST is changed to CONVERT, since CONVERT is the more versatile of them and accept an extra argument to afect the conversion.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • HT2506 How do I change the default image editor from Preview to Graphic Converter?

    How do I change the default image editor from Preview to Graphic Converter?

    I'm assuming you want the default programme to change from Preview to Graphic Converter so that clicking on the file would open Graphic Converter instead of Preview.
    Control click on the file type that you want to open using Graphic Converter. Press Command+I for Get Info. Click on the triangle next to Open With. Select Graphic Converter and Press Change All...

  • Error when using cast and convert to datetime

    I run a stored procedure
    usp_ABC
    as
    begin
    delete from #temp1 
    where #temp1.ResID not in 
    ( select Col1 
    from TableA 
    where ( @I_vId = -1 or Doc_Field_ID = @I_vId)
    and ColA1 = 2  and FieldValue !=''
    and cast ( FieldValue as DATETIME ) = cast (@strvalue_index as DATETIME)
    and ResID = #temp1.ResID
    and TypesId = @I_vTypeId
    end
    But return message "Conversion failed when converting date and/or time from character string.'
    Format of Column FieldValue is nvarchar(400)
    @strvalue_index = '05/05/2013'
    So I see in article http://technet.microsoft.com/en-us/library/ms174450.aspx MS say about MS SQL Server and SQL Server Compact.
    Then I re-write proc:
    delete from #temp1 
    where #temp1.ResID not in 
    ( select Col1 
    from TableA 
    where ( @I_vId = -1 or Doc_Field_ID = @I_vId)
    and ColA1 = 2  and FieldValue !=''
    and cast ( cast(FieldValue as nvarchar(200)) as DATETIME ) = cast (@strvalue_index as DATETIME)
    and ResID = #temp1.ResID
    and TypesId = @I_vTypeId
    so stored run success.
    I don't understand how?
    When i run only statement in MS SQL Studio Management, the statement run success.
    Thanks all,

    No bad dates in my data.
    Apparently you have. Or, as Johnny Bell pointed out, there is a clash with date formats. Did you try the query with isdate()?
    For SQL 2008, you need
      CASE WHEN isdate(FieldValue) = 1
           THEN CAST (FieldValue AS datetime)
      END =
      CASE WHEN isdate(@strvalue_index) = 1
           THEN CAST (@strvalue_index AS datetime)
      END
    Erland Sommarskog, SQL Server MVP, [email protected]
    I think date formats is OK. So when I re-write stored:
    and cast ( FieldValue as DATETIME ) = cast (@strvalue_index as DATETIME)
    =>
    and cast ( cast(FieldValue as varchar(200)) as DATETIME ) = cast (@strvalue_index as DATETIME)
    the stored procedure will run success. I see in http://technet.microsoft.com/en-us/library/ms174450.aspx MS
    has an IMPORTANT:
     Important
    When using CAST or CONVERT for nchar, nvarchar, binary, and varbinary,
    SQL Server truncates values to maximum of 30 characters. SQL Server Compact allows 4000 for nchar and nvarchar, and 8000 for binary and varbinary. Due
    to this, results generated by querying SQL Server and SQL Server Compact are different. In cases where the size of the data types is specified such as nchar(200), nvarchar(200), binary(400), varbinary(400), the results are consistent across SQL Server and
    SQL Server Compact.
    I can't explain it in this case

  • Drop default constraint on a table function

    I need to drop some default constraints that appear to be tied to table functions (and not actual tables).  This means when I try the ALTER TABLE DROP CONSTRAINT command it fails with the error, "unable to drop constraint because object is not
    a table" or something similar.
    My question is: how do I drop a constraint on a table function?

    I suggest you review the documentation for TVFs and how they are (and can be) used.  The table returned by a TVF (and in this case I refer specifically to multistatement TVFs) are defined using a subset of the create table syntax.  They can be
    created with constraints of different types - not just defaults.  Why?  Because it suits the logic of the developer and (perhaps) because it assists the database engine or the logic that depends on the output of the function.  
    Below is one example that I used (written by Steve Kass) from a LONG time ago.  Notice the primary key.
    CREATE FUNCTION [dbo].[uf_sequence] (@N int)
    RETURNS @T TABLE (
    seq int not null primary key clustered
    AS
    ** 04/21/05.sbm - Bug #306. Initial version.
    ** Code provided by Steve Kass - MS .programming newsgroup
    BEGIN
    DECLARE @place int
    SET @place = 1
    INSERT INTO @T (seq) VALUES (0)
    WHILE @place <= @N/2 BEGIN
    INSERT INTO @T (seq)
    SELECT @place + Seq FROM @T
    SET @place = @place + @place
    END
    INSERT INTO @T (seq)
    SELECT @place + Seq FROM @T
    WHERE Seq <= @N - @place
    RETURN
    END
    go
    For your particular case, the choice of a default constraint is likely due to the implementation of the logic in the function.  Perhaps there are multiple insert statements and it was simpler/easier/more robust to use a default constraint rather than
    repeatedly hard-code the value in each statement.  By choosing a default constraint, the developer need only alter the constraint (once) if the value needs to be changed rather than finding and changing each statement that inserts or updates the table.
    As you've have already discerned, you can simply ignore any constraints that are defined on the tables returned by a TVF.  

  • Unexpected "numeric or value error" when using CAST COLLECT

    I am having trouble with string aggregation using CAST / COLLECT and the to_string function described on various sites around the net including AskTom and http://www.oracle-developer.net/display.php?id=306.
    I am getting "numeric or value error: character string buffer too small" but cannot see which limit I am exceeding.
    I have put together a simple test case to highlight this problem which I have pasted below.
    The error does not seem to be coming from the to_string function itself (else I expect we would see "TO_STRING raised an exception" in the returned error message).
    Any thoughts much appreciated,
    Thanks, Andy
    SQL*Plus: Release 10.1.0.4.2 - Production on Tue Jun 15 09:56:53 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> CREATE TYPE table_of_varchar2 AS TABLE OF VARCHAR2(32000);
      2  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION to_string (
      2              nt_in IN   table_of_varchar2
      3      ,       delimiter_in    IN VARCHAR2 DEFAULT ',')
      4      RETURN VARCHAR2
      5      IS
      6          l_idx   PLS_INTEGER;
      7          l_str   VARCHAR2(32767);
      8          l_dlm   VARCHAR2(10);
      9
    10      BEGIN
    11
    12          l_idx := nt_in.FIRST;
    13          WHILE l_idx IS NOT NULL LOOP
    14              l_str := l_str || l_dlm || nt_in(l_idx);
    15              l_dlm := delimiter_in;
    16              l_idx := nt_in.NEXT(l_idx);
    17          END LOOP;
    18
    19          RETURN l_str;
    20      EXCEPTION
    21          WHEN OTHERS THEN
    22              raise_application_error(-20000
    23                                  ,   'TO_STRING raised an exception. '||
    24                                      'The reported error was: '||sqlerrm);
    25     END to_string;
    26  /
    Function created.
    SQL> DECLARE
      2      l_longstring varchar2(32000);
      3  BEGIN
      4      SELECT  to_string(CAST( COLLECT( substr(object_name,1,1) ) AS table_of_varchar2 ) )
      5      INTO    l_longstring
      6      FROM    all_objects
      7      WHERE   rownum < 2001;
      8
      9  EXCEPTION
    10      WHEN OTHERS THEN
    11          raise_application_error(-20001
    12                ,   'The anonymous block raised an exception: '||
    13                    sqlerrm||'. '||DBMS_UTILITY.format_error_backtrace);
    14  END;
    15  /
    PL/SQL procedure successfully completed.
    SQL> DECLARE
      2      l_longstring varchar2(32000);
      3  BEGIN
      4      SELECT  to_string(CAST( COLLECT( substr(object_name,1,1) ) AS table_of_varchar2 ) )
      5      INTO    l_longstring
      6      FROM    all_objects
      7      WHERE   rownum < 2002;
      8
      9  EXCEPTION
    10      WHEN OTHERS THEN
    11          raise_application_error(-20001
    12                ,   'The anonymous block raised an exception: '||
    13                    sqlerrm||'. '||DBMS_UTILITY.format_error_backtrace);
    14  END;
    15  /
    DECLARE
    ERROR at line 1:
    ORA-20001: The anonymous block raised an exception: ORA-06502: PL/SQL: numeric
    or value error: character string buffer too small
    ORA-06512: at line 1. ORA-06512: at line 1
    ORA-06512: at line 4
    ORA-06512: at line 11

    Aha, of course.
    I was aware of the 4000 character SQL VARCHAR2 limit but didn't think it would apply here since we are calling a PLSQL function and trying to assign the value it returns into a PLSQL varchar2(32000) variable. BUT... we are of course doing this via a SELECT statement and hence via SQL. Therefore the SQL 4000 limit applies.
    With this in mind, I changed the RETURN type of the to_string function to be CLOB. This solved the problem.
    Thank you,
    Andy

  • SQL 2012 and later will fail to publish a database for any tables with a default constraint that references a user defined function.

    Script will create database, 3 database objects and publish. 
    The error is due to the generation script to create the conflict tables that is not stripping out default constraints that reference a UDF. 
    As you can see below, the failure is on the generation script for the conflict table.
    The conflict table should be a bucket table that shouldn’t enforce data integrity. 
    See how the default constraints for the columns someint and somestring were stripped out of the generation logic however the default constraint that utilizes a UDF persist and uses the same object name that was used on the production table (The
    bold line) , this occurs if I explicitly name the constraint or let the system generate the name for me like in the example posted. 
      The only way I could see getting around this right now is to drop all default constraints in the system that uses a UDF, publish then add the constraints back which is vulnerable to invalid data and a lot of moving
    steps.  This all worked with SQL 2000, 2005, 2008, 2008r2, it’s stopped working in SQL 2012 and continues to not work in SQL 2014. 
    Error messages:
    Message: There is already an object named 'DF__repTable__id__117F9D94' in the database.
    Could not create constraint. See previous errors.
    Command Text: CREATE TABLE [dbo].[MSmerge_conflict_MergeRepFailurePublication_repTable](
            [id] [varchar](8) NULL CONSTRAINT [DF__repTable__id__117F9D94]  DEFAULT ([dbo].[repUDF]()),
            [somedata] [varchar](64) NULL,
            [rowguid] [uniqueidentifier] ROWGUIDCOL  NULL,
            [someint] [int] NULL,
            [somestring] [varchar](64) NULL
    Parameters:
    Stack:    at Microsoft.SqlServer.Replication.AgentCore.ReMapSqlException(SqlException e, SqlCommand command)
       at Microsoft.SqlServer.Replication.AgentCore.AgentExecuteNonQuery(SqlCommand command, Int32 queryTimeout)
       at Microsoft.SqlServer.Replication.AgentCore.ExecuteDiscardResults(CommandSetupDelegate commandSetupDelegate, Int32 queryTimeout)
       at Microsoft.SqlServer.Replication.Snapshot.YukonMergeConflictTableScriptingManager.ApplyBaseConflictTableScriptToPublisherIfNeeded(String strConflictScriptPath)
       at Microsoft.SqlServer.Replication.Snapshot.BaseMergeConflictTableScriptingManager.DoConflictTableScriptingTransaction(SqlConnection connection)
       at Microsoft.SqlServer.Replication.RetryableSqlServerTransactionManager.ExecuteTransaction(Boolean bLeaveTransactionOpen)
       at Microsoft.SqlServer.Replication.Snapshot.BaseMergeConflictTableScriptingManager.DoConflictTableScripting()
       at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateTableArticleCftScript(Scripter scripter, BaseArticleWrapper articleWrapper, Table smoTable)
       at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateTableArticleScripts(ArticleScriptingBundle articleScriptingBundle)
       at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
       at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
       at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
       at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
       at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.DoScripting()
       at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
       at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
       at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: MSSQLServer, Error number: 2714)
    Get help: http://help/2714
    Server COL-PCANINOW540\SQL2012, Level 16, State 0, Procedure , Line 1
    Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
    Get help: http://help/1750
    Server COL-PCANINOW540\SQL2012, Level 16, State 0, Procedure , Line 1
    Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
    Get help: http://help/1750
    Pauly C
    USE [master]
    GO
    CREATE DATABASE [MergeRepFailure]
    ALTER DATABASE [MergeRepFailure] SET COMPATIBILITY_LEVEL = 110
    GO
    USE [MergeRepFailure]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    create view
    [dbo].[repView] as select right(newid(),8) as id
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE FUNCTION [dbo].[repUDF]()
    RETURNS varchar(8)
    BEGIN
    declare @val varchar(8)
    select top 1 @val = id from [repView]
    return @val
    END
    GO
    create table repTable
    id varchar(8) default([dbo].[repUDF]()),
    somedata varchar(64) null,
    rowguid uniqueidentifier ROWGUIDCOL default(newid()),
    someint int default(1),
    somestring varchar(64) default('somestringvalue')
    GO
    insert into reptable (somedata) values ('whatever1')
    insert into reptable (somedata) values ('whatever2')
    go
    /*test to make sure function is working*/
    select * from reptable
    GO
    /*Publish database*/
    use [MergeRepFailure]
    exec sp_replicationdboption @dbname = N'MergeRepFailure', @optname = N'merge publish', @value = N'true'
    GO
    declare @Descrip nvarchar(128)
    select @Descrip = 'Merge publication of database ''MergeRepFailure'' from Publisher ''' + @@servername +'''.'
    print @Descrip
    -- Adding the merge publication
    use [MergeRepFailure]
    exec sp_addmergepublication @publication = N'MergeRepFailurePublication', @description = N'@Descrip',
    @sync_mode = N'native', @retention = 14, @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'true',
    @enabled_for_internet = N'false', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21,
    @ftp_subdirectory = N'ftp', @ftp_login = N'anonymous', @allow_subscription_copy = N'false', @add_to_active_directory = N'false',
    @dynamic_filters = N'false', @conflict_retention = 14, @keep_partition_changes = N'false', @allow_synctoalternate = N'false',
    @max_concurrent_merge = 0, @max_concurrent_dynamic_snapshots = 0, @use_partition_groups = null, @publication_compatibility_level = N'100RTM',
    @replicate_ddl = 1, @allow_subscriber_initiated_snapshot = N'false', @allow_web_synchronization = N'false', @allow_partition_realignment = N'true',
    @retention_period_unit = N'days', @conflict_logging = N'both', @automatic_reinitialization_policy = 0
    GO
    exec sp_addpublication_snapshot @publication = N'MergeRepFailurePublication', @frequency_type = 4, @frequency_interval = 14, @frequency_relative_interval = 1,
    @frequency_recurrence_factor = 0, @frequency_subday = 1, @frequency_subday_interval = 5, @active_start_time_of_day = 500, @active_end_time_of_day = 235959,
    @active_start_date = 0, @active_end_date = 0, @job_login = null, @job_password = null, @publisher_security_mode = 1
    use [MergeRepFailure]
    exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repTable', @source_owner = N'dbo', @source_object = N'repTable', @type = N'table',
    @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x000000010C034FD1, @identityrangemanagementoption = N'manual',
    @destination_owner = N'dbo', @force_reinit_subscription = 1, @column_tracking = N'false', @subset_filterclause = null, @vertical_partition = N'false',
    @verify_resolver_signature = 1, @allow_interactive_resolver = N'false', @fast_multicol_updateproc = N'true', @check_permissions = 0, @subscriber_upload_options = 0,
    @delete_tracking = N'true', @compensate_for_errors = N'false', @stream_blob_columns = N'false', @partition_options = 0
    GO
    use [MergeRepFailure]
    exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repView', @source_owner = N'dbo', @source_object = N'repView',
    @type = N'view schema only', @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x0000000008000001,
    @destination_owner = N'dbo', @destination_object = N'repView', @force_reinit_subscription = 1
    GO
    use [MergeRepFailure]
    exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repUDF', @source_owner = N'dbo', @source_object = N'repUDF',
    @type = N'func schema only', @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x0000000008000001,
    @destination_owner = N'dbo', @destination_object = N'repUDF', @force_reinit_subscription = 1
    GO

    More information, after running a profile trace the following 2 statements, the column with the default on a UDF returns a row while the other default does not.  This might be the cause of this bug.  Is the same logic to generate the object on
    the subscriber used to generate the conflict table?  
    exec sp_executesql N'
    select so.name, schema_name(so.schema_id)
    from sys.sql_dependencies d
    inner join sys.objects so
    on d.referenced_major_id = so.object_id
    where so.type in (''FN'', ''FS'', ''FT'', ''TF'', ''IF'')
    and d.class in (0,1)
    and d.referenced_major_id <> object_id(@base_table, ''U'')
    and d.object_id = object_id(@constraint, ''D'')',N'@base_table nvarchar(517),@constraint nvarchar(517)',@base_table=N'[dbo].[repTable]',@constraint=N'[dbo].[DF__repTable__id__117F9D94]'
    exec sp_executesql N'
    select so.name, schema_name(so.schema_id)
    from sys.sql_dependencies d
    inner join sys.objects so
    on d.referenced_major_id = so.object_id
    where so.type in (''FN'', ''FS'', ''FT'', ''TF'', ''IF'')
    and d.class in (0,1)
    and d.referenced_major_id <> object_id(@base_table, ''U'')
    and d.object_id = object_id(@constraint, ''D'')',N'@base_table nvarchar(517),@constraint nvarchar(517)',@base_table=N'[dbo].[repTable]',@constraint=N'[dbo].[DF__repTable__somein__1367E606]'
    Pauly C

  • Why do colours change when converting from Word to PDF

    I am converting word files to pdf, however the header and footer background colours change once converted. How can I stop this happening?

    Depends on how you are creating the PDF. If you are using PDF Maker (the create PDF button), then check the preferences in that menu. There is an entry for the settings file selected. If you are printing to the Adobe PDF printer, the settings file is listed under the settings tab of the properties menu.

  • Default constraints replicating when I didn't want them to

    Using SQL Server 2008, I used a TSQL script to set up transactional replication, including sp_addarticle. I did not plan to replicate default values, but they replicated anyway. After seeing them on the subscriber, I generated the script for the
    publication (using SSMS) to check the @schema_option value. It was 0x000000000803108F.  Notice that 0x800 is not set.  So why are default constraints replicating? That's my question.
    As scripted by SSMS, after seeing the defaults show up on the subscriber:
    exec sp_addarticle @publication = N'DBDistribution-GroupCharlie-Tables', @article = N'DistributionContract', @source_owner = N'dbo'
    , @source_object = N'DistributionContract', @type = N'logbased', @description = N'', @creation_script = N'', @pre_creation_cmd = N'truncate'
    , @schema_option = 0x000000000803108F
    , @identityrangemanagementoption = N'none', @destination_table = N'DistributionContract', @destination_owner = N'dbo'
    , @status = 24, @vertical_partition = N'false'
    , @ins_cmd = N'CALL [dbo].[sp_MSins_dboDistributionContract]'
    , @del_cmd = N'CALL [dbo].[sp_MSdel_dboDistributionContract]'
    , @upd_cmd = N'SCALL [dbo].[sp_MSupd_dboDistributionContract]'
    GO
    Note:  the table did not exist on the subscriber, so applying the snapshot created it.  This query against the subscriber shows that all the publisher's constraints were created about 10 minutes after the table was created.
    select t.name, t.create_date, df.name, df.create_date
    from sys.default_constraints df
    join sys.tables t on df.parent_object_id = t.object_id
    where t.name = 'distributioncontract';

    If these are unique constraints they will be replicated as part of the indexes - but it does not sound like this is the problem here. Can I see your script of the problem table?
    looking for a book on SQL Server 2008 Administration?
    http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
    http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

  • Overriding SPMetal Defaults by Using a Parameters XML File

    hi everybody,
    I have a datatable
    Employee below :
    FullName Single line of text
    Age
    Number
    After use SPMetal to generate entities, i have
    EmployeeItem below:
    FullName string
    Age
    double?
    I want Age is Integer so i use "Overriding SPMetal Defaults by Using a Parameters XML File" :
    <?xml version="1.0" encoding="utf-8"?>
    <Web AccessModifier="Public" xmlns="http://schemas.microsoft.com/SharePoint/2009/spmetal">
    <List Name="Employee" Type="Employee">
    <ContentType Name="Employee" Class="Employee">
    <Column Name="FullName" />
    <Column Name="Age" Type="Integer" />
    <ExcludeOtherColumns/>
    </ContentType>
    </List>
    <ExcludeOtherLists />
    </Web>
    When generate it have error "There is an error in XML doc" at :
    <Column Name="Age" --error here-- Type="Integer" />
    Would you like help me?

    Hi,
    I came across the same error when testing your code in my environment.
    Anyway, if we convert the Number field to Integer, there will be a risk of damaging our data due to the conversion accuracy.
    So if you want to use the Integer type of data, a workaround is that you can convert the double type of data to Integer type programmatically after retrieving the data you want.
    Best regards
    Patrick Liang
    TechNet Community Support

  • On using RH_INSERT_INFTY to change HRP1000 status

    Dear Gurus,
    I'm using RH_INSERT_INFTY to change the status(ISTAT) of HRP1000.
    According to the FM documentation: In the case of a status change, however, note the following: The fact that  the record is deleted with the old status (except PLVO).
    But the result seems that, when I change the ISTAT by using RH_INSERT_INFTY,  the record with the old status is still there in the DB table HRP1000. I think the time constraint of HRP1000 must be set to 1.
    Could you please advise how could I delete the record with the old status in this case?
    Thanks & Best Regards,

    Thanks for the advice.
    Finally, I have to delete the record by myself  by calling FM RH_DELETE_INFTY_DIRECT.
    Even if I changed only the ISTAT field of the HRP1000 record, say, from 1 to 2, the old record with ISTAT = 1 would not be deleted after I inerted the ISTAT =  2 record.
    If we don't delete the record with ISTAT = 1 before hand, there will be 2 record in the HRP1000 table, all the fileds' value are the same except the ISTAT field.
    But it's also very tricky that, it seems that if I change the ISTAT and the BEGDA/ENDDA in 1 FM call of RH_INSERT_INFTY, the ISTAT = 2 record will be delimited too.
    Thanks anyway!

  • Default Open With won't change

    I am using ThinkFree Office as an alternative to Microsoft. It works off the same file formats as MS Office and therefore adds the xls extension to its spreadsheets, etc. etc.
    I tried changing the default application using file->get info-> open with -> change all. It then asks me if I really want to change thinkfree files to use thinkfree (doesn't make sense). I select yes (actually it says continue, I think), and then it changes it right back to MS Excel as the default.
    Bottom line: I can change individual files to use thinkfree, but I can't change the default.
    My iMac came with an MS Office test drive, which I have removed, deleted, trashed, etc. etc.
    Has Big Brother Bill put something on my machine I can't change? How do I get rid of this so my xls files will always open thinkfree (same with .doc and .ppt)?

    Did you follow these instructions to remove MS Office test drive:
    On your hard disk, open Microsoft Office 2004 folder that contains the Test Drive. Any documents you saved in the Microsoft Office 2004 Test Drive should be moved somewhere in your documents folder. 
    In the Microsoft Office 2004 folder, double-click "Remove Office". In the Results window, choose Microsoft Office 2004 (including Test Drive) and then click "continue" and follow the prompts. 
    http://www.microsoft.com/mac/default.aspx?pid=office2004td
    You might also try this:
    Navigate to /library/caches/com.apple.LaunchServices-xxxxx.csstore. You may have more than one with different negative numbers. Delete all of these.
    Then navigate to ~(yourhome)/library/preferences/com.apple.launchservices.plist and delete this also.
    Then restart. Let us know.
    -mj
    [email protected]

  • Adding default constraint causes ORA-00054: resource busy

    Hi,
    i ran a script and got error below. Why am i getting error "ORA-00054: resource busy" when adding a default constraint to table? On other evironments such error didn't occure, only in particualr special one the error occured.
    Is it possible that table has too much traffic/locks i nthat environment? How can i rewrite my script?
    Should i instal lthe script in OFFLINE mode?
    In Oracle 11g, Linux Os i runned such script (in Online mode, system not offline):
    ALTER TABLE Casino.Physicaltables ADD WinnerListEnabled NUMBER(1);
    COMMENT ON COLUMN Casino.Physicaltables.WinnerListEnabled  IS '<BOOLEAN> Defines if winner list is turned on or off.';
    ALTER TABLE Casino.Physicaltables MODIFY WinnerListEnabled DEFAULT 0;
    ALTER TABLE Casino.Physicaltables MODIFY (WinnerListEnabled CONSTRAINT NC_Pts_WinnerListEnabled NOT NULL NOVALIDATE);
    UPDATE Casino.Physicaltables SET WinnerListEnabled = 0 WHERE WinnerListEnabled IS NULL;
    COMMIT;
    ALTER TABLE Casino.Physicaltables MODIFY CONSTRAINT NC_Pts_WinnerListEnabled ENABLE VALIDATE;And output was such:
    \\dserver\Live\release\12.6\0.10\sql\live_sql_12.4.0.5_to_12.6.0.10.zip
    Elapsed: 00:00:00.09
    ALTER TABLE Casino.Physicaltables MODIFY WinnerListEnabled DEFAULT 0
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specified

    Any DDL will cause an exclusive lock on the corresponding record in the dictionary. The error message indicates the object is in use by someone else.
    Solutions:
    1 Apply the code in a maintenance window when no one is there. DDL should NOT be run in a live system during production.
    2 Put the database in restricted mode, provided no one has the restricted session privilege
    3 Make sure your application uses a non-default service (ie service <> database name) and shut down that service using srvctl and/or dbms_service.
    There is no such thing as 'OFFLINE mode'
    Sybrand Bakker
    Senior Oracle DBA

  • Video faster than audio when use Adobe Media Encoder to convert f4v to mp4

    I am using Adobe Captivate 5 on a  mac record a demonstration, and I have published my project to .f4v. Now I am using Adobe Media encoder to convert the .f4v file to .mp4 (to play on an ipod). The output LOOKS good, but the video is running much faster than the audio. To be clear, the audio is running at the correct pace, but the video is going by much too quickly.

    From Captivate, I tried changing the fps to a variety of speeds (12, 20, 30, 40, 60) when publishing to f4v. Then in Adobe Media Encoder, when I converted to mp4, I tried keeping the fps the same as the source f4v, reducing it, or increasing it.  After all these experiments, I found that changing the fps in Adobe Media Encoder had no effect at all. Only changing the fps in the source f4v had an effect.  Reducing it to 12 made the probelm worse (the video went by even faster), and increasing it as high as 60 made a SLIGHT improvement, but not enough to get things in sync. Changing the key frame distance in AME had no effect.

  • When using Zoho CRM- by default they use Skype as the "dialer". They said the browser can be configured to use Google Voice as the default dialer. Please help

    When using Zoho CRM- by default it uses Skype as the "dialer". They said the browser can be configured to use Google Voice as the default dialer. Please help by telling me how to make Google Voice the default dialer instead of Skype. Thanks

    Try the following changes to the JS file
    Lines 103 and 104 change the values
    this.showDelay = 100; // was 250
    this.hideDelay = 200; // was 600
    Comment out line 286
    Spry.Widget.MenuBar.prototype.bubbledTextEvent = function()
    //    return Spry.is.safari && (event.target == event.relatedTarget.parentNode || (event.eventPhase == 3 && event.target.parentNode == event.relatedTarget));
    Comment out line 366 and add new lines 366 and 367
    var self = this;
    this.addEventListener(listitem, 'click', function(e){self.Click(listitem, e);}, false);
    this.addEventListener(listitem, 'click', function(e){self.mouseOver(listitem, e);}, false);
    //   this.addEventListener(listitem, 'mouseover', function(e){self.mouseOver(listitem, e);}, false);
    this.addEventListener(listitem, 'mouseout', function(e){if (self.enableKeyboardNavigation) self.clearSelection(); self.mouseOut(listitem, e);}, false);
    I have not tested the above changes ontouch screens; they do seem to work Ok on desktops.
    NOTE: Line numbers could be different because of the difference in our versions.

  • My Canon Pixma MG 7100 makes 2-sided printing the default. How can I change that to 1-sided for defa

    My Canon Pixma MG 7100 makes 2-sided printing the default. How can I change that to 1-sided for defa

    Hi janekieschninck,
    If the printer is currently set to perform duplex (2-sided) printing, you can turn off the setting by deselecting the option in the printer driver. Please follow the instructions at the link below associated with your operating system to find where the duplex feature is located for your operating system:
    Duplex printing - Mac
    Duplex printing - Windows
    Hope this helps!
    This didn't answer your question or issue? Please call or email us using one of the methods on the Contact Us page for further assistance.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

Maybe you are looking for