Oracle convert function

Friends and Gurus,
Table: comments
column: c1
characterset: WE8IS08859P1
I am trying to use Oracle convert function to identify rowid's where column length greater than 4000 characters.
Table comments was created under 'WE8IS08859P1' characterset and I'm moving this table to 'AL32UTF8'.
I don't have csscan installed so trying to query sql and convert column to 'AL32UTF8' characteset and find rowid's to fix.
I have tried below but doesn't help
SELECT MAX(length(CONVERT(c1,'AL32UTF8'))) FROM comments;
SELECT length(CONVERT(c1,'AL32UTF8'))
FROM comments
WHERE length(c1) > 4000;
did anybody faced similar issue?

Hi,
Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
Simplify the problem as much as possible.  For example, instead of looking fro strings that have more than 4000 characters (or bytes), post a problem where you want to find strings longer than 4 characters (or bytes).
Always say which version of Oracle you're using (for example, 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002
Are you interested in the number of characters, or the number of bytes?  Use LENGTHB if you want the length in bytes.

Similar Messages

  • Oracle CONVERT Function use in ODI

    Hi,
    I am using the convert function while doing data transfer between 2 databases in ODI.
    The NLS_CHARACTERSET of source data base is WE8ISO8859P1 and that of the target is AL32UTF8.
    When I use CONVERT(v_string, WE8ISO8859P1, AL32UTF8) as a target column expression in ODI Designer, it converts the pound symbols '£' in source data to '¿' in the target database. But for all other usual characters there is no such problem observed
    If anyone has faced such issue and resolved it or know any workaround, your help would be appreciated.
    Thanks.

    Don't pass the '£' character in the v_string and simply pre-pend it to the correctly converted string

  • CONVERT function from SQL-Server 7.0 to Oracle

    Whenever a Convert function appears in the T-SQL, WorkBench converts it to RPAD and doesn't warm about it. How can I avoid this situation???
    It`s very urgent!! I`ve to migrate an entire system and I`m very short of time.
    Any comment would be helpfull!! Thanks!
    Julieta.

    THIS IS A DUPLICATE ENTRY AND REPLY, PLEASE USE ADD ADDITIONAL NOTES TO THE OTHER REPLY
    This has been logged as bug 1902143.
    Is altering the output from RPAD(12, 5, ' ') to RTRIM(RPAD(12, 5, ' ')) sufficient?
    Until this bug is fixed and released the only suggestion I can make is Generate Migration Scripts from the Action menu and then
    use an editor to alter the RPAD() to RTRIM(RPAD()).
    Turloch
    Oracle Migration Workbench Team

  • CONVERT function in SQL Server to oracle

    All,
    How to convert CONVERT function in SQL Server to oracle, below mentioned format is in SQL Server:
    variable1 = convert(numeric(20), SUBSTRING( parameter1,parameter2,parameter3)
    parameter1 datatype nvarchar2(100)
    parameter2 datatype bigint
    parameter3 datatype bigint
    I did bit R&D, but was not successful..but still getting on..
    If any help that would be great...
    Regards,
    ~ORA

    You cannot specify the precision/scale or length of input paramters to a stored procedure in Oracle, or at least the pl/sql engine does not respect the sizing. Assuming that you want to do something with variable1 in the procedure, and not just return it, the Oracle equivalent would be something along the lines of:
    SQL> CREATE FUNCTION f (p_param1 IN VARCHAR2,
      2                     p_param2 IN NUMBER,
      3                     p_param3 IN NUMBER) RETURN NUMBER IS
      4     l_var1 NUMBER(20) := SUBSTR(p_param1, p_param2, p_param3);
      5  BEGIN
      6     RETURN l_var1 * 10;
      7  END;
      8  /
    Function created.
    SQL> SELECT f('ABC10DEF', 4, 2) FROM dual;
    F('ABC10DEF',4,2)
                  100You may need to adjust the return type to match what you are actually returning.
    You can also use this iin a direct assignment in pl/sql without doig a select, something like:
    SQL> DECLARE
      2     l_num NUMBER(20);
      3  BEGIN
      4     l_num := f('ABC10DEF', 4, 2);
      5     DBMS_OUTPUT.Put_Line('The number is: '||l_num);
      6  END;
      7  /
    The number is: 100John

  • Need inputs on CONVERT function in oracle.

    My source DB is : US7ASCII
    My target DB is : AL32UTF8
    Basically I am using oracle CONVERT funciton to convert the data.
    Unforutnately AL32UTF8 is not predefined in CONVERT function.
    So, is there are any other ways to convert the data ? Plz let me know.
    Thx,
    Vi.

    You have two databases. Database A uses a US7ASCII character set. Database B uses an AL32UTF8 character set.
    - Is all the data in Database A actually US7ASCII data?
    - What version of Oracle is Database A running? What version of Oracle is Database B running?
    - On which database are you running the CONVERT function?
    - Why do you believe you need to use the CONVERT function? If you are moving data from one database to another, Oracle should automatically take care of character set conversion.
    Justin

  • Error in convert function

    Hi
    I am using this query for retreiving the records from sql server.
    When the query
    select "e1" as emp,"e2" as date,"e3" as one_year rom "tablename"@databaselink
    it is working fine but when the same query is used with the convert function on one of the column like
    select "e1" as emp,convert(varchar,"e2",101) as date,"e3 as one from from "tablename"@databaselink
    it is saying ora-00936 error missing expression
    please help in this

    Hi,
    So, just to be clear - you are using a database link to connect from an Oracle database to a Microsoft SQL Server database?
    Have you been able to run basic SQL statements across the database link (i.e. just a plain 'SELECT * FROM')? Also, does this same SQL work okay when you run it directly against SQL Server (not through the DB Link from Oracle)?

  • Oracle Spatial functionality with WFS

    Hi all
    My first post here so be gentle on me ;-)
    This may be an obvious question but here goes ...
    When using a WFS client can you access the full SDO_... SQL functions within Oracle Spatial? I've had a read of the WFS spec and it is all a bit vague on how the queries get passed through to the data store.
    Also with the WFS locking, is this done at the web server level? If so how would that impact on any direct access to the database? A bit dangerous??
    Appreciate any advice on WFS implemtations with a 9i back end. I want to retain the full native Oracle functionality and still deploy via WFS ... a pipe dream??
    Thanks
    Richard

    Thanks for your response Andreas
    Sorry, perhaps I wasn't clear, I realise the WFS client will never directly access the data source, that it is the WFS server that makes the request to the data store, not the client, but can the call be passed through to Oracle as native SQL?
    I think I found the answer in the OGC Filter Encoding Imp Spec where it desribes in great detail the optional filter component of a WFS request. It desribes the CQL filter operators that include some spatial operators. These could, I understand, be translated from CGL and Feature based schema to SQL (in GML?) and relational based schema.
    While I don't think at first glance that the spatial operators in CQL match all the Oracle SDO_ functions they probably go far enough for most normal users.
    Am I on the right track?
    Does anyone know of any work that has been done in this filter translation to SQL and if it has been implemented successfully anywhere.
    I think the locks would still pose a problem, but that's for another day :-)
    Thanks
    Richard

  • How to Oracle Database Function in OBIEE Administration Tool

    Hi All,
    I want to use a Oracle Database Function in as a column in OBIEE (BM, Presentation Model). Can anybody has done this inOBIEE. Any pointers to this is much appreicated.
    Thanks,

    Hi user7417334,
    You cannot use any formulas in the presentation layer (not that I know of). But you can definitely use oracle database functions in the BMM layer.
    You want to use the EVALUATE function. It works like this:
    e.x. EVALUATE( 'TO_DATE(%1,%2)' AS DATE, '12/31/2009', 'MM/DD/YYYY')
    Generic Version: EVALUATE( '<FUNC>' AS <DATATYPE>, VALUE1,VALUE2,etc)
    FUNC) Is the syntax for the function you are calling. Any parameters have to be replaced by %<number>, where number refers to the order in which you specify your parameters.
    DATATYPE) The datatype that the function will evaluate to. In this case, DATE.
    VALUE1) The latter part of the formula is a comma separated list of all the parameters used in the function. In this case, it's the date I want to cast
    VALUE2) This is the second parameter. You need as many as you referenced in your function. In this case, it's the date format.
    Good luck and if you found this post useful, please award points!
    best regards,
    -Joe

  • Execute Oracle Package Function call from FORTE

    Has anyone EVER successfully execute an Oracle Package Function call from FORTE
    via " sql execute procedure "?
    Here's my question, I am able to execute a stored procedure but hasn't figured
    out a way to execute a function which defined in a package. The syntax goes
    like this: sql execute procedure <PackageName>.<FunctionName> ( input
    input_parm, output output_parm). If anyone EVER successfully execute a
    function, please let me know, thanks.

    You'll need to provide a column alias for the function call:
    select func(val) as alias from dual

  • Oracle Asset (Functional) Practichttps:/e Questions for Interviews and Exam

    https://www.createspace.com/3495382
    http://www.amazon.com/Functional-Questions-Interviews-Certification-Examination/dp/1456311581/ref=sr_1_4?ie=UTF8&s=books&qid=1289178586&sr=8-4
    List Price: $29.99
    Add to Cart
    Oracle Asset (Functional) Practice Questions for Interviews and Certification Examination (Release 11i and 12)
    Functional Consultant
    Authored by Erp Gold
    This book contains 150 Oracle Asset Practice Questions for functional consultants. Very useful for interviews and certification examinations.
    Publication Date:
    Oct 26 2010
    ISBN/EAN13:
    1456311581 / 9781456311582
    Page Count:
    94
    Binding Type:
    US Trade Paper
    Trim Size:
    6" x 9"
    Language:
    English
    Color:
    Black and White
    Related Categories:
    Computers / General

    Reported as spam!

  • Oracle Asset (Functional) Practice Questions for Interviews and Exam

    https://www.createspace.com/3495382
    http://www.amazon.com/Functional-Questions-Interviews-Certification-Examination/dp/1456311581/ref=sr_1_4?ie=UTF8&s=books&qid=1289178586&sr=8-4
    List Price: $29.99
    Add to Cart
    Oracle Asset (Functional) Practice Questions for Interviews and Certification Examination (Release 11i and 12)
    Functional Consultant
    Authored by Erp Gold
    This book contains 150 Oracle Asset Practice Questions for functional consultants. Very useful for interviews and certification examinations.
    Publication Date:
    Oct 26 2010
    ISBN/EAN13:
    1456311581 / 9781456311582
    Page Count:
    94
    Binding Type:
    US Trade Paper
    Trim Size:
    6" x 9"
    Language:
    English
    Color:
    Black and White
    Related Categories:
    Computers / General

    Reported as spam!

  • Oracle Asset (Functional) Practice Questions for Interviews and Certificati

    https://www.createspace.com/3495382
    List Price: $29.99
    Add to Cart
    Oracle Asset (Functional) Practice Questions for Interviews and Certification Examination (Release 11i and 12)
    Functional Consultant
    Authored by Erp Gold
    This book contains 150 Oracle Asset Practice Questions for functional consultants. Very useful for interviews and certification examinations.
    Publication Date:
    Oct 26 2010
    ISBN/EAN13:
    1456311581 / 9781456311582
    Page Count:
    94
    Binding Type:
    US Trade Paper
    Trim Size:
    6" x 9"
    Language:
    English
    Color:
    Black and White
    Related Categories:
    Computers / General

    Reported as spam!

  • Using of Oracle Text functions not working in JDev

    Hi,
    I'm confused about using Oracle Text functions in JDeveloper.
    It's not possible for me to pass the sql syntax test while creating a view object with a custom query:
    SELECT score (1) myScore,
    dokumente.titel,
    ctx_doc.snippet ('idx_dokumente_titel',
    TO_CHAR (dokumente.dkt_id),
    'searchstring'
    ) snippet
    FROM dokumente
    WHERE contains (titel, 'searchstring', 1) > 0;
    I retrieve "ORA-00911:     invalid character" for the contains-function.
    (Using this statement in sql-worksheet works.)
    Any ideas?

    Hi william,
       Yes you need code abap to maintein your data. look at <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/2f/696d360856e808e10000009b38f839/frameset.htm">Business Data Toolset</a>, in the part of Dialog.
    Regards.
    Manuel

  • Oracle stored functions and where clauses

    Hello everybody,
    I need to call an Oracle stored function and at the same time do a select on
    the result of the query, it works well except when I use a where clause. I
    am connecting to Oracle 8.1.7 through OLEDB using the Oracle provider for
    OLEDB distributed with this Oracle version.
    Here is the query I am doing:
    select * from {call MC.SEC.QryTermbases(?, ?) where ID = ?}
    If I remove the where clause it works well but I need to use the where. I
    know that I could pass the parameter to the procedure instead of doing that
    in the select but there are places where I can not do that since the SQL
    query is generated dynamically. The code above is just a demo.
    Thanks very much for your help,
    Jose.

    Thanks for answering, it is actually possible to do a select on the return of a function, I have tested it with other than "select *" and it has worked well. What has not worked for me is using a "where" clause. That is "select" without "where" has worked but not with the "where".
    I also suspect that it does not work but similar queries work well in MSSQL 2000 and Interbase 6.0 so I thought may be there was a way to do that with Oracle. That is in MSSQL I can treat the result of a function as a normal table and I can do the same thing with a stored procedure that returns a recordset in Interbase.
    Thanks again for answering,
    Jose.

  • Oracle 9i function to perform data manipulation

    Hi everyone,
    I have two scenarios. I would like to write one Oracle 9i function that can accommodate both these scenarios, using PL/SQL developer. I intend passing a varchar2 parameter to this function. Within the function, I perform a select on a table and see if this value sent has a parent record.
    If it does not have a parent record (null or blank) then I take this value, join with another table, perform some processing and return one varchar2 value.
    If it has a parent record (not null or not blank) then I need to retrieve all the other children records associated with this same parent record, take this value, join with another table,perform some processing and return one varchar2 value.
    I have two simple queries that I wrote: one for record with null/blank parent, and the other for record with same parent and other children. These two queries work individually, when I combine them is where I run into problems. Sample table:
    TABLE XYZ data: (note: if there is a parent, parent shows up in both parent and child field in the table)
    child parent
    1234
    5107 3167
    6259 3652
    5678 9754
    3167 3167
    3652 3652
    1649
    2306 9754
    4657 3652
    9754 9754
    8753 3652
    passing record 1234 into the function.
    SELECT A.child, A.parent, C.field1
    FROM OTHERTABLE C,
    (SELECT TableA.child, TableA.parent
    FROM XYZ TableA
    WHERE TableA.child ='1234')A
    WHERE A.child = C.field2
    ----(output of this query is 1 record with 3 fields 1234 and null/blank and 987654321. I place this output into a cursor and then take 987654321 and place into a variable and return this value)
    passing record 4657 into the function
    SELECT c.CHILDfield, c.PARENTfield, TableOther.field1
    FROM OTHERTABLE TableOther,(
    (SELECT B.CHILDfield, B.PARENTfield FROM
    (SELECT A.PARENTfield, i.CHILDfield FROM TableB,
    (SELECT TableA.CHILDfield, TableA.PARENTfield
    FROM XYZ TableA
    WHERE TableA.CHILDfield ('4657' ))A
    -- pass 4657 and then get the parent
    WHERE A.PARENTfield = TableB.PARENTfield)B
    -- gets associated children with the parent from previous query.
    -- note: parent can exist in the parent and child fields
    WHERE B.CHILDfield <> B.PARENTfield))C
    --strips off the parent and gets child/children only as I don't need
    --the parent when it is also a child
    WHERE C.CHILDfield = TableOther.field1
    --(output of this query is 3 records
    4657 3652 912345671
    6259 3652 945362798
    8753 3652 934274857)
    I place this output into a cursor and then have a CASE statement that goes thru each record, and appends the third value into a variable, the ultimate return value of this will be as follows:
    912345671;945362798;934274857)
    The dilemma is writing a generic query to accommodate both these situations. My current function can handle each of these situations individually, but not both. For testing purposes, I change the select statement depending on whether I have a record that has a parent on not!
    Any help is greatly appreciated.

    You want one function to handle two cases? This is the best opportunity to use the IF STATEMENT.
    FUNCTION MyFunc (p_input IN VARCHAR2) RETURN VARCHAR2 IS
    ReturnValue VARCHAR2;
    BEGIN
    IF <blank or null test> THEN
    SELECT ... -- Blank or null select statement
    ... -- Blank or null data processing
    RETURN ReturnValue;
    ELSE
    SELECT ... -- Other select statement
    ... -- Other data processing
    RETURN ReturnValue;
    END IF;
    END MyFunc;

Maybe you are looking for

  • Odd 120g charging behavior

    I have this posted in other threads that talk about the Creative X-Dock but I am reposting the question here because I am starting to think it is not X-Dock related... I can pretty much get my 120g to charge on my X-Dock by pressing and holding Play/

  • Diff b/w group vs local currency (both curr same) in Inventry GL A/c

    There is a difference  b/w group vs local currency on trial balance (where both currencies are same) in Inventory GL account, which are supposed to match. Any Probable reasons...

  • How to create multiple copies of a file with renamed filenames

    hi,  I want to create multiple copes of a  file [ say abc.docx] which has 3.5 MB of size  and want to rename it through power shell. so, in the end, i want to get abc_1.docx,abc_2.docx, abc_3.docx ....abc_10.docx in the same folder with the same size

  • Path direction in Oracle spatial network data model

    Hi all, can any one help me how to implement path direction using oracle network data Model? We are using Oracle Spatial database. there is one feature called network constraint in Network data Model. but how to implement path direction of my Network

  • Can't get tween to work

    I have a number of movie clips in an array that I am cycling through presenting, fading and then removing. I am attaching the clips to the mc variable mClip1. mClip1 works for everything other than the tween where it just seems to skip the instructio