This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| $javaProgramFileName="selenium-server-standalone"; | |
| $isSeleniumAlreadyRunning=false; | |
| exec("wmic process where name=\"java.exe\" get commandline",$output); | |
| foreach($output as $line) | |
| { | |
| if(strpos($line, $javaProgramFileName) !== FALSE) | |
| { | |
| $isSeleniumAlreadyRunning=true; | |
| break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Altering table MYLIB.CUSTMASPF */ | |
| ALTER TABLE MYLIB.CUSTMASPF | |
| ADD COLUMN CUSTOMERNAME FOR CUSTNAME VARCHAR (100) NOT HIDDEN | |
| ADD COLUMN CUSTOMERADDRESS FOR CUSTADDR VARCHAR (100) NOT HIDDEN; | |
| /* Setting column labels for MYLIB.CUSTMASPF */ | |
| LABEL ON COLUMN MYLIB.CUSTMASPF ( | |
| CUSTOMERNAME TEXT IS 'Customer Name' , | |
| CUSTOMERADDRESS TEXT IS 'Customer Address' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //return only 10 records, start on record 11 (OFFSET 10), records 11-20 are returned. | |
| $sql = "SELECT * FROM CUSTOMERS LIMIT 10 OFFSET 10"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --View Object Locks | |
| SELECT * FROM QSYS2.OBJECT_LOCK_INFO | |
| WHERE SYSTEM_OBJECT_NAME = 'CUSTOMER'; | |
| --View Record Locks | |
| SELECT JOB_NAME, COUNT(*) AS ROWS_UPDATING | |
| FROM QSYS2.RECORD_LOCK_INFO | |
| WHERE FILE_NAME = 'CUSTOMER' AND | |
| LIBRARY_NAME = 'PRODUCTION' AND | |
| LOCK_STATE = 'UPDATE' | |
| GROUP BY JOB_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --Press CTRL+SPACE and it'll show a dop down of valid SQL (i.e. SELECT, GRANT, DROP, CREATE, etc...) | |
| _ | |
| --Press CTRL+SPACE and it'll show a dop down of all libraries, and then all tables in the default library | |
| SELECT * FROM _ | |
| --Press CTRL+SPACE and it'll show a dop down of all tables in MYLIB | |
| SELECT * FROM MYLIB._ | |
| --Press CTRL+SPACE and it'll show a dop down of all columns in MYLIB.MYTABLE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CALL QSYS2.GENERATE_SQL('MYTABLE', 'MYLIBRARY', 'TABLE', REPLACE_OPTION => '0'); | |
| --More info: | |
| --https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20i%20Technology%20Updates/page/QSYS2.GENERATE_SQL%28%29%20procedure | |
| CALL QSYS2.GENERATE_SQL('%', 'MYLIB', 'PROCEDURE', REPLACE_OPTION => '1',CREATE_OR_REPLACE_OPTION => '1',PRIVILEGES_OPTION=>'1',SYSTEM_NAME_OPTION=>'1',LABEL_OPTION=>'1',COMMENT_OPTION=>'1' | |
| -- , | |
| -- DATABASE_SOURCE_FILE_NAME=>'GENSQLSRC', | |
| -- DATABASE_SOURCE_FILE_LIBRARY_NAME=>'MYLIB', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .aliases | |
| # vim:syntax=shexit | |
| # Reload bash aliases | |
| alias reload="source ~/.bash_profile" | |
| # enable color support of ls and also add handy aliases | |
| if [ -x /usr/bin/dircolors ]; then | |
| test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
| alias ls='ls --color=auto' | |
| #alias dir='dir --color=auto' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias db2='function _db2(){ echo "Running $1"; system -i "call QSYS/QZDFMDB2 parm('\''$1'\'')"; };_db2' | |
| db2 "SELECT * FROM MYLIB.MYTABLE" | |
| #Get fancy and search the data | |
| db2 "SELECT * FROM MYLIB.MYTABLE" | grep "Smith" | |
| #Alternatively you can run it through qsh - https://kadler.github.io/2018/05/29/calling-qsh-utilities-from-pase.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # IBMi aliases | |
| alias db2='function _db2(){ echo "Running $1"; system -i "call QSYS/QZDFMDB2 parm('\''$1'\'')"; };_db2' | |
| alias wrkactjob='function _wrkactjob(){ system WRKACTJOB; };_wrkactjob' | |
| alias zendjobs='function _zendjobs(){ ps -ef | grep -i zend; };_zendjobs' | |
| alias qccsid='function _qccsid(){ system "DSPSYSVAL SYSVAL(QCCSID)"; };_qccsid' | |
| alias dsplibl='function _dsplibl(){ qsh -c '\''/QSYS.LIB/QSHELL.LIB/SYSTEM.PGM dsplibl'\''; system -i "DSPLIBL"; };_dsplibl' | |
| # IBMi PHP | |
| alias startzendserver='function _StartZendServer(){ system "STRTCPSVR SERVER(*HTTP) HTTPSVR(ZENDSVR)"; };_StartZendServer' | |
| alias endzendserver='function _EndZendServer(){ system "ENDTCPSVR SERVER(*HTTP) HTTPSVR(ZENDSVR)"; };_EndZendServer' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #CopyTablesToRemoteSys $1 $2 | |
| #$1 Library | |
| #$2 Table | |
| function copytablestoremotesys() | |
| { | |
| #Clear our local temporary library | |
| system "CLRLIB LIB(MYLIB.TEMP)"; | |
| #Copy our local file a from a real library to a temporary library | |
| system "CPYF FROMFILE($1/$2) TOFILE(MYLIB.TEMP/$2) MBROPT(*REPLACE) CRTFILE(*YES)"; | |
| #Save all our objects in temporary location to a save file |