codefori / vscode-ibmi

🌍 IBM i development extension for VS Code
https://codefori.github.io/docs/#/
MIT License
279 stars 93 forks source link

Remove SQL executors and use system one #523

Closed worksofliam closed 2 years ago

worksofliam commented 2 years ago

This may also save lots of issues in the future. Manually setting the executor is dumb and annoying. If we can rely on the system-supplied one that'd be great.

worksofliam commented 2 years ago

Running from bash shell

bash-5.1$ db2 "select * from barry.german"

SRCSEQ   SRCDAT   SRCDTA                                                                          
-------- -------- --------------------------------------------------------------------------------
    1.00       0  hello ���� world                                                                

  1 RECORD(S) SELECTED.

Running from bash shell with LC_ALL

  bash-5.1$ LC_ALL=EN_US.UTF-8 db2 "select * from barry.german"

SRCSEQ   SRCDAT   SRCDTA                                                                          
-------- -------- --------------------------------------------------------------------------------
    1.00       0  hello ���� world                                                                

  1 RECORD(S) SELECTED.

Running ILE program from bash shell

bash-5.1$ echo "select * from barry.german" | LC_ALL=EN_US.UTF-8 system "call QSYS/QZDFMDB2 PARM('-d' '-i')"
DB2>
  ?>

SRCSEQ   SRCDAT   SRCDTA                                                                          
-------- -------- --------------------------------------------------------------------------------
    1.00       0  hello ���� world                                                                

  1 RECORD(S) SELECTED.

Running through ssh connection in new channel, with no shell:

/home/alan3/lytx_rpgle_sdk/: echo "select * from barry.german" | LC_ALL=EN_US.UTF-8 system "call QSYS/QZDFMDB2 PARM('-d' '-i')"
{
    "code": null,
    "signal": null,
    "stdout": "DB2>\n  ?>\n\nSRCSEQ   SRCDAT   SRCDTA                                                                          \n-------- -------- --------------------------------------------------------------------------------\n    1.00       0  hello äöüß world                                                                \n\n  1 RECORD(S) SELECTED.",
    "stderr": ""
}
DB2>
  ?>

SRCSEQ   SRCDAT   SRCDTA                                                                          
-------- -------- --------------------------------------------------------------------------------
    1.00       0  hello äöüß world                                                                

  1 RECORD(S) SELECTED.