Oracle equivalent of DB2 DIGITS function

IBM DB2 has a DIGITS SQL function that returns a character-string representation of a number, with the following properties:
The result of the function is a fixed-length character string representing the absolute value of the argument without regard to its scale. The result does not include a sign or a decimal character. Instead, it consists exclusively of digits, including, if necessary, leading zeros to fill out the string.
For example, for a NUMBER(6,2) column with value -6.28, the string '000628' is returned.
Is there an equivalent SQL function available in Oracle 10g? Or if there's no equivalent, how can this be done in Oracle 10g?

So, looks like behavior of DIGITS function depends not only on the value of the parameter passed, but also on the datatype of the actual parameter (implicitly derived from the datatype of the column name being passed).
In other words, you can not simply call DIGITS (-6.18) because the result could be different for different precision/scale combinations:
NUMBER(6,2) -> 000618
NUMBER(3,2) -> 618
NUMBER(6,3) -> 006180
I don't think Oracle has a mechanism of accessing the datatype of the actual argument from within the function (?)
So, you would need to pass the precision and scale of the argument datatype separately:
create or replace function digits (n number, precision number, scale number) return varchar2 as
begin
return lpad (abs(n)*power(10,scale),precision, '0');
end;
SQL> select digits (-6.18, 6, 3) from dual;
006180
SQL> select digits (-6.18, 3,2) from dual;
618
SQL> select digits (-6.18, 6,2) from dual;
000618
To replace DIGITS in your DB2 code, you would need to build a conversion that would look up the precision and scale of the column for each call and substitute them into the call accordingly.

