File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1265,12 +1265,13 @@ export default class IBMi {
12651265 * @param statements
12661266 * @returns a Result set
12671267 */
1268- async runSQL ( statements : string ) : Promise < Tools . DB2Row [ ] > {
1268+ async runSQL ( statements : string , opts : { userCcsid ?: number } = { } ) : Promise < Tools . DB2Row [ ] > {
12691269 const { 'QZDFMDB2.PGM' : QZDFMDB2 } = this . remoteFeatures ;
12701270
12711271 if ( QZDFMDB2 ) {
12721272 const ccsidDetail = this . getEncoding ( ) ;
1273- const possibleChangeCommand = ( ccsidDetail . fallback && ! ccsidDetail . invalid ? `@CHGJOB CCSID(${ ccsidDetail . ccsid } );\n` : '' ) ;
1273+ const useCcsid = opts . userCcsid || ( ccsidDetail . fallback && ! ccsidDetail . invalid ? ccsidDetail . ccsid : undefined ) ;
1274+ const possibleChangeCommand = ( useCcsid ? `@CHGJOB CCSID(${ useCcsid } );\n` : '' ) ;
12741275
12751276 const output = await this . sendCommand ( {
12761277 command : `LC_ALL=EN_US.UTF-8 system "call QSYS/QZDFMDB2 PARM('-d' '-i' '-t')"` ,
You can’t perform that action at this time.
0 commit comments