Forum Stats

  • 3,770,327 Users
  • 2,253,095 Discussions
  • 7,875,403 Comments

Discussions

I have macro with params, but I want to pass some params not all.

User_C50GF
User_C50GF Member Posts: 1 Green Ribbon

sometimes I want to pass only 3 params in macro, how can I do that?


Macro #sync_exception

PARAMS (#SCHEMA_NAME,#MAP_TABLE,#TABLE_NAME,#TABLE_CODE, #KEY1,#KEY2,#KEY3,#KEY4,#KEY5,#KEY6,#KEY7)

BEGIN,

MAP #SCHEMA_NAME.#MAP_TABLE, TARGET CORE_NAT.GG_SYNC_ERR_LOG,

EXCEPTIONSONLY,

INSERTALLRECORDS

COLMAP(

ID = @COLSTAT(NULL),

TABLE_NAME = #TABLE_NAME,

KEY1 = #KEY1,

KEY2 = #KEY2,

KEY3 = #KEY3,

KEY4 = #KEY4,

KEY5 = #KEY5,

KEY6 = #KEY6,

KEY7 = #KEY7,

ERROR_CODE = @GETENV ('LASTERR', 'DBERRNUM'),

ERROR_MSG = @GETENV ('LASTERR', 'DBERRMSG'),

CREATED_DATE = @DATENOW (),

TABLE_CODE = #TABLE_CODE,

ERR_DETAILS = @GETENV ('LASTERR', 'OPTYPE'));

END;

Tagged:

Answers

  • ORASCN
    ORASCN Member Posts: 1,825 Gold Trophy

    Hi ,

    Check the below,


    macro #ggexception

    params (#source_schema, #table_name, #target_schema, #exception_table)

    begin

    map #source_schema.#table_name, TARGET #target_schema.#excception_table,

    exceptionsonly, insertallrecords

    colmap

    (usedefaults,

    gg_hostname = @getenv('ggenvironment','hostname'),

    gg_db_name = @getenv('ggfileheader','dbname'));

    end;


    Regards,

    Veera