Similar Messages

  • Equivalent of DB2  functions in ORACLE 11g

    Hi,
    I am trying to convert the SQL queries written in DB2 to ORACLE. There are some db2 specific functions are used in the queries.I am not able to find the equivalent function in ORACLE. The function names are written below:
    1) DateDD()
    2) SELECT @@IDENTITY
    3) SELECT *
    FROM (
    SELECT ROWNUMBER() OVER() AS rowId_1, INNER_TABLE.*
    FROM (----)as innertable
    ) AS Outertable
    Error is: ROWNUMBER is INVALID identifier.
    4) DAYOFWEEK()
    5) DAYS()
    6) dayofyear()
    Please help me in finding the equivalent function in ORACLE.
    Thanks in advance!!

    You probably don't need a DateAdd function in Oracle. You can add a number to a date in Oracle-- that adds the number of days to the date.
    SELECT sysdate today, sysdate+1 tomorrow
      FROM dualWhy are you using DAYS()? If, as in the example, you're just trying to determine the number of days between two dates, you can subtract dates in Oracle and the difference will be a number of days (including a fractional component if applicable)
    SELECT date '2011-09-27' - date '2011-09-25' difference_in_days
      FROM dualIf you really need the number of days since January 1, 0001, you could subtract the date from Jan 1, 0001, i.e.
    SELECT date '2011-09-27' - date '0001-01-01'
      FROM dualI would assume that Oracle and DB2 would return the same number but there could well be some differences since the current calendar didn't exist in the year 1 and I know there were issues in the transition from the Gregorian to the Julian calendar where some days were decreed not to exist. It wouldn't shock me if Oracle and DB2 counted some of the days in the 1500's differently.
    Justin

  • DB2 DIGIT  FUNCTION IN ORACLE

    What is the DB2 DIGIT FUNCTION equivalent in ORACLE database. We have done a migration from db2 to oracle and many programs just fails where I encounters digit function. Is there any workaroud or function present in oracle database which makes the program working.
    Just share your knowledge .
    [email protected]

    Addendum ...
    OK I found what the DIGIT function does.
    I am not sure if there is a function in Oracle that maps directly to DIGIT function in DB2
    but you can do something like this:
    select lpad(replace(to_char(abs(n)),'.'),
    (select to_number(data_precision) from user_tab_columns where table_name = 'A' and column_name = 'N'),'0')
    from a
    In the SQL above n is the column in table A. Data_precision column gets the size of the column.
    Option 2:
    You could write your own function in Oracle to do what the SQL above does
    create or replace function digit (col_val in number, col_name IN varchar2, tab_name IN varchar2) return varchar2
    as
    v_val varchar2(100);
    v_prec number;
    begin
    select to_number(data_precision) into v_prec from user_tab_columns where table_name = upper(tab_name) and column_name = upper(col_name);
    v_val := lpad(replace(to_char(abs(col_val)),'.'),v_prec,'0');
    return v_val;
    end;
    Then use the function as follows:
    select digit(n,'N','A') from a
    Shakti
    http://www.impact-sol.com
    Developers of Guggi Oracle - Tool for DBAs and Developers
    Message was edited by:
    skgoel

  • Oracle equivalent of DECRYPT_CHAR() in DB2

    Dear All,
    We are working in a migration project. We are migrating ODI interfaces from DB2 to Oracle.
    The function DECRYPT_CHAR() is used in one of the procedure script. I could not able to find oracle equivalent of DECRYPT_CHAR() function.
    Could you anyone please provide any pointers on this.
    Thanks a lot in advance.

    Hi,
    As per my experience, there is NO direct function reside for this in Oracle, rather it has inbuild packages to do decryption and encryption but still you need to create a user defined function in your schema.
    Thanks,
    Guru

  • What is the Oracle equivalent of the Microsoft Access FIRST function?

    Using: Oracle 10gR2 RAC on SUSE Linux 9 (10.2.0.3)
    In the process of converting a Microsoft Access database to Oracle, an Access query is using the FIRST function.
    What is the Oracle equivalent of the Microsoft Access FIRST function?
    In the attempt to convert, the Oracle FIRST_VALUE function was used. However, the same results was not achieved.
    Thanks,
    (BLL)
    Query:
    h2. ACCESS:
    SELECT
         TRE.GCUSNO,
         UCASE([DCUSNO]) AS DCUSNO_STD,
         *FIRST(UCASE([DNAME])) AS DNAME_STD*,
         *FIRST(UCASE([DADDR])) AS DADDR_STD*,
         *FIRST(UCASE([DCITY])) AS DCITY_STD*,
         TRE.DSTATE,
         FIRST(TRE.DZIP) AS DZIP,
         TRE.DREGN,
         TRE.DDIST,
         TRE.DSLSMN,
         TRE.DCHAIN,
         TRE.MARKET,
         TRE.MKTPGM,
         TRE.EUMKT
    FROM
         TRE
    GROUP BY
         TRE.GCUSNO,
         UCASE([DCUSNO]),
         TRE.DSTATE,
         TRE.DREGN,
         TRE.DDIST,
         TRE.DSLSMN,
         TRE.DCHAIN,
         TRE.MARKET,
         TRE.MKTPGM,
         TRE.EUMKT;
    h2. ORACLE:
    SELECT DISTINCT
    TRE.GCUSNO,
    UPPER(TRIM(TRE.DCUSNO)) AS DCUSNO_STD,
    UPPER(TRIM(TRE.DNAME)) AS DNAME_STD,
    UPPER(TRIM(TRE.DADDR)) AS DADDR_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DNAME)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DNAME_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DADDR)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DADDR_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DCITY)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DCITY_STD,
    TRE.DSTATE,
    TRE.DZIP,
    FIRST_VALUE(UPPER(TRIM(TRE.DZIP)) IGNORE NULLS) OVER (ORDER BY TRE.DZIP ASC) AS DZIP,
    TRE.DREGN,
    TRE.DDIST,
    TRE.DSLSMN,
    TRE.DCHAIN,
    TRE.MARKET,
    TRE.MKTPGM,
    TRE.EUMKT
    FROM CRM.TREUP100R TRE
    GROUP BY
    TRE.GCUSNO,
    UPPER(TRIM(TRE.DCUSNO)),
    TRE.DNAME,
    TRE.DADDR,
    TRE.DCITY,
    TRE.DSTATE,
    TRE.DZIP,
    TRE.DREGN,
    TRE.DDIST,
    TRE.DSLSMN,
    TRE.DCHAIN,
    TRE.MARKET,
    TRE.MKTPGM,
    TRE.EUMKT;

    A slight correction to odie's post. I think you want min not max to replicate the Access first function, but see below to be sure. So:
    min(upper(trim(tre.dname))) keep (dense_rank first order by tre.gcusno) as dname_std
    user10860953 wrote:How does one ignore null values?The min and max functions will ignore nulls automatically, so if there is a null value in tre.dname, it will not be be returned, unless all of the values are null. For example:
    SQL> WITH t AS (
      2     SELECT 65 id, 'ABCD' col FROM dual UNION ALL
      3     SELECT 37, 'DEFG' FROM dual UNION ALL
      4     SELECT 65, 'DEFG' FROM dual UNION ALL
      5     SELECT 65, null FROM dual UNION ALL
      6     SELECT 70, null FROM dual UNION ALL
      7     SELECT 70, null FROM dual UNION ALL
      8     SELECT 37, 'ABC' from dual)
      9  SELECT id,
    10         MIN(col) keep (DENSE_RANK FIRST ORDER BY id) min_dname_std,
    11         MAX(col) keep (DENSE_RANK FIRST ORDER BY id) max_dname_std
    12  FROM t
    13  GROUP BY id;
            ID MIN_ MAX_
            37 ABC  DEFG
            65 ABCD DEFG
            70John

  • Decimal equivalent of db2 in oracle

    Hi
    I have query in db2 which has decimal in bother operands
    select decimal(fuelused)/decimal(fuelconsumed) from fuel.
    can anyone please help me what would be the sql (oracle) equivalent for that.
    Thanks
    Smitha.

    3. Week_ISO which gives week of the year.to_char(date_column, 'YYYYWW') is what I think is the equivalent. Check
    SQL> ed
    écrit fichier afiedt.buf
      1  select to_char(to_date('01012005','DDMMYYYY'),'YYYYWW'),
      2         to_char(to_date('01012005','DDMMYYYY'),'YYYYIW')
      3* from dual
    SQL> /
    TO_CHA TO_CHA
    200501 200553
    SQL> WW is week number from 1 (first january) to 53.
    IW is ISO week number : in this case, there is an error, the 1st january 2005 is the 52d week of year 2004. Check the doc :
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/sql_elements4a.htm#36369
    Nicolas.

  • Oracle from DB2 federation - function mapping

    I need to map an Oracle function (instr) from an InfoSphere function (postion) from the DB2 database, so this is more of a DB2 question, but never could get an answer out of DB2ools ;-)
    I have created the wrapper, server, user mapping and nicknames in DB2, but need to create a function mapping in DB2 between their "position(search, source, code) to our instr(search, source). This is a mapping of system functions, so I am not sure if it is possible... and their documentation is kludgy at best. The problem is this: POSITION(search, source, code), where code represents UTF-16, UTF-32 or code page translation. I want to force this syntax to pass to Oracle as INSTR(search, source), dropping their 'code'.
    This is the only function that does not work properly from the DB2 side to us. If anyone has the DB2 create function mapping command to do the above, my appreciation for the answer and condolences that you actually had to go thru the reams of IBM documentation.

    Addendum ...
    OK I found what the DIGIT function does.
    I am not sure if there is a function in Oracle that maps directly to DIGIT function in DB2
    but you can do something like this:
    select lpad(replace(to_char(abs(n)),'.'),
    (select to_number(data_precision) from user_tab_columns where table_name = 'A' and column_name = 'N'),'0')
    from a
    In the SQL above n is the column in table A. Data_precision column gets the size of the column.
    Option 2:
    You could write your own function in Oracle to do what the SQL above does
    create or replace function digit (col_val in number, col_name IN varchar2, tab_name IN varchar2) return varchar2
    as
    v_val varchar2(100);
    v_prec number;
    begin
    select to_number(data_precision) into v_prec from user_tab_columns where table_name = upper(tab_name) and column_name = upper(col_name);
    v_val := lpad(replace(to_char(abs(col_val)),'.'),v_prec,'0');
    return v_val;
    end;
    Then use the function as follows:
    select digit(n,'N','A') from a
    Shakti
    http://www.impact-sol.com
    Developers of Guggi Oracle - Tool for DBAs and Developers
    Message was edited by:
    skgoel

  • Oracle equivalent to SQL SERVER CLRClipString function

    Hello Friends,
    I am running the following sql query in SQL SERVER successfully ..
    select * from
    CLRSplitString('33,54,105,148,149,163,165,179,193,195,201,202,234,239,279,282,297,299,329,332,350,415,417,439,440,500,552,570,589,603,628,655', '', ',') x
    join dbo.PART_ADDL_INFO_NAMES_V v on x.col1 = v.addl_info_name_id
    I want to implement the same sql statement in ORACLE .
    I created the function that takes comma seperated string and display as single column .. I want to implemement in oracle as a sql statement ..
    create or replace function str2tbl
         (p_str in varchar2,
         p_delim in varchar2 default '.')
         return myTableType
    as
         l_str     long default p_str || p_delim;
         l_n     number;
         l_data myTableType := myTabletype();
    begin
         loop
         l_n := instr( l_str, p_delim );
         exit when (nvl(l_n,0) = 0);
         l_data.extend;
         l_data( l_data.count ) := ltrim(rtrim(substr(l_str,1,l_n-1)));
         l_str := substr( l_str, l_n+length(p_delim) );
         end loop;
         return l_data;
    end;
    DECLARE
    v_array mytabletype;
    BEGIN
    v_array := str2tbl ('10.01.03.04.234');
    FOR i IN 1 .. v_array.COUNT LOOP
         DBMS_OUTPUT.PUT_LINE (v_array(i));
    END LOOP;
    END;
    10
    01
    03
    04
    234
    appreciate your help ..
    thanks

    If you need to split a single string:
    with t as (
               select '33,54,105,148,149,163,165,179,193,195,201,202,234,239,279,282,297,299,329,332,350,415,417,439,440,500,552,570,589,603,628,655' str from dual
    select  regexp_substr(str,'[^,]+',1,level) sub_str
      from  t
      connect by level <= regexp_count(str,',') + 1
    SUB_STR
    33
    54
    105
    148
    149
    163
    165
    179
    193
    195
    201
    SUB_STR
    202
    234
    239
    279
    282
    297
    299
    329
    332
    350
    415
    SUB_STR
    417
    439
    440
    500
    552
    570
    589
    603
    628
    655
    32 rows selected.
    SQL> SY.
    P.S. REGEXP_COUNT is available in 11g only. If you are on 10g use:
    with t as (
               select '33,54,105,148,149,163,165,179,193,195,201,202,234,239,279,282,297,299,329,332,350,415,417,439,440,500,552,570,589,603,628,655' str from dual
    select  regexp_substr(str,'[^,]+',1,level) sub_str
      from  t
      connect by level <= length(regexp_replace(str,'[^,]')) + 1
    /

  • Looking for the oracle equivalent of T-SQL 'SELECT TOP n'

    Hi,
    I'm looking for the Oracle equivalent of T-SQL 'SELECT TOP n'
    and can't find any. There is SAMPLE(n) function but it supposed
    to pick up random values and I'm not sure if it's possible to
    make it select top values. Please help 8-)
    Thanx

    Hi Marina.
    Oracle does not have a functionality like SQL Server for TOP
    selection. The ROWNUM option should be used with great care and
    you may get unreliable results.
    Try looking at Metalink
    Doc ID: 291065.999
    Doc ID: 267329.999
    - They discuss this issue, and solutions.

  • Oracle equivalent to SQL Server Table Variables ?

    Does Oracle have anything equivalent to SQL Server table variables, that can be used in the JOIN clause of a select statement ?
    What I want to do is execute a query to retrieve a two-column result, into some form of temporary storage (a collection ?), and then re-use that common data in many other queries inside a PL/SQL block. I could use temporary tables, but I'd like to avoid having to create new tables in the database, if possible. If I was doing this in SQL Server, I could use a table variable to do this, but is there anything similar in Oracle ? SQL Server example:
    use Northwind
    DECLARE @myVar TABLE(CustomerID nchar(5), CompanyName nvarchar(40))
    INSERT INTO @myVar(CustomerID, CompanyName)
    select CustomerID, CompanyName
    from Customers
    --Join the variable onto a table in the database
    SELECT *
    FROM @myVar mv join Customers
    on mv.CompanyName = Customers.CompanyName
    The closest I've found in Oracle is to use CREATE TYPE to create new types in the database, and use TABLE and CAST to convert the collection to a table, as shown below. I can't see anyway without creating new types in the database.
    CREATE TYPE IDMap_obj AS Object(OldID number(15), NewID number(15));
    CREATE TYPE IDMap_TAB IS TABLE OF IDMap_obj;
    DECLARE
    v_Count Number(10) := 0;
    --Initialize empty collection
    SourceIDMap IDMap_TAB := IDMap_TAB();
    BEGIN
    --Populate our SourceIDMap variable (dummy select statement for now).
    FOR cur_row IN (select ID As OldID, ID + 10000000 As NewID From SomeTable) LOOP
    SourceIDMap.extend;
    SourceIDMap(SourceIDMap.Last) := IDMap_obj(cur_row.OldId, cur_row.NewId);
    END LOOP;
    --Print out contents of collection
    FOR cur_row IN 1 .. SourceIDMap.Count LOOP
    DBMS_OUTPUT.put_line(SourceIDMap(cur_row).OldId || ' ' || SourceIDMap(cur_row).NewId);
    END LOOP;
    --OK, can we now use our collection in a JOIN statement ?
    SELECT COUNT(SM.NewID)
    INTO v_Count
    FROM SomeTable ST JOIN
    TABLE(CAST(SourceIDMap As IDMap_TAB)) SM
    ON ST.ID = SM.OldID;
    DBMS_OUTPUT.put_line(' ' );
    DBMS_OUTPUT.put_line('v_Count is ' || v_Count);
    END;

    Hi, got this from our plsql guys:
    The term "table function" is a bit confusing here. In Oracle-speak, it means a function that can be used in the from list of a select statement thus:
    select * from Table(My_Table_Function()),..
    where...
    The function's return type must be a collection that SQL understands. So for the interesting case -- mimicking a function with more than one column -- this would be a nested table of ADTs where both the ADT and the nested table are defined at schema level. PL/SQL -- by virtue of some clever footwork -- allows you to declare the type as a nested table of records where both these types are declared in a package spec. This alternative is generally preferred, especially because the nested table can be of Some_Table%rowtype (or Some_Cursor%rowtype if you prefer).
    As I understand it from our man on the ANSI committee, our use terminology follows the standard.
    The construct below seems to be a bit different (though there are similarities) because it appears from your code sample that it's usable only within procedural code. And the object from which you select is a variable rather than a function.
    So, after that preamble... the answer would be:
    No, we don't have any constructs to let you "declare" something that looks like a regular schema-level table as a PL/SQL variable -- and then use (static) SQL on it just as if it were a schema-level table.
    But yes, you can use PL/SQL's pipelined table function to achieve much of the same effect.
    Look at the attached Table_Function.sql.
    It shows that you can populate a collection of records using ordinary PL/SQL code. You can't use SQL for insert, update, or delete on such a collection. I see that SQL Server lets you do
    insert into Program_Variable_Table select... from Schema_Level_Table
    The PL/SQL equivalent would be
    select...
    bulk collect into Program_Variable_Collection
    from Schema_Level_Table
    The attached shows that once you have populated your collection, then you can then query it with regular SQL -- both from inside PL/SQL code and from naked SQL.
    and the code is here
    CONNECT System/p
    -- Drop and re-create "ordinary" user Usr
    EXECUTE d.u
    CONNECT Usr/p
    create table Schema_Things(ID number, Description Varchar2(80))
    create package Pkg is
    subtype Thing_t is Schema_Things%rowtype;
    type Things_t is table of Thing_t; -- index by pls_integer
    Things Things_t;
    -- PLS-00630: pipelined functions must have
    -- a supported collection return type
    -- for "type Things_t is table of Thing_t index by pls_integer".
    function Computed_Things return Things_t pipelined;
    procedure Insert_Schema_Things(No_Of_Rows in pls_integer);
    end Pkg;
    create package body Pkg is
    function Computed_Things return Things_t pipelined is
    Idx pls_integer;
    Thing Thing_t;
    begin
    Idx := Things.First();
    while Idx is not null loop
    pipe row (Things(Idx));
    Idx := Things.Next(Idx);
    end loop;
    end Computed_Things;
    procedure Insert_Schema_Things(No_Of_Rows in pls_integer) is
    begin
    Things := Things_t();
    Things.Extend(No_Of_Rows);
    for j in 1..No_Of_Rows loop
    Things(j).ID := j;
    Things(j).Description := To_Char(j, '00009');
    end loop;
    insert into Schema_Things
    select * from Table(Pkg.Computed_Things());
    end Insert_Schema_Things;
    end Pkg;
    -- Test 1.
    begin Pkg.Insert_Schema_Things(100); end;
    select * from Schema_Things
    -- Test 2.
    begin
    Pkg.Things := Pkg.Things_t();
    Pkg.Things.Extend(20);
    for j in 1..20 loop
    Pkg.Things(j).ID := j;
    Pkg.Things(j).Description := To_Char(j, '00009');
    end loop;
    for j in 1..5 loop
    Pkg.Things.Delete(5 +2*j);
    end loop;
    end;
    select * from Table(Pkg.Computed_Things())
    /

  • Connecting via Datasource - Oracle equivalent to DB2DataSource

    Hi
    Have anybody use to connect to oracle via Datasource (using JNDI rather using driver managers) for J2EE (no EJB) development ? (I use WSAD 5.0)
    I had in DB2 there is a class called "DB2DataSource " coming from a package COM.ibm.db2.jndi.DB2InitialContextFactory..
    By digging into Oracle documents in their site they said use following to get InitialContextFactory...
    import com.evermind.sql.DriverManagerDataSource;
    import com.evermind.server;
    Also I included jndi.jar in the project.
    Still I am getting error for above two packages. Where does these packages reside.
    (I have oracle 9i free downloaded version installed)
    What is OC4J ?
    Oracle also said JNDI will beloaded by OC4J.
    Thanks
    Mei

    Hi all
    Thanks for not responding to my question.
    I found that the oracle equivalent package was,
    import oracle.jdbc.pool.OracleDataSource;
    I am all set..
    Mei..

  • How to config Check Digits function module for Student Number Validation

    Hi SLCM Experts,
    In the SAP-SLCM, How to use check digits function module for validate student number.  Just only config it or need to customizing program.
    *Any idea to student number validation in SLCM?*
    Best Regards,
    Suvatchai K.

    Hi ,
    Can you expalin it further ?
    You configure the St. no in piq_matr . And set it  as external or internal no. range which suits your business .
    What is the validation you are looking for ?
    Regards
    Gajalakshmi

  • Configuration issue with DRDA Oracle 10g to DB2 UDB v8

    Oracle 10.2.0.4 linux RH 64 bit - DB2 UDB v8.2 linux 32 bit. I'm attempting to install transparent gateway to connect from my oracle instance to the db2 instance. I was successful until the step requiring the package rebind and this is the error I get:
    SQL> exec GTW$_BIND_PKG@MYDB2SERVER;
    BEGIN GTW$_BIND_PKG@MYDB2SERVER; END;
    ORA-04052: error occurred when looking up remote object
    DB2USER.GTW$[email protected]
    ORA-00604: error occurred at recursive SQL level 1
    ORA-28527: Heterogeneous Services datatype mapping error
    TG4DRDA v10.2.0.1.0 grc=0, drc=-332 (865B,0001), errp=GDJREACS
    errmc=1208,819
    ORA-02063: preceding 3 lines from MYDB2SERVERMy TNSNAME entry:
    MYDB2SERVER =
      (DESCRIPTION =
            (ADDRESS=
              (PROTOCOL=TCP)
              (PORT=1521)
              (HOST=172.xx.xx.xx))
            (CONNECT_DATA=(SID=MYDB2SERVER)
            (HS=)
    LISTENER entry:
       (SID_DESC=
            (SID_NAME=MYDB2SERVER)
            (ORACLE_HOME=/home/oracle/oraHomes/gateway)
            (PROGRAM=g4drsrv)
       )DBlink:
    SQL> create public database link MYDB2SERVER
      2  connect to db2user identified by mypass
      3  using 'MYDB2SERVER';initMYDB2SERVER.ora (lines I changed):
    DRDA_CONNECT_PARM=172.xx.xx.xx:50000
    DRDA_REMOTE_DB_NAME=db2
    DRDA_RECOVERY_PASSWORD=mypassI'm sure it's just a simple config issue, but I've been racking my rain for hours trying different things and cannot figure it out.
    Question - DRDA_REMOTE_DB_NAME - is the the O/S user? or the database instance name? For example, when accessing the DB2 instance, I login to the O/S as db2user but issue 'db2 connect to db2' when connecting to the instance - which value is DRDA_REMOTE_DB_NAME looking for?
    Any help is appreciated - thanks

    Hi,
    You are right, DRDA_REMOTE_DB_NAME should have the name of the Db2 instance.
    The error you are getting points to the fact that you are an multibyte character set in either Oracle and/or DB2. The gateway can connect, but first have to be able to map the character sets indicated by the error message:
    TG4DRDA v10.2.0.1.0 grc=0, drc=-332 (865B,0001), errp=GDJREACS errmc=1208,819 <<== 1208 and 819 are the CCSIDs
    Add the following entries to the gateway codepage.map file -
    S 367 > US7ASCII
    D 13488 > AL16UTF16
    D 1200 = AL16UTF16
    M 1208 = UTF8
    MBC 1208 = 1208 1200
    The default location of the file is $ORACLE_HOME/tg4drda/admin/codepage.map
    These values map code page 1208 to Oracle's UTF8 character sets so that the gateway can translate UTF8 data into code page 819 (WE8ISO8859P1).
    Regards,
    Ed

  • Equivalent to calling a function in labview

    Hi,
    I don't use Labview regularly and would appreciate some advice for what is probably a straightforward problem! If I have one process started and running in a while loop, how can I start and run a second process in another while loop while simultaneously stopping the first while loop? For example, I have a button which when pressed turns on an indicator. When a second button is pressed the first indicator goes off and the second goes on simultaneously.
    Thanks for your help.

    Nested Loops?
    Edit to add: This is not the equivalent to calling a function like in C. The equavilant to calling a function in LV is to make a sub-vi. The sub-vi would be the same as a function. Place the sub-VI on another (higher level) block diagram and wire to it is like calling that function.

  • Oracle equivalent of MySql commands and code.

    Hi,
    Does anyone know the Oracle equivalent of the following? I'm not a DBA and my DBA doesn't know MySQL. TIA
    Assign access rights: login as root user to mysql:
    mysql -uroot -pYourSecretPassword
    On some MySQL installations, the root user has no password, in that case drop
    the -p parameter.
    Then grant the necessary access rights using the following commands: (this will
    automatically create the users)
    GRANT ALL ON daisyrepository.* TO daisy@"%" IDENTIFIED BY "daisy";
    GRANT ALL ON daisyrepository.* TO daisy@localhost IDENTIFIED BY "daisy";
    (The localhost entries are necessary because otherwise the default access rights
    for anonymous users @localhost will take precedence.)
    and create the database using:
    CREATE DATABASE daisyrepository;
    jack

    GRANT ALL ON daisyrepository.* TO daisy@% IDENTIFIED
    BY "daisy";This means:
    GRANT ALL privileges
    ON all tables and views in schema 'daisyrepository'
    To user daisy from any host.
    There are several problems in translation to Oracle:
    1) Oracle has a few more privs than MySQL, in part because there are a few more object types. You need to be more restrictive than 'GRANT ALL';
    2) Oracle does not support wild cards or patterns grants against a schema's objects. You need to specify each object individually;
    3) Oracle users are database users, not host users, so daisy@% does not make any sense at all. You specify the database user name, or perhaps group users into roles and specify the role name.
    This is discussed in the SQL Reference manual, in the 'GRANT' chapter, for each version of the database. The docs are at http://docs.oracle.com
    Have fun :-p

Maybe you are looking for

  • Wage types in Payroll Process getting doubled.

    Hi, experts i have an issue while running Payroll. An employee is having a change in shift schedules in mid of the month and while running the payroll the salary is getting doubled with same wage types twice as attached. Here the payable month days a

  • Pb avec facetime sur mon mac (suis pas visible mais audible)

    Bonjour, j'ai un problème. Lorsque j'utilise facetime avec mon mac, les gens m'entendent mais ne me voient pas. Moi je les entends et les vois parfaitement. J'ai pensé que c'était peut être lié à ma connexion wifi chez moi mais lorsque sur le même ré

  • How do I Open word document looking EXACTLY like it did when last closed?

    How do I open a word document looking like it did when I closed it? In the same shape, position on screen, size etc?

  • Can't install Skype (6.18), Code 1638

    Instead of auto-updating skype, the program manually asked me to install the recent update. When I tried to, it gave me an error saying: Installing Skype Failed; code 1638 Another version of this product is already installed. Installation of this ver

  • LED Display, Edges darker

    About half an inch (maybe smaller) of the bottom and sides of my screen are noticeably darker. With varied colors it's not really noticeable (like when I have the dock raised and there are all the different colored icons or a good background). Is thi