how to code bind copy

william giannelli

how to code bind copy

I need to bind copy one package from one system into another.

I am not understanding the manual example. It suggests coding a stored proc?

thanks

Bill

steen rasmussen

how to code bind copy
(in response to william giannelli)
This statement will bind a copy of RQATL into a separate collection IDUG_COLL2 (currently sits in IDUG_COLL collection).
BIND PACKAGE(IDUG_COLL2)                         OWNER(RASST02)                              QUALIFIER(RASST02)                          COPY(IDUG_COLL.RQATL)                       COPYVER(CAD115_2008-01-08-20.41.45)         CURRENTDATA(NO)                             VALIDATE(RUN)                               EXPLAIN(NO)                                 ACTION(REPLACE)                             SQLERROR(NOPACKAGE)                         ISOLATION(CS)                               RELEASE(COMMIT)                             DEGREE(1)                                   REOPT(NONE)                                 KEEPDYNAMIC(NO)                           DBPROTOCOL(DRDA)                 ENCODING(EBCDIC)                 IMMEDWRITE(INHERITFROMPLAN)      DYNAMICRULES(BIND)               ROUNDING(HALFEVEN)               APREUSE(NO)                      SYSTIMESENSITIVE(YES)            BUSTIMESENSITIVE(YES)            DESCSTAT(YES)                    ARCHIVESENSITIVE(YES)            FLAG(I);                      
Steen Rasmussen On Saturday, September 7, 2019, 02:59:57 PM EDT, william giannelli <[login to unmask email]> wrote:


I need to bind copy one package from one system into another.

I am not understanding the manual example. It suggests coding a stored proc?

thanks

Bill

Site Links: View post online   View mailing list online   Start new thread via email   Unsubscribe from this mailing list   Manage your subscription  

This email has been sent to: [login to unmask email]
Discover the best cloning tool on the market. Try BCV5 & the new BCV5 Masking Tool.
ESAi also has powerful solutions for Buffer Pool Tuning, Log Analysis, TDM, & more.
http://www.ESAIGroup.com/idug



Use of this email content is governed by the terms of service at:
http://www.idug.org/p/cm/ld/fid=2

Chris Tee

how to code bind copy
(in response to steen rasmussen)
Bill

Taking Steen's example below, if you want to bind onto another subsystem, say location DSN2, it would be

BIND PACKAGE(DSN2.IDUG_COLL2)
OWNER(RASST02)
QUALIFIER(RASST02)
COPY(IDUG_COLL.RQATL)
COPYVER(CAD115_2008-01-08-20.41.45) .....

This assumes that there is a DDF link to DSN2 and that the owner id (or the id it translates to in USERNAMES) has the relevant access on DSN2.

regards

Chris
________________________________
From: steen rasmussen <[login to unmask email]>
Sent: 08 September 2019 04:29
To: william giannelli <[login to unmask email]>
Subject: [DB2-L] - RE: how to code bind copy

This statement will bind a copy of RQATL into a separate collection IDUG_COLL2 (currently sits in IDUG_COLL collection).

BIND PACKAGE(IDUG_COLL2)
OWNER(RASST02)
QUALIFIER(RASST02)
COPY(IDUG_COLL.RQATL)
COPYVER(CAD115_2008-01-08-20.41.45)
CURRENTDATA(NO)
VALIDATE(RUN)
EXPLAIN(NO)
ACTION(REPLACE)
SQLERROR(NOPACKAGE)
ISOLATION(CS)
RELEASE(COMMIT)
DEGREE(1)
REOPT(NONE)
KEEPDYNAMIC(NO)
DBPROTOCOL(DRDA)
ENCODING(EBCDIC)
IMMEDWRITE(INHERITFROMPLAN)
DYNAMICRULES(BIND)
ROUNDING(HALFEVEN)
APREUSE(NO)
SYSTIMESENSITIVE(YES)
BUSTIMESENSITIVE(YES)
DESCSTAT(YES)
ARCHIVESENSITIVE(YES)
FLAG(I);

Steen Rasmussen
On Saturday, September 7, 2019, 02:59:57 PM EDT, william giannelli <[login to unmask email]> wrote:



I need to bind copy one package from one system into another.

I am not understanding the manual example. It suggests coding a stored proc?

thanks

Bill

-----End Original Message-----

Stefan Kolev

RE: how to code bind copy
(in response to Chris Tee)

We have a need to actually issue the BIND COPY statement from within a Native (SQLPL) Stored Procedure.  During testing our developer gets SQLCODE = -199, ERROR:  ILLEGAL USE OF KEYWORD BIND during PREPARE of the Bind Copy statement.

Can we not issue BIND statements from  Native SP like we can CREATE and GRANT?

 

Stefan Kolev | Database Services | |D|S|T| SS&C

Edited By:
Stefan Kolev[Organization Members] @ Feb 11, 2020 - 04:40 PM (America/Central)

SMike Toppins

how to code bind copy
(in response to Stefan Kolev)
You can call the ADMIN_COMMAND_DSN stored procedure to do that … BIND is a command not a DDL or DML statement.

From: Stefan Kolev <[login to unmask email]>
Sent: Monday, February 10, 2020 2:13 PM
To: [login to unmask email]
Subject: [DB2-L] - RE: how to code bind copy


