This file contains 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
CREATE OR REPLACE PROCEDURE MYLIB.Album_Fetch_By_ID (IN ParameterID INTEGER) | |
DYNAMIC RESULT SETS 1 | |
SET OPTION ALWBLK = *ALLREAD | |
BEGIN | |
DECLARE sql_statement VARCHAR(1000); | |
DECLARE sql_query VARCHAR(1000); | |
DECLARE ibmicmd_addlible_mylib CHAR ( 300 ) ; | |
DECLARE sql_exception_continue_message CHAR(20); | |
DECLARE cursor_with_resultset CURSOR FOR sql_statement; |
This file contains 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
<? | |
$options = array('i5_lib' => 'MYLIB' ,'i5_libl' => 'MYLIB', 'i5_naming' => DB2_I5_NAMING_ON,'autocommit' => DB2_AUTOCOMMIT_OFF, 'cursor' => DB2_SCROLLABLE); | |
$db2Connection = db2_connect('DBNAME','USER', 'PASSWORD', $options); | |
if (!$db2Connection) { echo "false - Connection failed.";exit(); } | |
$sql_query="SELECT ALBUM.* | |
FROM ALBUM | |
WHERE ID = ?"; | |
$sql_statement = db2_prepare($db2Connection, $sql_query); | |
if($sql_statement ===false) {echo 'Prepare Failed - Error: ' . db2_stmt_error() . "|".db2_stmt_errormsg() ;} |
This file contains 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
<VirtualHost *:81> | |
DocumentRoot /var/www/xxx1 | |
<Directory "/var/www/xxx1"> | |
AllowOverride All | |
php_value session.save_path "/var/mysessionforproject_1" | |
</Directory> | |
</VirtualHost> | |
<VirtualHost *:82> | |
DocumentRoot /var/www/xxx2 |
This file contains 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
<?php | |
//C:/xampp/htdocs/81/ | |
session_start(); | |
$_SESSION['site']=81; | |
var_dump($_SESSION); //array (size=1) 'site' => int 81 |
This file contains 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
<? | |
//only output the error if we're in the development environment | |
$APPLICATION_ENV="dev"; | |
//set error handler to the callback function defined later | |
set_error_handler("myErrorHandler"); | |
//connect to db | |
$db2Connection = db2_connect( '', '' , '',array('i5_lib' => 'QSYS')); | |
if (!$db2Connection) |
This file contains 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
if(!isset($_SESSION['myobj'])) | |
{ | |
$myobj = new MyObj($parm); | |
$myobj->createSomething(); | |
$_SESSION['myobj']=serialize($myobj); | |
} | |
$myobj = unserialize($_SESSION['myobj']) |
This file contains 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
--Create an Array type | |
CREATE TYPE phone_numbers_array_type AS VARCHAR(12) ARRAY[1000] | |
--Create a variable default_array of type phonenumberarray with a default array specified | |
CREATE OR REPLACE VARIABLE default_array phone_numbers_array_type DEFAULT ARRAY['416-413-9394', '416-413-7727', '416-413-6254']; | |
--Create a function using the array | |
CREATE OR REPLACE FUNCTION do_something_with_phone_numbers ( | |
my_phone_numbers phone_numbers_array_type DEFAULT default_array) | |
RETURNS INTEGER |
This file contains 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
--http://www.itjungle.com/fhg/fhg072115-story01.html | |
WITH DEPENDENCY_CHAIN_BASE | |
(REQ_OBJECT_SCHEMA,REQ_OBJECT_NAME,REQ_OBJECT_TYPE, | |
DEP_OBJECT_SCHEMA,DEP_OBJECT_NAME,DEP_OBJECT_TYPE, | |
DEP_OBJECT_SYSTEM_SCHEMA,DEP_OBJECT_SYSTEM_NAME, -- Not populated for routines | |
REQ_OBJECT_CATALOG,DEP_OBJECT_DEFINER,DEP_OBJECT_PARM_SIGNATURE,REQ_OBJECT_PARM_SIGNATURE) | |
AS ( | |
/* Remove section below if using IBM i 7.1 or less */ | |
/* START 7.2 only */ |
This file contains 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
<? | |
/* @var $myclass MyClass */ | |
$myclass = ServiceLocator::locate('MyClass'); | |
$myclass->//::TODO:: press control space to invoke intellisense when the cursor is after the arrow to see the intellisense work! |
This file contains 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 PGM(QP2SHELL) PARM('/usr/local/zendsvr/bin/php-cli batchphp/CopyMembersToStreamFiles.php') |