Compiler warning PLW-05003 parameter at IN and COPY may have side effects

For the following Procedure:
create or replace
PROCEDURE lob_replace
p_lob IN OUT NOCOPY CLOB,
p_what IN VARCHAR2,
p_with IN VARCHAR2 )
AS
n NUMBER;
BEGIN
dbms_output.put_line('p_what = ' || p_what);
dbms_output.put_line('p_with = ' || p_with);
n := dbms_lob.instr( p_lob, p_what );
dbms_output.put_line('n = ' || n);
IF ( NVL(n,0) > 0 ) THEN
dbms_lob.copy( p_lob, p_lob, dbms_lob.getlength(p_lob), n+LENGTH(p_with), n+LENGTH(p_what) );
dbms_lob.write( p_lob, LENGTH(p_with), n, p_with );
IF ( LENGTH(p_what) > LENGTH(p_with) ) THEN
dbms_lob.trim( p_lob, dbms_lob.getlength(p_lob)-(LENGTH(p_what)-LENGTH(p_with)) );
END IF;
END IF;
END;
When I compile this, I receive the following warning "Warning(15,5): PLW-05003: same actual parameter(P_LOB and P_LOB) at IN and NOCOPY may have side effect"
Line 15, column 5 is:
dbms_lob.copy( p_lob, p_lob, dbms_lob.getlength(p_lob), n+LENGTH(p_with), n+LENGTH(p_what) );
I'm reading about the NOCOPY Compiler hint at
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/08_subs.htm#12813 but I'm not for sure what exactly the issue is here?
The syntax for dbms_lob.copy is:
DBMS_LOB.COPY (
dest_lob IN OUT NOCOPY BLOB,
src_lob IN BLOB,
amount IN INTEGER,
dest_offset IN INTEGER := 1,
src_offset IN INTEGER := 1);
Do I need to copy the p_lob to another variable, not sure what do here?

Hi,
Is this really a stand alone procedure, or is it in fact part of a package?
That warning usually comes when parameter is declared with NOCOPY in specification but without in body. Or vice versa.
Could this be the case?
Regards
Peter