CAUTION! This email is from an external source. Do not click on links or open attachments from unknown senders.

We have a need to actually issue the BIND COPY statement from withing a Native (SQLPL) Stored Procedure. During testing our developer gets SQLCODE = -199, ERROR: ILLEGAL USE OF KEYWORD BIND during PREPARE of the Bind Copy statement.

Can we not issue BIND statements from Native SP like we can CREATE and GRANT?



Stefan Kolev | Database Services | |D|S|T| SS&C

-----End Original Message-----

This email may contain confidential and privileged material for the sole use of the intended recipient. If you are not the intended recipient, please contact the sender and delete all copies. Any review or distribution by others is strictly prohibited. Personal emails are restricted by policy of the State Employees' Credit Union (SECU). Therefore SECU specifically disclaims any responsibility or liability for any personal information or opinions of the author expressed in this email.

Philip Sevetson

how to code bind copy
(in response to Stefan Kolev)
BIND is a DB2 COMMAND (DSN COMMAND). It’s not, as far as I know, executable as SQL.

May I recommend looking into ADMIN_COMMAND_DB2 (“CALL SYSPROC.ADMIN_COMMAND_DB2(argumentlist)”) instead?


Philip Sevetson
Computer Systems Manager
FISA-OPA
5 Manhattan West
New York, NY 10001
[login to unmask email]<mailto:[login to unmask email]>
212-857-1688 w
917-991-7052 m
212-857-1659 f
[cid:[login to unmask email]

From: Stefan Kolev <[login to unmask email]>
Sent: Monday, February 10, 2020 2:13 PM
To: [login to unmask email]
Subject: [DB2-L] - RE: how to code bind copy


We have a need to actually issue the BIND COPY statement from withing a Native (SQLPL) Stored Procedure. During testing our developer gets SQLCODE = -199, ERROR: ILLEGAL USE OF KEYWORD BIND during PREPARE of the Bind Copy statement.

Can we not issue BIND statements from Native SP like we can CREATE and GRANT?



Stefan Kolev | Database Services | |D|S|T| SS&C

-----End Original Message-----
**This e-mail, including any attachments, may be confidential, privileged, or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy, or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.**
Attachments

  • image001.png (3.3k)

Bill Gallagher

[External] how to code bind copy
(in response to Philip Sevetson)
I’ve done it from a native stored procedure.

Here’s a snippet of NSP code to do it:

DECLARE v_BindStmt VARCHAR(32704);
DECLARE v_ErrMsgSP VARCHAR(1331);
.
.
.
SET v_BindStmt = ' BIND PACKAGE(PNXDBA) COPY(' ||
v_Collid || '.' || v_Name ||
') OWNER(PNXDBA) EXPLAIN(YES) QUALIFIER(' ||
v_Qualifier || ')';

CALL SYSPROC.ADMIN_COMMAND_DSN(v_BindStmt, v_ErrMsgSP);

Bill Gallagher | Senior Systems Engineer, DBA | Data Administration http://teams.trv.net/it/kx_data_adm/database/SitePages/Home.aspx

From: Sevetson, Phil <[login to unmask email]>
Sent: Monday, February 10, 2020 2:25 PM
To: [login to unmask email]
Subject: [External] [DB2-L] - RE: how to code bind copy

BIND is a DB2 COMMAND (DSN COMMAND). It’s not, as far as I know, executable as SQL.

May I recommend looking into ADMIN_COMMAND_DB2 (“CALL SYSPROC.ADMIN_COMMAND_DB2(argumentlist)”) instead?


Philip Sevetson
Computer Systems Manager
FISA-OPA
5 Manhattan West
New York, NY 10001
[login to unmask email]<mailto:[login to unmask email]>
212-857-1688 w
917-991-7052 m
212-857-1659 f
[cid:[login to unmask email]

From: Stefan Kolev <[login to unmask email]<mailto:[login to unmask email]>>
Sent: Monday, February 10, 2020 2:13 PM
To: [login to unmask email]<mailto:[login to unmask email]>
Subject: [DB2-L] - RE: how to code bind copy


We have a need to actually issue the BIND COPY statement from withing a Native (SQLPL) Stored Procedure. During testing our developer gets SQLCODE = -199, ERROR: ILLEGAL USE OF KEYWORD BIND during PREPARE of the Bind Copy statement.

Can we not issue BIND statements from Native SP like we can CREATE and GRANT?



Stefan Kolev | Database Services | |D|S|T| SS&C

-----End Original Message-----
**This e-mail, including any attachments, may be confidential, privileged, or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy, or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.**
-----End Original Message-----
________________________________
This message (including any attachments) may contain confidential, proprietary, privileged and/or private information. The information is intended to be for the use of the individual or entity designated above. If you are not the intended recipient of this message, please notify the sender immediately, and delete the message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited.

TRVDiscDefault::1201

Stefan Kolev

RE: [External] how to code bind copy
(in response to Bill Gallagher)

Thank you all!  We were able to call SYSPROC.ADMIN_COMMAND_DSN with the Bind Copy command.

Stefan Kolev | Database Services | |D|S|T| SS&C