8/22/18

How to extract comma separated values from a String or Column or Field in Oracle

Ex: Address >     123 Main St,New York , NY , 00123

SELECT  REGEXP_SUBSTR (Address, '[^,]+', 1, 1)    AS Street
,       REGEXP_SUBSTR (Address, '[^,]+', 1, 2)    AS City
,       REGEXP_SUBSTR (Address, '[^,]+', 1, 3)    AS State
,       REGEXP_SUBSTR (Address, '[^,]+', 1, 4)    AS Zip
FROM    table_x

8/21/18

APT_Communicator::connectTo: connect() failed due to Unix error = 10,061 (Unknown error) on node HOST_NAME using ConnectionInfo object 'TCP, connection Host: HOST_NAME (IP_ADDRESS), TCP port number: 0', RETRYING connect()

Problem(Abstract)

Errors related to this issue:

unable to connect to port 10000 on conductor; socket = 0, Unknown error

APT_Communicator::connectTo: connect() failed due to Unix error = 10,061 (Unknown error) on node HOST_NAME using ConnectionInfo object 'TCP, connection Host: HOST_NAME (IP_ADDRESS), TCP port number: 0', RETRYING connect()

Resolving the problem

Hosts should have at least the following 2 entries:

# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost

You should be able to ping localhost via V4 and V6 IP topologies:
ping -4 localhost
ping -6 localhost

Set $APT_USE_IPV4=1 as the default in all projects or set this as Windows default environment.
Steps to set $APT_USE_IPV4 DataStage Administrator client:
  1. Select Projects tab
  2. Select Project
  3. Click Properties
  4. Click Environment button
  5. Click Parallel Category
  6. Locate APT_USE_IPV4 and set to TRUE

8/16/18

Last Day of current month and Previous month Oracle sql

SELECT LAST_DAY(SYSDATE) last_day_current_month,
   LAST_DAY(add_months(SYSDATE,-1)) last_day_prev_month
   FROM DUAL;