Similar Messages

  • I accidentally got a virus on my iPhone and it may have gotten into the iCloud storage, how do I remove the virus OR how do I restore from a back-up that occurred before the virus infected the system?

    When I was browsing on Safari on my iPhone, I accidentally got an advertisement where you could not close it out unless you clicked on its pop-up screen. So I clicked yes (Looking back, I should've turned off my iPhone then immediately closed out the ad before it could load), then I closed out immediately. But then things went haywire as the Siri automatically went off without me pressing for it, then the music on the iPod part of my iPhone played randomly and got crazy. So I tried resetting the entire settings and restored at a previous point, but I want to be 100% sure the virus is completely gone. I fear it may have infected the iCloud storage and if I cannot completely wipe out the virus without removing any data that was stored prior to the incident, I want to be able to know how to restore from an older session before the incident happened.
    Can you please help me?

    If things seem to be going haywire with your phone, it seems that it MAY be a software issue.
    Now, that being said, that does not necessarily mean that it is a virus. Software issues do happen sometimes. It is probably just coincidence.
    What you need to do is restore the device using iTunes. This will fix any software issues. After you have done this, you can restore from an iCloud backup.
    iCloud does not back up the actual software, so no, the "virus" would not have gotten into the backups.
    The link below provides steps on restoring your device using iTunes as well as how to restore from an iCloud backup.
    http://support.apple.com/kb/ht1766
    Don't worry! Everything should be back to normal if you follow these steps.

  • My hand me down MPC keeps repeating the start up chime and nothing comes on and no buttons have any effect. Any ideas?

    MY "hand me down" Mac Book Pro has decided that it will not boot up. I just get the first chime repeating over and over and none of the keys seem to have any effect at all. I cannot get into safe mode etc. My nearest Apple S tore is about 40 miles away. Any ideas out there?

    Alanmeats,
    Do you know the year of production (e.g., "15-inch Late 2011")?
    Never mind - it looks as if it's a mid-late 15" 2009.
    It's sounds as if your problem is something mechanical - a bad drive, something, that will simply not allow the system to boot. Do you have the discs that originally came with the machine (gray discs)? If so, you can try booting from Disc One and see if you can boot into recovery mode. If not, you'll need to call Apple, with your serial number handy, and purchase a set of the machine-specific discs that came with the system (10.4.9 or 10.4.10 or perhaps even 10.5).
    Then you can see if you've a hardware or system problem.
    Clinton
    MacBook Pro (15-inch Late 2011), OS Mavericks 10.9.4, 16GB Crucial RAM, Crucial M500 960GB SSD, 27” Apple Thunderbolt Display

  • I own a copy of lightroom 5 (a download copy) and have had to install a new hard disk.  I can't remember how I obtained the current copy, but I suspect that i downloaded a trial copy expecting to install the license numbers and I may have downloaded a mon

    I own a copy of lightroom 5 (a download copy) and have had to install a new hard disk. I can't remember how I got the current copy but I think I may have downloaded a monthly rental copy because the program is asking me to pay a subscription fee.  I was expecting to get a message to install my serial numbers.

    You downloaded the trial version for the creative cloud. It doesn't work with a serial number. It is licensed differently. You will have to uninstall it and then download and install from here:
    Product updates

  • I was decieved by Verizon Wireless and I may have to tell the world!

    I too was decieved by Verizon Wireless and have had to pay for a phone we never intended to use for a year now. All they said was, did I agree to the legal mumbo jumbo, which of course I had to or I wouln't have been able to finish the contraction I thought I was signing up for. I've complianed about this every time I've spoken to verizon wireless since then for a year, but they don't care. All they care about is, are they getting more money from me. Well, yes they are, but I am a very unhappy customer and they will soon see how unhappy I actually am. I'm a jounalist and a publisher. And I'm going to take aim at them with the written word if they do not come to their senses and understand that a happy customer is more important than taking money from a customer based on a mis-understanding. Are they legally ok with this? Yes. Are they right about this? N. O.  spells no!
    If they check the history of the phone in question, which I have brought up with them numerous times, they will see that we indeed have not used it for almost a year now. THEY ARE WRONG IN DOING THIS TO ME AND MY FAMILY. THEY ARE STEALING. ARE THEY LEGALLY COVERED? YES. ARE THEY RIGHT. NO!!!!!
    VERIZON WIRELESS. DO THE RIGHT THING AND MAKE GOOD WITH ME.
    I am a publisher and I have a blog that has a thousand
    unique visitors per week. I've put together a paper that has 145 complaints
    that Verizon wireless customers have given me permission to put in the paper as
    examples of problems with this company.
    I am giving Verizon wireless a chance to make things right
    with me before I post the work on my blog. I will also give Verizon wireless a
    chance to make good with me on my issue before I publish the work on Amazon's
    Kindle and B&N's Nook for customers throughout the world to have FREE
    access to download.
    VERIZON, DO THE RIGHT THING AND MAKE GOOD WITH ME!!! TIME IS
    RUNNING OUT!
    You have my information, call me and we can straighten this out.
    Please!  Pretty Please with sugar on top!!
    As for anyone who thinks I'm trying to wriggle out of making a mistake. You are wrong and are commiting libel, since you don't have the facts. THIS IS BETWEEN VERIZON WIRELESS AND ME!
    >Add'l info from another new post by the poster has been added to their original post and their latest posts have been deleted. In addition editing occurred to comply with the VZW ToS<
    Message was edited by: Verizon Moderator

    commonsense101 wrote:
    you added a line of service because you cant afford to buy a phone.. and then expect verizon to forgive the contact
    is that what i'm understanding here?
    That is exactly how I take it, but it seems some important info is missing.

  • Corners and edges settings have no effect on Win 8.1 Stream 8

    On my Stream 8
    PC Settings -- Under PC and devices -- Corner and edges -- Corner navigation, there are on/off settings for upper left and right.
    Upper Left (if on) - click, switch between my recent apps
    Upper Right (if on) - touch, show the charms
    Neither work as advertised.  Tried toggling on and off.  No effect.
    Not the end of the world as we know it, but wondered if others have run into this as well and is there a fix.  

    This was discoverd by someone shortly after the stream 7 release.. many of the edge swipe commands wouldn't work. If you use the selector box on the desktop you will see the digitizer is configured so that no touch is registered from about 3-4 pixles of the outer edge of the screen. This makes it hard to impossible for some edge swipe commands to work. Luckly the main ones work like swiping the right side, but alas a bit of a bad oversight on HPs end. 

  • Just got my video ipod and I may have a problem

    Hey guys, I literally just got my new video ipod (80gb) and when I went to plug it in to my computer, the connector that goes into the ipod doesn't go in very easily. I'm not sure if this is normal or not, but it didn't happen on my old ipod. It feels as if I'm grinding against the sides...
    If this is an issue or normal please tell me. I don't want to break the thing before I use it

    First question: try pushing in on the sides of the cable going into the iPod. If it is still difficult to connect make sure there is nothing impeding the connection in the iPod side or on the cable.
    Second question: I've used my 5th gen iPod on many flights and have not experienced the problem and there are people who have used them in the mountains. Others are reporting problems on flights. It doesn't break the iPod, it just is resetting on them and then works again on the ground. I'm wondering if some airlines are pressurizing their cabins above the 10,000 foot level.

  • HT1420 What did I purchase from I-tune? I don't recall purchasing anything. I just got my ipad and I may have done something without being aware of it. Thank you for your assu

    I was charged for something on my itune account but don't know what it was for. I just got my ipad so maybe I did something wrong. Could you please explain to me what I bought? I appreciate your assistance .thank you.

    Check your purchase history:
    http://support.apple.com/kb/HT2727
    That will show you what you've purchased. We are all fellow users here and hence can tell you nothing about your account.
    Regards.

  • Post Leopard install, caps and num lock have opposite effect

    Not sure what I did as I was running Leopard just fine on my MB Pro rebooted and found my Num Lock light was on. Turning it off resulted in the keyboard behaving as if it was on. Also when caps lock is on I get lower case, i.e., normal behaviour when Caps lock is off. When caps lock is off I get ALL UPPER CASE AND CANT GET LOWER CASE.
    What did I do? I've checked keyboard settings, but can't seem to find anything that I might have inadvertently done.
    Mark

    Actually this is a new feature of Leopard.
    The developers have been wanting to rewrite some of the conventions that we use when operating computers, such as the much boasted about (and fraudulently claimed that they invented) multi-touch. and so they patented the reversal of these keys for us all to think, wow this is amazing and new! Apple are so cool and hip, nothing like those copycat MS people!!!
    But seriously. Try fixing disk permissions (in disk utility) and also reset the System Management Controller by removing all power and cables into the computer for at least 15 seconds.
    http://docs.info.apple.com/article.html?artnum=303446
    Good luck, and if all else fails try doing a clean install. I assume that you only did an upgrade so that u wouldn't have to reload all the data from the computer!?!

  • I was trying to free up some memory on my hard drive and now I don't have an Itunes icon.  I may have deleted it from my applications.  How do I get it back.  I downloaded it but it says it was moved from my PDF, music is played on Quicktime player

    I was trying to free up some memory from my startup disk and I  may have accidently deleted the Itunes application.  I still  have a library if I go through finder. I can download Itunes but I'm not able to install it. All this and I still don't have enough space on my startup disk, but that's another whole question!
    If I play a tune,it comes through quicktime player.  What can I do?

    Enchanted1 wrote:
    All this and I still don't have enough space on my startup disk, but that's another whole question!
    No, this should be the number one thing you are concerned about.
    Until you get this sorted, there is a good chance you may simply lose everything.
    Do you hav ean external drive?
    If so copy the entire /Music/iTunes/ folder to the external drive.
    Then you can delete /Music/iTunes/ empty the trash and recover this space.
    Do this then Apple menu > Software update.
    Restart the computer
    Then post back.

  • G56 will not start install after format and copy from recovery usb

    so i just replaced the hdd in this laptop running win7. i am trying to fix the imminent hdd failure message for one of my mother's friends. anywho... i created the usb flash (13.5gb) and then replaced the hdd. went into the bios and enabled usb floppy and moved it up in boot order. 
    the pc boots into recovery fine. it formats and copies the files over also. what it will not do is reboot into the install of windows. all it wants to do is reload the recovery. i have tried many different ways of getting this done and nothing seems to be working. 
    at first the floppy was first. now i have it second, after the hdd. i have pulled the usb after the format and copy. i have left it in. 
    i dont know what else to do. any help from yall would be a wonderful thing. 
    thanks,
    patrick

    Welcome to Apple Discussions!
    Sounds like you are using the wrong restore disk to install Mac OS 9. The G5 came with its own restore disks to install Mac OS 9, and that version is 9.2.2. The restore disks for the G5 are labelled such.
    If you purchased the G5 used from someone else, and they did not include the original disks, contact them for the disks. And if they lack the disks, ask them to call AppleCare and see if they can get the disks. If you lose the disks, and are the original owner of the machine as a new machine, call AppleCare and see if you can get the disks yourself.

  • Turn off CSS compile warning

    Hi all,
    How do I turn off the compiler warning about unused CSS
    styles. I need the solution for both locally compiled SWF and those
    compiled in Flex Data Services. flex-config.xml doesn´t have
    the node option.
    Thanks
    David

    Thanks Brent for your quick response. That works well with
    the compile locally option. I found the solution if you are
    compiling with FDS.
    Its in the docs under:
    Building and Deploying Flex 2 Applications > Building Flex
    Applications > Flex 2 SDK and Flex Data Services Configuration
    > Flex Data Services configuration
    You can change the flex-webtier-config.xml file and turn the
    production setting on, or use the queryString parameter
    (showAllWarnings=false) if you are just testing.
    Cheers
    David

  • Help with message please:  Warning: mysql_free_result() expects parameter 1 to be resource, null given in...... line

    I would really appreciate some help with my search & results page that is now throwing up the following error:
    Warning: mysql_free_result() expects parameter 1 to be resource, null given in...... line (the line number refers to the following code:
    mysql_free_result($RSsearchforsale);
    mysql_free_result($RsSearchForSale2);
    mysql_free_result($RsSearchForSale3);
    mysql_free_result($RsSearchForSale4);
    I am new to php and am setting up a dynamic site in Dreamweaver (thanks to the Missing Manual – very helpful). I apologise in advanced for my lengthy description of the problem (perhaps get yourself a drink before continuing!)
    I have a Search page with 4 list menus where the user can select an option from ANY or ALL of the menus, if a menu is not selected the value posted to the results page will be 'zzz'.
    On the results page I have 4 recordsets, all getting the correct results, only one recordset is required to run depending on how many of the menus from the search page have been selected and a test is run before executing the sql using a SWITCH statement checking how many of the menus had passed the 'zzz' values from the Search page if you see what I mean. The results page  has Repeating Regions, Recordset Paging and Display Record Count. The exact result that I require are generated by this method.
    THE PROBLEM, when a user makes a selection the first page of 10 results is fine, but the error message above is shown at the bottom of the page, AND when the user clicks NEXT to go to the next page of results THERE ARE NO RESULTS.
    This is exactly what happens depending on how many menus selected and which recordset is used:
    4 menus selected from Search: runs RSsearchforsale, results correct but 3 error messages on 1st page relating to mysql_free_result($RsSearchForSale2),mysql_free_result($RsSearchForSale3), & mysql_free_result($RsSearchForSale4). The display record count shows correct results found. NEXT page is empty of results and still shows the correct display record count as if it should be displaying the records, also has the same 3 error messages.
    3 menus selected from Search:  runs RsSearchForSale2, results correct but 3 error messages on 1st page relating to mysql_free_result($RSsearchforsale),mysql_free_result($RsSearchForSale3), & mysql_free_result($RsSearchForSale4). The display record count shows correct number of results. NEXT page shows results from the  DEFAULT setting of the recordset and the Display record count reflects this new set of results. Also still shows the 3 mysql_free_results for RsSearchForSale2, 3 and 4.
    2 menus selected from Search: runs   RsSearchForSale3, results correct but 2 error messages on 1st page relating to  mysql_free_result($RSsearchforsale) & mysql_free_result (RsSearchForSale4). The display record count is correct. NEXT page does exactly the same as described in above 3 menus selected.
    1 menu selected from search: runs RsSearchForSale4, results correct but 1 error meaasge on 1st page, mysql_free_result($RSsearchforsale). Display record count is correct and again when NEXT page is selected does as described in above where 2 or 3 menus selected.
    If you have gotten this far without falling asleep then thank you and well done! I have pasted my code below and I know its a lot to ask but please please can you give me an idea as to where or why I have gone wrong. I felt I was so close at perfecting this search and have been working on it for weeks now. I feel sure the problem is because I have 4 recordsets on the page but I could find no other way to get the exact results I wanted from the menus.
    Looking forward to any help.
    <?php require_once('Connections/propertypages.php'); ?>
    <?php if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $currentPage = $_SERVER["PHP_SELF"];
    $maxRows_RSsearchforsale = 10;
    $pageNum_RSsearchforsale = 0;
    if (isset($_GET['pageNum_RSsearchforsale'])) {
      $pageNum_RSsearchforsale = $_GET['pageNum_RSsearchforsale'];
    $startRow_RSsearchforsale = $pageNum_RSsearchforsale * $maxRows_RSsearchforsale;
    $varloc_RSsearchforsale = "mpl";
    if (isset($_POST['location'])) {
      $varloc_RSsearchforsale = $_POST['location'];
    $vartype_RSsearchforsale = "vil";
    if (isset($_POST['type'])) {
      $vartype_RSsearchforsale = $_POST['type'];
    $varprice_RSsearchforsale = "pr9";
    if (isset($_POST['price'])) {
      $varprice_RSsearchforsale = $_POST['price'];
    $varbed_RSsearchforsale = "b5";
    if (isset($_POST['beds'])) {
      $varbed_RSsearchforsale = $_POST['beds'];
    switch (true) {
    case ($varloc_RSsearchforsale != 'zzz' && $vartype_RSsearchforsale != 'zzz' && $varprice_RSsearchforsale != 'zzz' && $varbed_RSsearchforsale != 'zzz'):
    mysql_select_db($database_propertypages, $propertypages);
    $query_RSsearchforsale = sprintf("SELECT DISTINCT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number` FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid WHERE location=%s AND price=%s AND type=%s AND beds=%s ORDER BY detailstable.trueprice ASC", GetSQLValueString($varloc_RSsearchforsale, "text"),GetSQLValueString($varprice_RSsearchforsale, "text"),GetSQLValueString($vartype_RSsearchforsale, "text"),GetSQLValueString($varbed_RSsearchforsale, "text"));
    $query_limit_RSsearchforsale = sprintf("%s LIMIT %d, %d", $query_RSsearchforsale, $startRow_RSsearchforsale, $maxRows_RSsearchforsale);
    $RSsearchforsale = mysql_query($query_limit_RSsearchforsale, $propertypages) or die(mysql_error());
    $row_RSsearchforsale = mysql_fetch_assoc($RSsearchforsale);
    if (isset($_GET['totalRows_RSsearchforsale'])) {
      $totalRows_RSsearchforsale = $_GET['totalRows_RSsearchforsale'];
    } else {
      $all_RSsearchforsale = mysql_query($query_RSsearchforsale);
      $totalRows_RSsearchforsale = mysql_num_rows($all_RSsearchforsale);
    $totalPages_RSsearchforsale = ceil($totalRows_RSsearchforsale/$maxRows_RSsearchforsale)-1;
    $queryString_RSsearchforsale = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_RSsearchforsale") == false &&
            stristr($param, "totalRows_RSsearchforsale") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_RSsearchforsale = "&" . htmlentities(implode("&", $newParams));
    $queryString_RSsearchforsale = sprintf("&totalRows_RSsearchforsale=%d%s", $totalRows_RSsearchforsale, $queryString_RSsearchforsale); } ?>
    <?php require_once('Connections/propertypages.php'); ?>
    <?php if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $currentPage = $_SERVER["PHP_SELF"];
    $maxRows_RsSearchForSale2 = 10;
    $pageNum_RsSearchForSale2 = 0;
    if (isset($_GET['pageNum_RsSearchForSale2'])) {
      $pageNum_RsSearchForSale2 = $_GET['pageNum_RsSearchForSale2'];
    $startRow_RsSearchForSale2 = $pageNum_RsSearchForSale2 * $maxRows_RsSearchForSale2;
    $varloc2_RsSearchForSale2 = "mpl";
    if (isset($_POST['location'])) {
      $varloc2_RsSearchForSale2 = $_POST['location'];
    $varprice2_RsSearchForSale2 = "p9";
    if (isset($_POST['price'])) {
      $varprice2_RsSearchForSale2 = $_POST['price'];
    $vartype2_RsSearchForSale2 = "vil";
    if (isset($_POST['type'])) {
      $vartype2_RsSearchForSale2 = $_POST['type'];
    $varbed2_RsSearchForSale2 = "b5";
    if (isset($_POST['beds'])) {
      $varbed2_RsSearchForSale2 = $_POST['beds'];
    switch (true) {
    case ($varloc2_RsSearchForSale2 == 'zzz'):
    case ($varprice2_RsSearchForSale2 == 'zzz'):
    case ($vartype2_RsSearchForSale2 == 'zzz'):
    case ($varbed2_RsSearchForSale2 == 'zzz'):
    mysql_select_db($database_propertypages, $propertypages);
    $query_RsSearchForSale2 = sprintf("SELECT DISTINCT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number` FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid WHERE (location=%s AND price=%s AND type=%s) OR (location=%s AND price=%s AND beds=%s) OR (location=%s AND type=%s AND beds=%s) OR (price=%s AND type=%s AND beds=%s) ORDER BY detailstable.trueprice ASC", GetSQLValueString($varloc2_RsSearchForSale2, "text"),GetSQLValueString($varprice2_RsSearchForSale2, "text"),GetSQLValueString($vartype2_RsSearchForSale2, "text"),GetSQLValueString($varloc2_RsSearchForSale2, "text"),GetSQLValueString($varprice2_RsSearchForSale2, "text"),GetSQLValueString($varbed2_RsSearchForSale2, "text"),GetSQLValueString($varloc2_RsSearchForSale2, "text"),GetSQLValueString($vartype2_RsSearchForSale2, "text"),GetSQLValueString($varbed2_RsSearchForSale2, "text"),GetSQLValueString($varprice2_RsSearchForSale2, "text"),GetSQLValueString($vartype2_RsSearchForSale2, "text"),GetSQLValueString($varbed2_RsSearchForSale2, "text"));
    $query_limit_RsSearchForSale2 = sprintf("%s LIMIT %d, %d", $query_RsSearchForSale2, $startRow_RsSearchForSale2, $maxRows_RsSearchForSale2);
    $RsSearchForSale2 = mysql_query($query_limit_RsSearchForSale2, $propertypages) or die(mysql_error());
    $row_RsSearchForSale2 = mysql_fetch_assoc($RsSearchForSale2);
    if (isset($_GET['totalRows_RsSearchForSale2'])) {
      $totalRows_RsSearchForSale2 = $_GET['totalRows_RsSearchForSale2'];
    } else {
      $all_RsSearchForSale2 = mysql_query($query_RsSearchForSale2);
      $totalRows_RsSearchForSale2 = mysql_num_rows($all_RsSearchForSale2);
    $totalPages_RsSearchForSale2 = ceil($totalRows_RsSearchForSale2/$maxRows_RsSearchForSale2)-1;
    $queryString_RsSearchForSale2 = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_RsSearchForSale2") == false &&
            stristr($param, "totalRows_RsSearchForSale2") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_RsSearchForSale2 = "&" . htmlentities(implode("&", $newParams));
    $queryString_RsSearchForSale2 = sprintf("&totalRows_RsSearchForSale2=%d%s", $totalRows_RsSearchForSale2, $queryString_RsSearchForSale2);
    }?>
    <?php require_once('Connections/propertypages.php'); ?>
    <?php if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $currentPage = $_SERVER["PHP_SELF"];
    $maxRows_RsSearchForSale3 = 10;
    $pageNum_RsSearchForSale3 = 0;
    if (isset($_GET['pageNum_RsSearchForSale3'])) {
      $pageNum_RsSearchForSale3 = $_GET['pageNum_RsSearchForSale3'];
    $startRow_RsSearchForSale3 = $pageNum_RsSearchForSale3 * $maxRows_RsSearchForSale3;
    $varloc3_RsSearchForSale3 = "mpl";
    if (isset($_POST['location'])) {
      $varloc3_RsSearchForSale3 = $_POST['location'];
    $varprice3_RsSearchForSale3 = "p9";
    if (isset($_POST['price'])) {
      $varprice3_RsSearchForSale3 = $_POST['price'];
    $vartype3_RsSearchForSale3 = "vil";
    if (isset($_POST['type'])) {
      $vartype3_RsSearchForSale3 = $_POST['type'];
    $varbed3_RsSearchForSale3 = "b5";
    if (isset($_POST['beds'])) {
      $varbed3_RsSearchForSale3 = $_POST['beds'];
    switch (true) {
    case ($varloc3_RsSearchForSale3 == 'zzz' && $varprice3_RsSearchForSale3 == 'zzz'):
    case ($varprice3_RsSearchForSale3 == 'zzz' && $vartype3_RsSearchForSale3 == 'zzz'):
    case ($vartype3_RsSearchForSale3 == 'zzz' && $varbed3_RsSearchForSale3 == 'zzz' ):
    case ($varbed3_RsSearchForSale3 == 'zzz' && $varloc3_RsSearchForSale3 == 'zzz'):
    case ($varloc3_RsSearchForSale3 == 'zzz' && $vartype3_RsSearchForSale3 == 'zzz'):
    case ($varprice3_RsSearchForSale3 == 'zzz' && $varbed3_RsSearchForSale3 == 'zzz'):
    mysql_select_db($database_propertypages, $propertypages);
    $query_RsSearchForSale3 = sprintf("SELECT DISTINCT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number` FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid WHERE (location=%s AND price=%s) OR (location=%s AND  type=%s) OR (location=%s AND beds=%s) OR ( type=%s AND beds=%s) OR (price=%s AND type=%s) OR (price=%s AND beds=%s) ORDER BY detailstable.trueprice ASC", GetSQLValueString($varloc3_RsSearchForSale3, "text"),GetSQLValueString($varprice3_RsSearchForSale3, "text"),GetSQLValueString($varloc3_RsSearchForSale3, "text"),GetSQLValueString($vartype3_RsSearchForSale3, "text"),GetSQLValueString($varloc3_RsSearchForSale3, "text"),GetSQLValueString($varbed3_RsSearchForSale3, "text"),GetSQLValueString($vartype3_RsSearchForSale3, "text"),GetSQLValueString($varbed3_RsSearchForSale3, "text"),GetSQLValueString($varprice3_RsSearchForSale3, "text"),GetSQLValueString($vartype3_RsSearchForSale3, "text"),GetSQLValueString($varprice3_RsSearchForSale3, "text"),GetSQLValueString($varbed3_RsSearchForSale3, "text"));
    $query_limit_RsSearchForSale3 = sprintf("%s LIMIT %d, %d", $query_RsSearchForSale3, $startRow_RsSearchForSale3, $maxRows_RsSearchForSale3);
    $RsSearchForSale3 = mysql_query($query_limit_RsSearchForSale3, $propertypages) or die(mysql_error());
    $row_RsSearchForSale3 = mysql_fetch_assoc($RsSearchForSale3);
    if (isset($_GET['totalRows_RsSearchForSale3'])) {
      $totalRows_RsSearchForSale3 = $_GET['totalRows_RsSearchForSale3'];
    } else {
      $all_RsSearchForSale3 = mysql_query($query_RsSearchForSale3);
      $totalRows_RsSearchForSale3 = mysql_num_rows($all_RsSearchForSale3);
    $totalPages_RsSearchForSale3 = ceil($totalRows_RsSearchForSale3/$maxRows_RsSearchForSale3)-1;
    $queryString_RsSearchForSale3 = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_RsSearchForSale3") == false &&
            stristr($param, "totalRows_RsSearchForSale3") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_RsSearchForSale3 = "&" . htmlentities(implode("&", $newParams));
    $queryString_RsSearchForSale3 = sprintf("&totalRows_RsSearchForSale3=%d%s", $totalRows_RsSearchForSale3, $queryString_RsSearchForSale3);
    } ?>
    <?php require_once('Connections/propertypages.php'); ?>
    <?php if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $currentPage = $_SERVER["PHP_SELF"];
    $maxRows_RsSearchForSale4 = 10;
    $pageNum_RsSearchForSale4 = 0;
    if (isset($_GET['pageNum_RsSearchForSale4'])) {
      $pageNum_RsSearchForSale4 = $_GET['pageNum_RsSearchForSale4'];
    $startRow_RsSearchForSale4 = $pageNum_RsSearchForSale4 * $maxRows_RsSearchForSale4;
    $varloc4_RsSearchForSale4 = "mpl";
    if (isset($_POST['location'])) {
      $varloc4_RsSearchForSale4 = $_POST['location'];
    $vartype4_RsSearchForSale4 = "vil";
    if (isset($_POST['type'])) {
      $vartype4_RsSearchForSale4 = $_POST['type'];
    $varprice4_RsSearchForSale4 = "p9";
    if (isset($_POST['price'])) {
      $varprice4_RsSearchForSale4 = $_POST['price'];
    $varbed4_RsSearchForSale4 = "b5";
    if (isset($_POST['beds'])) {
      $varbed4_RsSearchForSale4 = $_POST['beds'];
    switch (true) {
    case ($varloc4_RsSearchForSale4 == 'zzz' && $vartype4_RsSearchForSale4 =='zzz' && $varprice4_RsSearchForSale4 == 'zzz'):
    case ($varloc4_RsSearchForSale4 == 'zzz' && $varprice4_RsSearchForSale4 =='zzz' && $varbed4_RsSearchForSale4 == 'zzz'):
    case ($varloc4_RsSearchForSale4 == 'zzz' && $varbed4_RsSearchForSale4 =='zzz' && $vartype4_RsSearchForSale4 == 'zzz'):
    case ($varbed4_RsSearchForSale4 == 'zzz' && $vartype4_RsSearchForSale4 =='zzz' && $varprice4_RsSearchForSale4 == 'zzz'):
    mysql_select_db($database_propertypages, $propertypages);
    $query_RsSearchForSale4 = sprintf("SELECT DISTINCT trueprice,`desc`, `propid`, `bathrooms`, `photo1`, locationtable.loc, typetable.style, bedtable.`number` FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid WHERE location=%s OR price=%s OR type=%s OR beds=%s ORDER BY detailstable.trueprice ASC", GetSQLValueString($varloc4_RsSearchForSale4, "text"),GetSQLValueString($varprice4_RsSearchForSale4, "text"),GetSQLValueString($vartype4_RsSearchForSale4, "text"),GetSQLValueString($varbed4_RsSearchForSale4, "text"));
    $query_limit_RsSearchForSale4 = sprintf("%s LIMIT %d, %d", $query_RsSearchForSale4, $startRow_RsSearchForSale4, $maxRows_RsSearchForSale4);
    $RsSearchForSale4 = mysql_query($query_limit_RsSearchForSale4, $propertypages) or die(mysql_error());
    $row_RsSearchForSale4 = mysql_fetch_assoc($RsSearchForSale4);
    if (isset($_GET['totalRows_RsSearchForSale4'])) {
      $totalRows_RsSearchForSale4 = $_GET['totalRows_RsSearchForSale4'];
    } else {
      $all_RsSearchForSale4 = mysql_query($query_RsSearchForSale4);
      $totalRows_RsSearchForSale4 = mysql_num_rows($all_RsSearchForSale4);
    $totalPages_RsSearchForSale4 = ceil($totalRows_RsSearchForSale4/$maxRows_RsSearchForSale4)-1;
    $queryString_RsSearchForSale4 = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_RsSearchForSale4") == false &&
            stristr($param, "totalRows_RsSearchForSale4") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_RsSearchForSale4 = "&" . htmlentities(implode("&", $newParams));
    $queryString_RsSearchForSale4 = sprintf("&totalRows_RsSearchForSale4=%d%s", $totalRows_RsSearchForSale4, $queryString_RsSearchForSale4);
    }?>

    Hi David,
    Thank you for your reply and patience, we are getting closer in spite of me!
    Of course i needed to change the name of the recordset, i did that the first time i did it (when i got the error), the when i re did it i forgot, in my defense i was also trying to get a full understanding of the code using the W3Schools php reference and writing by the side of the code on a piece of paper what it meant in English.
    Anyway after re doing the code correctly it still displayed all the records of my database but i realised that was because i was POSTING from the search form and when i changed it to the GET method I now get results when all 4  list menus are selected from and the paging works. After reading about the POST / GET method i chose the POST option, is the GET method a better option in my circumstance?
    On my site now if the user selects from 1,2 or 3 of the menus rather than selecting the relevant records it displays the NO RESULT page, I would like my users to be able to select from all of the menus or ANY combination of the menus and find exact results for their search, for example if they only select a location and a price i want it display all records that match that location and price with any number of bedrooms and any Type of property: Perhaps this is due to how my list menus are set up, for each menu the first Item label is Location (or Beds or Type or Price) and the value i have left blank which i believe means that it will use the item label as the value, the second Item label for all menus is Any and again the value has been left blank. All other item labels have values relevant to database records.  
    I do look forward to your reply and cannot thank you enough for following this through with me, please continue to bare with me just a little more,
    best regards
    Tessimon
    Date: Wed, 11 Nov 2009 06:56:24 -0700
    From: [email protected]
    To: [email protected]
    Subject: Help with message please:  Warning: mysql_free_result() expects parameter 1 to be resource, null given in...... line
    You're not adding the WHERE clause to the SQL query. My example code uses $query_search. You need to change that variable to match the name of your recordset, i.e. $query_RSsearchforsale.
    Moreover, the WHERE clause needs to go before ORDER BY.
    $query_RSsearchforsale = "SELECT trueprice,`desc`, `propid`, `bathrooms`, `location`, `type`, `price`, `beds`, `photo1`, locationtable.loc, typetable.style, bedtable.`number` FROM detailstable JOIN locationtable ON detailstable.location=locationtable.locid JOIN typetable ON detailstable.type=typetable.typeid JOIN pricetable ON detailstable.price=pricetable.priceid JOIN bedtable ON detailstable.beds=bedtable.bedid ";
    // Set a flag to indicate whether the query has a WHERE clause
    $where = false;
    // Loop through the associatiave array of expected search values
    foreach ($expected as $var => $type) {
      if (isset($_GET[$var])) {
        $value = trim(urldecode($_GET[$var]));
        if (!empty($value)) {
          // Check if the value begins with > or <
          // If so, use it as the operator, and extract the value
          if ($value[0] == '>' || $value[0] == '<') {
            $operator = $value[0];
            $value = ltrim(substr($value, 1));
          } elseif (strtolower($type) != 'like') {
            $operator = '=';
          // Check if the WHERE clause has been added yet
          if ($where) {
            $query_RSsearchforsale .= ' AND ';
          } else {
            $query_RSsearchforsale .= ' WHERE ';
            $where = true;
          // Build the SQL query using the right operator and data type
          $type = strtolower($type);
          switch($type) {
            case 'like':
              $query_RSsearchforsale .= "`$var` LIKE " . GetSQLValueString('%' .
    $value . '%', "text");
              break;
            case 'int':
            case 'double':
            case 'date':
              $query_RSsearchforsale .= "`$var` $operator " .
    GetSQLValueString($value, "$type");
              break;
            default:
            $query_RSsearchforsale .= "`$var` = " . GetSQLValueString($value,
    "$type");
    $query_RSsearchforsale .= ' ORDER BY detailstable.trueprice ASC';
    >

  • Can java provide a follow/depend/attatch compiling warning?

    I wrote a class called Query.It connect to database and return ResultSet.So user must manually call my method close() to close the ResultSet and Connection, otherwise resource will be avaliable.
    But user maybe forget call the close() method.If codes are released,problem will occur.
    For this reason I want java provides a compile warning if a important method is not called.
    e.g. Codes maybe like this:
    /**Start**/
    class Query(){
    ResultSet getResultSet(DataSource ds){
    //Codes get resultset
    return ResultSet;
    void close() follow getResultSet(DataSource){
    //Close databse
    //Note: "follow getResultSet(DataSource)" is my idea.
    class test{
    Query query = new Query();
    RsultSet rst = query.getResultSet();
    //query.close();//#1
    /**End**/
    If user forget writing line #1 (to close Database,etc), java compiler will give a warning:
    The method close() must follow method getResultSet!
    You will get error when running.
    Can java provide this function?
    Thanks!

    to mchan0 :
    I konw you mean I can copy ResultSet to another Object.But if databse is very very large,ResultSet will use large memory.It is not we want.
    e.g. our project database need to store 40,000,000 records.Once load large numbers records,server will crack.
    So I can only use ResultSet.
    If I wrong,please correct me.
    Thanks

  • No warning for missing parameter?

    Hi,
    Is this normal that TestStand gives no warning that a parameter is missing?
    I"m using it (TS3.5) with CVI (8.0).  The CVI function had one extra parameter that TestSTand didn't include.
    Thanks
    Rafi

    Hey Rafi,
    I'm assuming what you are talking about is in the Specify Module window within TestStand it was automatically populating the parameters for your function, and it was missing one of the parameters? Could you post exactly what your function prototype is here as it is declared in CVI?  Also which parameter is missing from the TestStand side?
    Pat P.
    Software Engineer
    National Instruments

Maybe you are looking for

  • White MacBook (Early 2008 Model) The Case is Peeling Away!

    Good morning all. I've had this issue for a few months where my MacBook's casing is peeling away at the edges, and it all seems to be near the magnets. I have one on the upper right hand corner of the screen (again, on the edge, which is slowly makin

  • Error RW:50004 during install of R12 on win 2003

    Hello, I'm trying to install EBS R12 Express install with Vision DB via edelivery. Had some issues with MSVC and cygwin paths, but it was resolved thanks to posts on the forum. After about 20% of the installation [about 1hr 30mins into it], I get the

  • ITunes will not open on my iPhone5 after iOS7 update

    The app store opens but the iTunes store does not.  This prevents my music from downlaoding from the Cloud.  Any suggestions?

  • Touch panel fonts and Graphics

    Gentlemen       In addition to my previous issue, I would like to ask regarding touchpanel TPC-2006 fonts and graphics. See, for our client we plan to give four screens in touch panel and in one screen it is with list of alarms. So here when list box

  • Page extends vs page import

    What is the difference between           <%@ page extends="com.beasys.commerce.portal.admin.PortalJspBase"%>           and           <%@ page import="com.beasys.commerce.portal.admin.PortalJspBase"%>