Implicit conversion

doesnot oracle implicitly convert varchar(2) to date in round and trunc functions?

Hi,
f7218ad2-7d9f-4e71-ba26-0d6e4b38f87e wrote:
doesnot oracle implicitly convert varchar(2) to date in round and trunc functions?
ROUND and TRUNC do not take VARCHAR2s fior the 1st argument.  They take either NUMBERs or DATEs.  If you try to call them with any other data type, you are asking for trouble.  Sometimes you get what you ask for.  There is no reason to call either with the wrong type of argument.
If you do call ROUND or TRUNC with a VARCHAR2 1st argument, even though you know it's a terrible idea, Oracle will try to convert it.  Whether it tries to convert it to a NUMBER or a DATE may depend on the string and/or your NLS settings, though it seems to always try to conver to a NUMBER.
Implicit conversions are never necessary.  Explicit conversions are always simple.  Always use the correct datatype.  If you must convert from one datatype to anopther, use an explicit conversion.

Similar Messages

  • Why index is not used if oracle have to do implicit conversion?

    my db version: 10gR2
    I created bitmap index on each of the column used in below sql.
    the datatype of all three columns are VARCHAR2,
    while i am using NUMBER in the query, which means oracle needs to do the implicit conversion before running the sql.
    the problem is that, when I use NUMBER as below, execution plan will not use bitmap indexes at all.
    but when I use STRING instead, it will make use of those bitmap indexes.
    select  FI_YTD,1,2,FI_KPI_ID
      from DM_F_FI_ALL_KPI
      where
        FI_KPI_ID=4140
        and FI_PERIOD=201012
        and FI_ORG_ID=10000000;So, I wonder why? how the implicit conversion affects the access path?
    Edited by: PhoenixBai on Jan 30, 2011 10:52 AM
    Edited by: PhoenixBai on Jan 31, 2011 9:21 AM --added database version as 10gR2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    sybrand_b wrote:
    Implicit conversion in Oracle is always done like this
    empno='10'
    is rewritten as
    to_char(empno)='10'
    Now you have <function>(<indexed columnn>) = <hardcoded literal>
    Oracle never puts a conversion function at the right hand side of the expresssion. NEVER.
    SQL> create table emp as select * from scott.emp;
    Table created.
    SQL> alter table emp add constraint emp_pk primary key (empno);
    Table altered.
    SQL> @desc emp
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    SQL> select * from emp where empno = '10'
      2
    SQL> @xplan
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Compatibility is set to 11.2.0.0.0
    Plan hash value: 4024650034
    | Id  | Operation                   | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |        |     1 |    87 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |     1 |    87 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN         | EMP_PK |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("EMPNO"=10)Edited by: William Robertson on Jan 30, 2011 12:56 PM - added DESCRIBE

  • Implicit Conversion from data type sql_variant to datetime is not allowed.

     Getting a odd error. This code was working perfectly before a SQLServer upgrade.
    The linked database is working, I'm able to pull up data from it in separate queries just fine.
    I'm getting the following error.
    Implicit conversion from data type sql_variant to datetime is not allowed. Use the CONVERT function to run this query.
    Invalid column name 'TotalDay'. (.Net SqlClient Data Provider)
    can anyone spot the issue? I've tried sever variations of the same code, but still get the same thing.
    If I put this section in a query by it self it works just fine.
    ( DATEDIFF(ss,
    CONVERT(VARCHAR(10),( SELECT TOP ( 1 )
    TimeDate
    FROM [nav].AcsLog.dbo.EvnLog AS X3
    WHERE UDF2 = E.No_
    AND CONVERT(VARCHAR(10), X3.TimeDate, 101) = CONVERT(VARCHAR(10), @sdate, 101)
    ORDER BY TimeDate ASC
    ),101),
    CONVERT(VARCHAR(10),( SELECT TOP ( 1 )
    TimeDate
    FROM [nav].AcsLog.dbo.EvnLog AS X4
    WHERE UDF2 = E.No_
    AND CONVERT(VARCHAR(10), X4.TimeDate, 101) = CONVERT(VARCHAR(10), @sdate, 101)
    ORDER BY TimeDate DESC
    ),101)) ) AS TotalDayBadge ,

    >ANDCONVERT(VARCHAR(10),X3.TimeDate,101)=CONVERT(VARCHAR(10),@sdate,101)
    It is not a good idea to use string dates for predicates in WHERE clauses.
    Use DATETIME or DATE in predicates.
    If you are not interested in the time part of DATETIME, use DATE datatype.
    Example:
    SELECT CONVERT(DATE, getdate());
    -- 2014-08-25
    Datetime conversions:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Between dates:
    http://www.sqlusa.com/bestpractices2008/between-dates/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Implicit conversion of "TEXT" to "VARCHAR"

    Running jdk1.6.0_12, Linux RHE, Sybase 12.5 and connection with jconn3.jar
    Have a table with a column of type varchar(50)
    Was able to isolate the problem to this column, as the SQLException was thrown from the line "stmt.setString("@<colname>", <value>);"
    In doing ~14,000 individual inserts in 30 min I had two Exceptions thrown (Implicit conversion of "TEXT" to "VARCHAR" is not allowed), both at the same place and both repeatable. I put a print statement in the catch block and found that both were inserting the same 6 character string.
    Ran all the docs several times more and got the same number of failures on the same files.
    Querying the database I found that I had almost 5,000 other insert of the same string which were sucessful.
    Not able to identify what was different about the two failures, no unprintable characters, etc.
    Is this a JDBC issue or Sybase?
    What are the reasons that would cause this exception to be thrown when inserting 6 characters into a hole for 50?
    other ideas?
    Edited by: jjones3566 on Feb 17, 2009 10:50 AM

    jjones3566 wrote:
    Running jdk1.6.0_12, Linux RHE, Sybase 12.5 and connection with jconn3.jar
    Have a table with a column of type varchar(50)
    Was able to isolate the problem to this column, as the SQLException was thrown from the line "stmt.setString("@<colname>", <value>);"
    In doing ~14,000 individual inserts in 30 min I had two Exceptions thrown (Implicit conversion of "TEXT" to "VARCHAR" is not allowed), both at the same place and both repeatable. I put a print statement in the catch block and found that both were inserting the same 6 character string.
    Ran all the docs several times more and got the same number of failures on the same files.
    Querying the database I found that I had almost 5,000 other insert of the same string which were sucessful.That could an invalid assumption. The fact that they displayed the same does not make them the same.
    You would need to print the integer value of each character to insure they are the same.
    You should do that starting with the source and NOT what is in the database.
    If different then that is the source of the problem.
    If the same then it is probably just a bug in the driver/database which you are stuck with. Various solutions would be to try a conversion (format the SQL to take a text and convert to varchar) or trying playing with the commit level (commit 50 versus 5000 or whatever.)

  • [svn] 2236: Allow implicit conversion of Vector. * to Vector. T in strict mode.

    Revision: 2236<br />Author:   [email protected]<br />Date:     2008-06-25 11:48:59 -0700 (Wed, 25 Jun 2008)<br /><br />Log Message:<br />-----------<br />Allow implicit conversion of Vector.<*> to Vector.<T> in strict mode.<br /><br />Modified Paths:<br />--------------<br />    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/util/Context.java

    For some reason it just started to work now. Have no idea what didn't work before.

  • Implicit conversion issue

    Dear Sir,
    Does latest Oracle9i JDBC driver not support implicitly converting string to date?
    I try to execute "INSERT INTO TABLE DATETYPECOLUMN VALUES '2007-07-24 17:40:00' ".
    It works well using driver version 9.2.0.1, 9.2.0.3, 9.2.0.4, 9.2.0.5, but can't work using version 9.2.0.7, 9.2.0.8.
    So, why latest version doesn't cover legacy version?
    Thanks for your great help!
    Best regards,
    Brian

    Dear Avi,
    Thanks for your suggestion!
    As you said, I try not to modify the code because it involves many systems.
    So, the temporary solution is using legacy version JDBC driver but I'm not sure does legacy driver have any problem or not.
    I had tried to use JDBC driver version 10.2.0.2 and it produced the same result : ORA-01861: literal does not match format string.
    (My java version is jdk142_11.)
    I searched the readme doc. on Oracle JDBC driver download page, I can't find if latest verison driver doesn't support implicit conversion.
    Does the drivers after 9.2.0.7 really not support it?
    Thanks for your great help again!
    Best regards,
    Brian

  • Disallowed implicit conversion from data type datetime to data type timestamp

    Received error: [Macromedia][SQLServer JDBC
    Driver][SQLServer]Disallowed implicit conversion from data type
    datetime to data type timestamp, table 'myTbl', column 'duration'.
    Use the CONVERT function to run this query.
    I have a field named duration hh:mm:ss.lll that I am trying
    to insert into MS SQL. DB has field defined as [duration]
    [timestamp] NOT NULL,
    My insert has this: INSERT INTO myTbl( duration) VALUES(
    <cfqueryparam value="2006-05-26 11:12:13"
    cfsqltype="CF_SQL_TIMESTAMP"/> )
    Why does this not work? rrrrrrrrrrrrrr! BTW: also tried with
    seconds as 13.111 which did not work. Does the db duration need to
    be date? I just want to store a duration for the time of a movie...
    10 Q

    quote:
    Originally posted by:
    quiet1
    Received error: [Macromedia][SQLServer JDBC
    Driver][SQLServer]Disallowed implicit conversion from data type
    datetime to data type timestamp, table 'myTbl', column 'duration'.
    Use the CONVERT function to run this query.
    I have a field named duration hh:mm:ss.lll that I am trying
    to insert into MS SQL. DB has field defined as [duration]
    [timestamp] NOT NULL,
    My insert has this: INSERT INTO myTbl( duration) VALUES(
    <cfqueryparam value="2006-05-26 11:12:13"
    cfsqltype="CF_SQL_TIMESTAMP"/> )
    Why does this not work? rrrrrrrrrrrrrr! BTW: also tried with
    seconds as 13.111 which did not work. Does the db duration need to
    be date? I just want to store a duration for the time of a movie...
    10 Q
    Duration as a timestamp? How odd, most people would store it
    as an integer. Or, if you want to build your own string, the syntax
    is {ts 'yyyy-mm-dd hh:mm:ss'}. The seconds might not be required.
    In any event, use createodbcdatetime() for the value you want
    to put into your table.

  • When implicit conversion takes place

    hi all,
    I have two queries say
    sql>SELECT * FROM EMP WHERE HIREDATE BETWEEN '20-FEB-81' AND '20-FEB-82';
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
    7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
    7566 JONES MANAGER 7839 02-APR-81 2975 20
    7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
    7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
    7782 10 deleted MANAGER 7839 09-JUN-81 2450 10
    7839 10 deleted PRESIDENT 17-NOV-81 5000 10
    7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
    7900 JAMES CLERK 7698 03-DEC-81 950 30
    7902 FORD ANALYST 7566 03-DEC-81 3000 20
    7934 10 deleted CLERK 7782 23-JAN-82 1300 10
    AND
    sql>select '17-SEP-2010'+1 from dual;
    ERROR at line 1:
    ORA-01722: invalid number
    now in the first case i have passed a string and that got converted into a date
    but in the second case i am trying to add one day to the entered date it is not getting converted in the second case.
    when actually is implicit conversion done.
    thanks and regards,
    sri ram.

    I'd like to recommand you NEVER to rely on IMPLICIT conversion. It depends on the NLS_DATE_FORMAT parameter. If you supply a VARCHAR that can be converted to a date, it will use this default format to try and convert the date. But this can result of weird result if you don't know what is the NLS_DATE_FORMAT ;-)
    So, as an advice, always pass DATE to function that accept dates by converting them yourself (TO_DATE(a_date, 'the format you want')...
    Cheers,

  • Error on Implicit conversion

    Hey I have a problem to this query, yesterday function normaly, but we reboot the server and now send me this error message:
    Msg 245, Level 16, State 1, Line 1
    Conversion failed when converting the varchar value 'sdv' to data type int.
    this is the query, i wish to know what happend.
    SELECT ZKA.[CHECKTIME], ZKA.[SENSORID], ATT.[DESCRIPTION_EN], ATT.[LOCATION], ATT.[SUBTYPE], UI.[USERID], UI.[NAME], UI.[TITLE]
    FROM [att3000].[dbo].[CHECKINOUT] ZKA
    INNER JOIN [att3000].[dbo].[Universal_Devices] ATT
    ON ZKA.[SENSORID] = ATT.[FOREIGN_ID]
    INNER JOIN [att3000].[dbo].[USERINFO] UI
    ON ZKA.[USERID] = UI.[USERID]
    WHERE ZKA.[CHECKTIME] BETWEEN '2014-06-06 00:00:00.000' AND '2014-06-06 23:59:59.999'
    AND UI.[SSN] = 890 --
    AND ATT.[SUBTYPE] <> 4
    ORDER BY ZKA.[CHECKTIME] ASC

    Check whether one of the following attributes contain a non integer value as implicit conversion is happening here:
    --AND UI.[SSN] = 890 --
    ..AND ATT.[SUBTYPE] <> 4
    SELECT *
    FROM [att3000].[dbo].[USERINFO]
    WHERE ISNUMERIC([SSN]) = 0
    SELECT *
    FROM [att3000].[dbo].[Universal_Devices]
    WHERE ISNUMERIC([SUBTYPE]) = 0
    For a quick check if thee and not the joined columns are the problem, you can also quote the values to be a string instead of a numeric value instead.
    AND UI.[SSN] = '890' --
    AND ATT.[SUBTYPE] <> '4'
    Be aware that ISNUMERIC is not fully checking if the values are only [0-9] or of data types numeric as mentioned here:
    http://www.codeproject.com/Articles/12254/Is-it-really-Numeric
    -Jens
    Jens K. Suessmeyer http://blogs.msdn.com/Jenss

  • Should we replace all implicit conversion by explicit conversion

    Hi all, it's my first post in this forum, correct me if I do something incorrect.
    I just want to discuss this question from the performance point of view, so don't worry about the design or other stuff.
    I have read through many threads and articles, it seems that no one has explained my concern.
    If we replace the implicit conversion by explicit conversion, does it help for the performance?
    For example, I created the following table
    CREATE TABLE student (s_id tinyint, name varchar(20));
    INSERT INTO student VALUES (1,'name1'),(2,'name2'),(3,'name3')
    Does the following two queries make any difference from the performance point of view? As you can see, the first one applies implicit conversion, whereas the second one applies explicit conversion
    SELECT * FROM student WHERE s_id = '2';
    SELECT * FROM student WHERE s_id = CAST('2' AS tinyint);
    I understand that I should query using WHERE s_id = 2, but I just want to make this as a example to understand the difference between implicit and explicit conversion.
    Another related question is when I insert the records, is it better if I Cast the number to tinyint as follows?
    INSERT INTO student VALUES (CAST(4 AS tinyint),'name4')
    Thanks guys

    Hi,
    Implicit conversions leads to scans and can cause performance issue. Can you please refer to below technet article
    http://social.technet.microsoft.com/wiki/contents/articles/24563.sql-server-be-aware-of-the-correct-data-type-for-predicates-in-queries.aspx
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • ORA-01722: invalid number - Error during implicit conversion (10g vls 11g)

    I am facing oracle error for few SELECT queries in 11g which were working fine in 10g environment.
    Oracle Version:
    10g - 10.2.0.5.0
    11g - 11.2.0.3.0
    We are storing numeric values under CHAR or VARCHAR2 column in few tables. This is known design issue & it can't be changed for now.
    I know this will work fine until all the data is numeric in those columns for respective table. Because by some reason, if any row got character value for that column then implicit string to number conversion will fail and this error can occur. But I have verified that there is no data issue.
    But I can see difference in the execution plan! But not able to recognize the reason issue.
    Any other pointers on why the queries are failing in 11g would be of great help..
    Example SQL:
    Note that table structure and data is same in both the environments.
    View Definition -
    CREATE OR REPLACE FORCE VIEW CIMSOS.LC_LOCATIONS
    (   COUNTRY_ID,    PRODUCTID,
       LANGUAGE_ID,   LOCATION_NAME,
       LOCATION_SHORT_NAME,   TAG_ID,   LOCATION_DEFINITION,
       COMPOSITEKEY,   GLOBAL_LOCATION_KEY,
       CPRODUCTKEYID,   CMODVERSION)
    AS
       SELECT
              CCOUNTRY_ID AS COUNTRY_ID,
              CPRODUCTID AS PRODUCTID,
              CLANGUAGE_CODE AS LANGUAGE_ID,
              CLOCATION_NAME AS LOCATION_NAME,
              CLOCATION_SHORT_NAME AS LOCATION_SHORT_NAME,
              CTAG_ID AS TAG_ID,
              CLOCATION_DEFINITION AS LOCATION_DEFINITION,
              CCOMPOSITEKEY AS COMPOSITEKEY,
              CGLOBAL_LOCATION_KEY0 AS GLOBAL_LOCATION_KEY,
              cproductkeyid,
              cmodversion
         FROM mct_35193, goldencopy
        WHERE     cproductkeyid = productkey
              AND cmodversion = version
              AND catalogid = 35193;Facing issue for SQL query based on above view:
    ** In 10g Env
    SELECT * FROM LC_LOCATIONS WHERE productid = 75;
    -- It executes successfully and provide required results.
    Explain Plan:
    SELECT STATEMENT  ALL_ROWSCost: 12  Bytes: 416  Cardinality: 4                 
         4 NESTED LOOPS  Cost: 12  Bytes: 416  Cardinality: 4            
              1 INDEX RANGE SCAN INDEX CIMSOS.GOLDENCOPY_INDX1 Cost: 10  Bytes: 30,225  Cardinality: 2,015       
              3 TABLE ACCESS BY INDEX ROWID TABLE CIMSOS.MCT_35193 Cost: 1  Bytes: 89  Cardinality: 1       
                   2 INDEX UNIQUE SCAN INDEX (UNIQUE) CIMSOS.XPK_MCT_34342 Cost: 0  Cardinality: 1  ** In 11g Env
    SELECT * FROM LC_LOCATIONS WHERE productid = 75;
    ORA-01722: invalid number
    Explain Plan:
    SELECT STATEMENT  ALL_ROWSCost: 40  Bytes: 8,692  Cardinality: 82            
         3 NESTED LOOPS  Cost: 40  Bytes: 8,692  Cardinality: 82       
              1 TABLE ACCESS FULL TABLE CIMSOS.MCT_35193 Cost: 22  Bytes: 819  Cardinality: 9 
              2 INDEX RANGE SCAN INDEX CIMSOS.GOLDENCOPY_INDX1 Cost: 2  Bytes: 135  Cardinality: 9 
    -- Executes when value is passed as character.
    SELECT * FROM LC_LOCATIONS WHERE productid = '75';

    The problem doesn't appear to be related to the Oracle version, at least not directly. If your query plan does the string to number conversion before eliminating the rows that have non-numeric data, you'll get an error. If the query plan eliminates the rows that have non-numeric data before doing the conversion, the query will succeed. It is entirely possible that you'd get the "bad" plan in 10g or the "good" plan in 11g.
    You can capture the query plans from your 10g database and move them over to the 11g database. Oracle has a nice white paper on upgrading from 10g to 11g that walks you through that process.
    Of course, you really don't want to be dependent on the optimizer picking the "right" plan, you really want to fix the underlying data model issue.
    Justin

  • Whatever happened to implicit conversions?

    Java 6, with implicit "packaging" conversions:
    class  JE {
      JE( short x) {
            // blah
    class JN  {
        JN ( Short ... a ) {
            for( Short s : a )
             coll.add( new JE( s ) );
    new JN( 112,113,114,115 ) ); // <<<---  "The constructor JN( int, int, int, int) is undefined"???
    Does the code imply a "jump shift" (i.e. int to Short) that isn't going to work? The language spec says that a numeric literal such as 1 is either a int or a short, depending on the context. Well, this looks like context.

    DMF. wrote:
    new JN( 112,113,114,115 ) ); // <<<--- "The constructor JN( int, int, int, int) is undefined"Well, yeah, those are ints, not shorts. Always has been that way. Autoboxing and varags have nothing to do with it.
    import java.net.*;
    public class Z {
      Z(short s1, short s2, short s3, short s4) {}
      public static void main(String[] args) {
        new Z(1, 2, 3, 4);
    :; javac Z.java
    Z.java:7: cannot find symbol
    symbol  : constructor Z(int,int,int,int)
    location: class Z
        new Z(1, 2, 3, 4);
        ^This behavior has been part of Java as long as I've been working with it.
    Does the code imply a "jump shift" (i.e. int to Short) that isn't going to work? The language spec says that a numeric literal such as 1 is either a int or a short, depending on the context. Well, this looks like context.The JLS states a lot more details about how and when conversions occur, and this simply isn't one of those cases, nor has it ever been as far as I know.
    The expression 1 is and always has been of type int. Period. Java does not support automatic conversion of int to short in the following:
    import java.net.*;
    public class Z {
        static int x;
        static int y;
        static int z;
        static int w;
      Z(short s1, short s2, short s3, short s4) {}
      public static void main(String[] args) {
        new Z(x, y, z, w);
    }and the situation you present is identical to this one.
    Edited by: jverd on Aug 8, 2010 1:47 AM

  • Implicit conversion of a number to datetime

    I'm running on a SSIS 2008r environment.
    When I get a date as number of days difference with 1900-01-01 and I insert this number into a datetime column a Sql server database with SSIS  it seems as if SSIS subtracts 2 days when converting to datetime.
    For instance the number 41938 converted to a datetime should be 2014-10-28 (this is so if I do a select cast(41938 as datetime)).
    When using ssis to insert this number into a datetime field the result is 2014-10-26 when you select from the database afterwards.
    If I use a sql server command to insert this value in the target then it is converted to 2014-10-28.
    I know how to workaround this but my question is if this a known bug in SSIS 2008r2 or if it is just in the environment I am working in.

    Its not a bug but base date implemented in SSIS is different
    see this article where I've blogged on it
    http://visakhm.blogspot.in/2013/10/ssis-base-date-t-sql-base-date.html
    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

  • Implicit conversion working then not working (ORA-017222)

    I have a table like following:
    One of the SQL of my application does the following:
    SELECT C1 FROM MyTable WHERE C1 =

    Hi,
    What happened to the Query..
    SELECT C1 FROM MyTable WHERE C1 =
    You are checking the improper data types... in your Where Clause...that is the Issue.. User Appropiate Convesion Fucntions Like to_char, to_number... to work.. properly.. !!
    - Pavan Kumar N

  • Implicit and explicit Type conversion using Type object in heap

    Hi,
    I am surprised how Implicit and explicit Type conversion works using Type object in heap. for example when implicit type conversion occur what pointer it returns to object and similarly with explicit type conversion.

    Hello,
    >> I am surprised how Implicit and explicit Type conversion works using Type object in heap.
    For Implicit conversions: Typical examples are conversions from smaller to larger integral types, and conversions from derived classes to base classes. For the first one, the reference would be different which means it would return a different pointer to
    a new object. For the reference type, it actually points to the same memory location, you could use the object.ReferenceEquals() to check it.
    For Explicit conversions (casts):Typical examples include numeric conversion to a type that has less precision or a smaller range, and conversion of a base-class instance to a derived class. For first one, it would perform the same with implicit conversions.
    While for the conversion of conversion of a base-class instance to a derived class, actually, there's no built-in way to do this conversion.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for