Jump to content


  • Posts

  • Joined

  • Last visited


About stockton

  • Birthday 05/13/1939

Profile Information

  • Gender
  • Location
    Midrand South Africa

stockton's Achievements

Advanced Member

Advanced Member (4/5)



  1. Do a google for "Online Books at Microsoft".
  2. I found that using $Datum = date("'Y-m-d H:i:s'"); rather than getdate() worked fine.
  3. Please tell me what is wrong with the following piece of code:- $Datum = date("'Y-m-d H:i:s'"); $link = mssql_connect("localhost", "sa", "") or trigger_error('Could not connect to database', E_USER_ERROR); mssql_select_db("pm", $link) or trigger_error('Could not select database', E_USER_ERROR); $proc = mssql_init("spGetActivePromotions", $link); mssql_bind($proc, "@Today", $Datum, SQLTEXT, FALSE,FALSE,strlen($Datum)); $Result = mssql_execute($proc); if (!$Result) { $Message = sprintf("mssql_execute failed for %s [%d].", $Datum, $Result); trigger_error($Message, E_USER_ERROR); die(); } the stored procedure that I am attempting to use looks like :- CREATE PROCEDURE spGetActivePromotions @Today datetime AS SELECT PromotionID, PromotionName, StartDate, EndDate, LastDrawDate, MaxDraws, NumRegTickets, VouchersPermitted, NumTicketsPerVoucher, ManualTicketIssue FROM Promotion WHERE @Today>=StartDate AND @Today<=EndDate GO
  4. I am attempting using the result of getdate() as a key to a MSSQL database. The MSSQL index is a SQLDATETIME. I use :- $StartDate = getdate(); and after connecting and selecting the database mssql_bind($proc, "@StartDate", $StartDate, SQLDATETIME); This fails. Is there something I need to do to the variable I get from getdate() before making the MSSQL call?
  5. Please tell me how one converts the result from PHP's getdate() function to an SQLDATETIME.
  6. I am failing in an attempt to access an Oracle database using the following php. The calls I have tested are as follows:- $query = "begin spPackage.spMemberDetails(_number,:cv_memberdetails); end;"; $stmt = OCIParse($conn, $query ) or die('Cannot parse query'); OCIBindByName($stmt,"_number",$number, -1) or die('First cannot bind variable'); OCIBindByName($stmt, ":cv_memberdetails", &$array, -1) or die('Second cannot bind variable'); OR $query = "begin spPackage.spMemberDetails(_number); end;"; $stmt = OCIParse($conn, $query ) or die('Cannot parse query'); OCIBindByName($stmt,"_number",$number, -1) or die('First cannot bind variable'); I get the following error message:- ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'SPMEMBERDETAILS' ORA-06550: line 1, column 7: PL/SQL: Statement ignored begin spPackage.spMemberDetails(_number); end; ^ The 1st part of the stored procedure I am trying to use is as follows:- CREATE OR REPLACE PACKAGE "BIG"."SPPACKAGE" AS type memberdetail_type is record ( r_mem_number members.mem_number%type, r_mem_sname members.mem_sname%type, r_mem_fname members.mem_fname%type, r_mem_title members.mem_title%type); type memberdetail_cur_type is ref cursor return memberdetail_type; PROCEDURE spMemberDetails( p_number cards.card_number%type, --varchar2 cv_memberdetails out memberdetail_cur_type); Please tell me what I am not understanding and where I have gone wrong. BTW I did not write the stored procedure.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.