Wednesday, September 18, 2019

SSIS - Start job with different account (credencials)

SSIS - Start job with different account (credentials)

1. Create new credentials (existing AD/local user)  at SQLServer->Security-Credentials


2. Create proxy SQLAgent->Proxies->SSIS Package execution (if you want to use it for ssis package)


3. At job step choose run as (created proxy)


SSIS - odbc oracle delete query

SSIS - problem with odbc oracle delete query


SQL delete query which is not affecting any records will return the result SQL_NO_DATA. SSIS odbc is not able to handle this kind of result.

1. Create query with dual select at the end
delete from table;
select 1 from dual;

2. Create procedure to delete data

create or replace PROCEDURE  delete_table is
begin
delete from table;
end;


Source: https://stackoverflow.com/questions/55000421/delete-statement-fails-when-called-from-ssis

SSIS - Call oracle procedure from Microsoft SQL Server integration services

SSIS - Call oracle procedure from Microsoft SQL Server integration services





1. Create sample procedure f.e.

create or replace PROCEDURE  schema1.delete_proc is
begin
delete from table;
end;

2. Add Execute SQL Task component at your ssis project with following parameters


3. Syntax
{CALL <schema>.<procedure>}
{CALL <schema>.<procedure>(parameter1='value1')}





Tuesday, April 16, 2019

APEX 5 - interactive report scale resize image

APEX 5 - interactive report re-size image


1. Add image column to interactive report
2. Add blob attributes (image column at your report should be primary key for table with blob content)
3. Add Static ID for your image column (f.e. IDP)
4. Add HTML Header in Page Properties
f.e.

<style type="text/css">
td[headers="IDP"] > img
width: 150px;
}
</style>







Thursday, December 6, 2018

SAP ABAP: Simple way to create ALV (REUSE_ALV_GRID_DISPLAY example)


1. Create report with internal table based on table spfli
2. Use function module REUSE_ALV_GRID_DISPLAY 

REPORT TEST.


data gs_spfli type spfli.
data it_spfli TYPE STANDARD TABLE OF spfli.

* select options
SELECT-OPTIONS so_carr for gs_spfli-carrid.


SELECT FROM spfli INTO TABLE it_spfli WHERE carrid in so_carr.



CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                = ' '
*   I_BUFFER_ACTIVE                   = ' '
*   I_CALLBACK_PROGRAM                = ' '
*   I_CALLBACK_PF_STATUS_SET          = ' '
*   I_CALLBACK_USER_COMMAND           = ' '
*   I_CALLBACK_TOP_OF_PAGE            = ' '
*   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*   I_CALLBACK_HTML_END_OF_LIST       = ' '
    I_STRUCTURE_NAME                  'spfli' "Structure name
*   I_BACKGROUND_ID                   = ' '
*   I_GRID_TITLE                      =
*   I_GRID_SETTINGS                   =
*   IS_LAYOUT                         =
*   IT_FIELDCAT                       =
*   IT_EXCLUDING                      =
*   IT_SPECIAL_GROUPS                 =
*   IT_SORT                           =
*   IT_FILTER                         =
*   IS_SEL_HIDE                       =
*   I_DEFAULT                         = 'X'
*   I_SAVE                            = ' '
*   IS_VARIANT                        =
*   IT_EVENTS                         =
*   IT_EVENT_EXIT                     =
*   IS_PRINT                          =
*   IS_REPREP_ID                      =
*   I_SCREEN_START_COLUMN             = 0
*   I_SCREEN_START_LINE               = 0
*   I_SCREEN_END_COLUMN               = 0
*   I_SCREEN_END_LINE                 = 0
*   I_HTML_HEIGHT_TOP                 = 0
*   I_HTML_HEIGHT_END                 = 0
*   IT_ALV_GRAPHICS                   =
*   IT_HYPERLINK                      =
*   IT_ADD_FIELDCAT                   =
*   IT_EXCEPT_QINFO                   =
*   IR_SALV_FULLSCREEN_ADAPTER        =
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER           =
*   ES_EXIT_CAUSED_BY_USER            =
  TABLES
    T_OUTTAB                          it_spfli "Internal table
* EXCEPTIONS
*   PROGRAM_ERROR                     = 1
*   OTHERS                            = 2
          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.

SAP ABAP: Simple class object example with execute

1. Report with static and class method execution

REPORT TEST_CALC. TYPES: RES TYPE P DECIMALS 4. *Class definition CLASS CCALC DEFINITION. PUBLIC SECTION. *Class methods METHODS ADD IMPORTING VALUE(CI1) TYPE I VALUE(CI2) TYPE I RETURNING VALUE(CRESULT) TYPE RES. METHODS SUBSTRACT IMPORTING VALUE(CI1) TYPE I VALUE(CI2) TYPE I RETURNING VALUE(CRESULT) TYPE RES. *Static methods CLASS-METHODS POWER IMPORTING VALUE(CI1) TYPE I VALUE(CTO2) TYPE I RETURNING VALUE(CRESULT) TYPE RES. PRIVATE SECTION. ENDCLASS. *Class implementation CLASS CCALC IMPLEMENTATION. METHOD ADD. CRESULT = CI1 + CI2. ENDMETHOD. METHOD SUBSTRACT. CRESULT = CI1 - CI2. ENDMETHOD. METHOD POWER. CRESULT = 1. DO CTO2 TIMES. CRESULT = CRESULT * CI1. ENDDO. ENDMETHOD. ENDCLASS. PARAMETERS: I1 TYPE I, I2 TYPE I. DATA: RESULT TYPE P DECIMALS 4, OCALC TYPE REF TO CCALC. START-OF-SELECTION. *Static method execution example RESULT = CCALC=>POWER( EXPORTING CI1 = I1 CTO2 = I2 ). WRITE: 'POWER result: ' , RESULT. * Class method execution example with object creation CREATE OBJECT OCALC. RESULT = OCALC->ADD( EXPORTING CI1 = I1 CI2 = I2 ). WRITE: 'ADD result: ' , RESULT. RESULT = OCALC->SUBSTRACT( EXPORTING CI1 = I1 CI2 = I2 ). WRITE : 'SUBSTRACT result: ' , RESULT.


2. Selection screen
 3. In order to add description to parameters I1 and I2 go to: Go to->Text element->Selection text


4. Result screen


Tuesday, November 27, 2018

SSIS SQL Server Integration Services - Using variable in SSIS Send Email Task, Send email to dynamic address

1. Create variables for FromLine, ToLine, Subject and Source

f.e EmailFrom, Email, EmailSource, EmailSubject


2. Fill variables (you can do it dynamically at script task)
3. Fill send email task as below

4. Fill expression tab as below




Problem with database open ORA-19804, ORA-19809, ORA-03113

1. Try to login to database with SYS AS SYSDBA user. If the instance is idle, run the startup command. 2. If ORA-03113 occured, check the la...