Help with multiple parameter search recordset

I have a mysql table being searched by two fields City and
State
using dreamweaver, I have set up a form with a text field as
city and a list as state and I have them being passed with the get
method.
The problem is on the results page, I have a recordset SELECT
* FROM table name. What do I do with the WHERE, I have tried
multiple configurations, and I can't get anything to work. I only
want to search by two fields, city and state. The state has to
match, but if the city is left blank, I still want to filter by
state.
Can somebody help me or point me in the right direction,
please?

SaigonJeff wrote:
> Oops... sorry!
>
> I'm using PHP / MySQL
>
> PHP 4.3.4
> MySQL 4.1
>
> Thanks for the help...
I was going to suggest a Stored Procedure approach, as that
is how I
always approach filtering, but I use MS SQL, and I don't know
if/how to
do it in MySQL.
The first part is fairly easy:
SELECT *
FROM yourTable
WHERE Column1 = MMColParam OR Column2 = MMColParam OR Column3
= MMColParam
Obviously this will match the entire value of MMColParam to
the entire
value of any 3 of the columns. If you want to latch the value
of
MMColParam to any part of the columns contents, you need to
do this:
SELECT *
FROM yourTable
WHERE Column1 LIKE '%' + MMColParam + '%' OR Column2 LIKE '%'
+
MMColParam + '%' OR Column3 LIKE '%' + MMColParam + '%'
This doesn't include the filter. How do you want to the
filter to work?
Steve

Similar Messages

  • Help with multiple httpservice calls

    I need help with multiple httpservice call back to back, doing 10 different mysql query at startup of the app loading results into 14 datagrids/combobox all queries are to different tables.

    Hello,
    I think what Grizzzzzzzzzz means is the following:
        <mx:HTTPService id="serviceOne"
            url="here goes url"
            result="resultHandler1(event);"
            fault="faultHandler(event);"/>
        <mx:HTTPService id="serviceTwo"
            url="here goes url"
            result="resultHandler2(event);"
            fault="faultHandler(event);"/>
        <mx:HTTPService id="serviceThree"
            url="here goes url"
            result="resultHandler3(event);"
            fault="faultHandler(event);"/>
         // Result handler 1
         private function resultHandler1(event:ResultEvent):void{
              //Here do something with the results
             xmlCollection = event.result as XML;
             //then call the next service
             serviceTwo.send();
          // Result handler 2
          private function resultHandler2(event:ResultEvent):void{
              //Here do something with the results
             xmlCollection = event.result as XML;
             //then call the next service
              serviceThree.send();
    I hope this helps,
    Pierre

  • Help with AND/OR Search

    Hi all,
    I'm setting up an 'Advanced Search' feature using a filter function and need some help with the logic - seem to be suffering a brain fade...
    There's a search form with (let's say) 4 different options:  Name, Description, Price, Features.
    I want the user to be able to fill in all or none of the fields and return the matching results.
    I can do an OR function like this:
    if(Name.match(regx1) || Description.match(regx2) || Price .match(regx3) )|| Features .match(regx4){
         return true;
    }else{
         return false;
    I know I could change the "||" to "&&" - but I need to do this only if there's something to search...
    The only way I can think of doing this at the moment is to write a bunch of 'if statements' with all permutations - eg:
    if(Name && !Description && !Price && !Features){
         //match Name only
    }else if(Name && Description && !Price && !Features){
         //match Name & Description
    }else... you get the idea
    Thanks for your help!
    Cheers

    hey Madhav,
    Thanks for the pointer.  I haven't used a bitwise AND Assignment before...
    When I write some code like below I get a compile error saying "Implicit conversion of type Boolean to an unrelated type Integer"
    From what I understand, 'criteria' should remain true only if the comparator is true.  But why do I get a compile error?
    Do you know what I'm doing wrong?
    var criteria:Boolean = true;
    var nameMatch:Boolean = false;
    if(name){
         if(name.match){
              nameMatch = true;
    if(name){
        crieteria &= nameMatch;  // compile error here
    thanks for your help!

  • Help with multiple contacts with multiple phone numbers

    I'm fairly new to the iPhone so thanks in advance for any help with this issue.
    I have contact list with records for a lot of people (300+), each with several phone numbers each, home, mobile & work, etc, .I can't seem to find a way to have the iPhone announce the name & number or name & type (home,mobile,work) of the caller from the contact list, my old cell phone could do that easily.
    At the moment what I've been doing as a work around for a few (important) people is to create a custom ringtone for that caller & that phone number.  Since it also seems there's no way to attach a different ringtones to each number in a single contact record I've had to create multiple contact records for each person, each with a different name/number combination such as "John Doe Work", "John Doe Home" or John Doe Mobile" then assign to it the custom ringtone I created for that name/number. 
    I need to this so that if I receive a call while I'm driving (or whatever) that I can't answer right then for some reason (often happens),  the ringtone I created for that name & number helpfully lets me know  who & where their calling from.  It's very important to know where someone is calling from, if someone's calling from home then I know I've got some time,  but if their calling from work then I need to get back to them quickly.
    This is a real pain!, having to make multiple contacts & ringtones for a every person with multiple numbers is a extraordinary waste of time.  My old cell phone could do this with no problem but there doesn't seem to be any way to do this with my new iphone.  Am I missing something here?  I am new to the iPhone so if there’s a solution to this that I’ve missed I'd very much appreciate the assistance.
    Thanks in advance.
    Al

    https://discussions.apple.com/message/18271382#18271382

  • Comparing two column values with multiple Parameter in VC (Indicator)

    Hello VC experts,
    GM
    I would like to know about how to indicate multiple parameter with different colour in same column and also comparing value with adjucent column.
    Eg.
    Parameters     ,,           Column1      ,,              Column 2       ,,            Indicator (Image)
    Parameter 1    ,,             a1             ,,                     b1          ,,                  RED
    Parameter 2    ,,            a2              ,,                     b2          ,,                  GREEN
    Parameter 3    ,,            a3              ,,                     b3          ,,                 
    Parameter 4    ,,            a4              ,,                     b4          ,,
    In case I  : Parameter -1     Column 1 ( value)  =  more is better compared to Column 2
    In case II : Parameter -2     Column 1 ( value)  =  Less is better compared to Column 2
    How to acheive this  INDICATOR based value comparison.
    Edited by: Sunil  B. Mundhe on Mar 7, 2009 6:30 AM
    Edited by: Sunil  B. Mundhe on Mar 7, 2009 6:38 AM

    Hi
    This is possible in VC. You have to insert 'Image' UI in the required table. Add images of alert through 'Image manager' (Tools tab). Select relevant images of alert in 'Image' UI. In display there is option for 'visibility condition' there you enter condition (like if greater than ,true,false).
    Like wise you can add multiple 'Image' UIs in that table & based on visibility conditions you will get these alert images in table.
    Regards
    Sandeep

  • Help With Multiple Schemas In Multiple Environments

    Dear Oracle Forum:
    We have a bit of controversy around the office and I was hoping we could get some expert input to get us on the right track.
    For the purposes of this discussion, we have two machines, development and production. Currently, on each machine, we have one database with multiple schemas, say, one for sales data and another for inventory. The sales data has maybe 200 tables and the inventory has another 50. About 12 times a year, once a month, we have a release and move code from dev to prod. The database is accessed by several hundred Pro*C and Pro*Cobol programs for online transaction processing.
    The problem comes up when we need to have multiple development environments. If I need to work on something for May that requires the customer address field to be 50 characters and somebody else is working on something for July that requires the customer address field to be 100 characters, we can’t both function in the same schema. We have a method of configuring running programs to attach to a given schema/database. Currently, everything connects to the same place. We were told that we should not have the programs running as the owners of the schemas for some reason so we set up additional users. The SALES schema is accessed with the connect string: SALES_USER/[email protected]. (I don’t know where we got dot world from but that is not the current discussion.)
    One of the guys said that we should have 12 copies of the database running, which is kind of painful to think about in my opinion. Oracle is not a lightweight product and there are any number of ancillary processes that would have to be duplicated 12 times.
    My recommendation is that we have 12 schemas each for sales and inventory with 12 users each to access them. We would have something like JAN_SALES_USER, FEB_SALES_USER, etc. Each user would have synonyms set up for each of the tables it is interested in. When my program connects as MAY_SALES_USER, I could select from the customer table and I would get my 50 character address field. When the other user connects as JUL_SALES_USER, he would get his 100 character address field. Both of us would not know anything different.
    Another idea that came up is to have a logon trigger that would set the current schema for that user to the appropriate base schema. When JUL_SALES_USER logs in, the current schema would be set to JUL_SALES, etc. This would simplify things by allowing us to avoid having something like 2400 synonyms to maintain (which could be automated without too much difficulty) but it would complicate things by requiring a trigger.
    There are probably other ways to go about this we have not considered as yet. Any input you can give will be appreciated.
    Regards,
    /Bob Bryan

    Hans Forbrich wrote:
    I'd rather see you with 12 schemas than with 12 databases. Unless you have lots of CPUs to spare ... and lots of cash to pay for those extra CPU licenses.
    Then again, I'd take it one step further and ask to investigate the base design. There should be little reason to change the schema based on time. Indeed, from what little I know of your app, I'd have to ask whether adding a 'date' column and appropriate views or properly coded SQL statements might simplify things. Interesting. If we were to have one big Customer table with views for each month, how would we handle the case where the May people have to see 50 character address and July have to see a 100 character address field. I guess we could have MAY_ADDRESS VARCHAR2(50) and JULY_ADDRESS VARCHAR2(100) and take care to make sure that people connecting as May can only see the May columns, etc. This is simpler than multiple schemas?
    I may have overly simplified things in my effort to get something down that would not require too much explanation. The big thing is that multiple people are doing development and they have to be independent of each other. If we were to drop a column for July, the May people will have trouble compiling if we don’t keep things separate. It is not a case of making the data available. The data in development is something we cook up to allow us to test. The other part is the code we compile now will be released to production one of these times. In production, there is only a need for one database.
    We are moving from another database product where multiple databases are effectively different sets of files. We have lots of disk space so multiple databases were no problem. Oracle is such a powerful product; I can’t believe there is not some way to set up something similar.

  • Help with multiple case statements

    Hello,
    I am new to BO.  I am on XI 3.0.  SQL 2005.  In Designer, I am trying to create a measure in a financial universe that would end up being multiple case statements within one select.  This is what I tried to do, but it doesn't work with the two case statements.  Can I use an ELSE leading into the second CASE WHEN somehow?  How can I accomplish this?  Sorry for my ignorance!
    CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 12 THEN dbo.ClientBudgetMonth.Stage1Sales END
    CASE WHEN  dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 11 THEN dbo.ClientBudgetMonth.Stage1Sales END
    Any Suggestions?
    Thanks,
    Holly

    Holly,
    I don't know enough about your data or requirement to provide a solution, however, the construct that you post will not work because it causes you to build an object with multiple case statements when only one case statement per object is permitted.  From what I see in your code I would be inclined to combine the two statements into one as such:
    CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month in (11,12) THEN dbo.ClientBudgetMonth.Stage1Sales else null END
    Thanks,
    John

  • Help with multiple nat translation on a Cisco Nexus 3548

    Hi All,
    I need a little help with a NAT configuration on a cisco Nexus 3548 version 6.0(2)A4(3).
    What currently have is as follows:
    internal network: 192.168.4.0/24
    nexus router (routerA):
      LAN Side: vlan104 interface 192.168.4.201/24
      WAN Side: Eth1/48 interface 172.24.101.2/24
      remote network: 159.43.48.32/27
      remote gateway: 172.24.101.1/24
    use ACL's to ensure that only specific traffic is allowed out and in.
    allow a specific connection from a different internal network (192.168.3.0/24) to talk to port 159.43.48.34:1025
    Clients on the internal network 192.168.4.0, need to be able to connect to services (port 14002, port 8101) running on 159.43.48.34, but they must be SNAT'ed through the WAN interface as coming from 159.43.65.81
    Currently we have this working but the internal lan clients need to know how to get to 159.43.48.34/27 and therefore we need to route this network in our internal network.
    What we really want is to do is provide an address such as 192.168.4.203 for internal clients to use for connectivity to the various services, and then this address would be SNAT'ed to 159.43.65.81 over the WAN. We still want to secure the traffic in both directions.
    In the past i've been able to do this with inside and outside nat's and i haven't had to configure an interface on the router for the internal address, it has just been "stood up" by the nat rules. For example (this is how i've done it before):
    LAN interface
    ip nat outside
    WAN interface
    ip nat inside
    ip nat inside source static159.43.65.81 192.168.4.203
    ip nat outside source static 159.43.65.81 192.168.4.203
    but, trying to implement this sort of config on the Nexus isn't working.
    I am wondering if the Nexus behaves differently than ios based routers.
    I'd appreciate any help to get this config working.
    Thanks in advance,
    Les

    Les
    The issue with an "ip nat outside ..." static is that from the inside routing is done before NAT.
    So what happens is that the destination IP is 192.168.4.203 and the Nexus will do a route lookup, see it is directly connected so it won't forward the packet to the outside interface so it doesn't get translated.
    If you enter "ip nat outside source static 159.43.48.34 192.168.4.203" then on IOS it adds a host specific route to the routing table for 192.168.4.203 as directly connected.
    So you do a ping from a 192.168.3.x client  it looks like it is working but actually the L3 device is simply responding and the packet never gets to the server.
    Apologies for the long winded explanation but NXOS might behave differently and I wanted you to know what to look for.
    So with IOS there is the "add-route" option at the end of the NAT statement and if you use this it would add a host specific route into the routing table like this -
    192.168.4.203 255.255.255.255 159.43.48.34
    this is a recursive route ie. the device must know how to get to 159.43.48.34 but your Nexus should.
    What the above does is make sure any packets arriving at the Nexus for 192.168.4.203 get routed to the outside interface and so are translated.
    So firstly see if that option is available with your NAT statement ie.
    "ip nat outside source static 159.43.48.34 192.168.4.203 add-route"
    if it isn't then try adding just the static statement without it and then have a look at the routing table. If it hasn't put in a host specific route showing as directly connected which it may not, as it may behave differently, then you can manually add a route ie.
    192.168.4.203 255.255.255.255 <next hop IP>
    note that the next hop IP doesn't have to be the server here it could just be the next hop from the Nexus switch. All you are trying to do is get the packet routed to the outside interface.
    Hope that makes sense.
    Edit - one thing I haven't tried is to use a different IP subnet for NAT ie. one that is still part of your internal range but unused and then having a route on the Nexus, in your case, pointing to the outside interface and you redistribute this subnet into your IGP. Then you add the NAT statement.
    What may happen is it still adds a host specific route showing as directly connected but it may not because the Nexus wouldn't actually have a directly connected interface for that subnet.
    I suspect it would though.
    If it did work then it would still mean you didn't need to advertise the public IP internally.
    If I get the chance I'll test it later today.
    Jon

  • Help With Multiple Class Objects With Methods

    I am dealing with multiple classes. I am wondering why I am getting an error on this line it's by the bottom
              obj1.array() = newArray[i];
    It gives the array out of bounds. On another note I believe I can change obj1 to just like incomingArray if I wanted correct since it's just a reference because I should be able to do this method sort on any array.
    method : selSort
    input - none
    output - void
    This is where we sort the arary
    Pseudocode Code:
    1 Initialize variable oldlocation to hold spot of smallest number in original array
    2 Initialize variable smallnumber to store smallest number in original array
    3 Initialize new integer array
    4 Set new array length to length of original array
    5 Initialize variable length to store lengh of new array
    6 For i = 0 and continue till i < new array length
    6.1 Find smallest number in original array
    6.2 Put the smallest number in new array
    6.3 Remove smallest number from original array
    7 Copy contents of new array that is sorted to original array
    Basic concept is to repetitively find the smallest
    (or largest) item in the original array. Once smallest
    is found, move it to the next spot in a new array and
    remove it from the old array.
    public void selSort ()
         int oldlocation = 0;
         int smallnumber = 0;
         int [] newArray = obj1.array();
         newArray = new int [obj1.length()];
         int length = newArray.length;
         for (int i = 0; i < newArray.length; i++)
    //          System.out.println("Test 1");
              newArray[i] = obj1.sortSmall();
    //          System.out.println("Test 2");
              smallnumber = obj1.sortSmall();
    //          System.out.println("This is the smallest number " + smallnumber);
              oldlocation = obj1.location(smallnumber);
    //          System.out.println("This is the old location " + oldlocation);
    //          System.out.println("Test 3");
              obj1.removeLocation(oldlocation);
    //          System.out.println("Test 4");
         System.out.println();
         System.out.println("The sorted array looks like");
         for (int k = 0; k < newArray.length; k++)
              System.out.print(newArray[k] + " ");
         System.out.println();
         System.out.println();
         obj1.resize(newArray.length);
         for (int i = 0; i < newArray.length; i++)
              obj1.array()[i] = newArray[i];
         return;

    method : selSort
    input - none
    output - void
    This is where we sort the arary
    Pseudocode Code:
    1 Initialize variable oldlocation to hold spot of smallest number in original array
    2 Initialize variable smallnumber to store smallest number in original array
    3 Initialize new integer array
    4 Set new array length to length of original array
    5 Initialize variable length to store lengh of new array
    6 For i = 0 and continue till i < new array length
    6.1 Find smallest number in original array
    6.2 Put the smallest number in new array
    6.3 Remove smallest number from original array
    7 Copy contents of new array that is sorted to original array
    Basic concept is to repetitively find the smallest
    (or largest) item in the original array. Once smallest
    is found, move it to the next spot in a new array and
    remove it from the old array.
    public void selSort ()
         int oldlocation = 0;
         int smallnumber = 0;
         int [] newArray = obj1.array();
         newArray = new int [obj1.length()];
         int length = newArray.length;
         for (int i = 0; i < newArray.length; i++)
    //          System.out.println("Test 1");
              newArray[i] = obj1.sortSmall();
    //          System.out.println("Test 2");
              smallnumber = obj1.sortSmall();
    //          System.out.println("This is the smallest number " + smallnumber);
              oldlocation = obj1.location(smallnumber);
    //          System.out.println("This is the old location " + oldlocation);
    //          System.out.println("Test 3");
              obj1.removeLocation(oldlocation);
    //          System.out.println("Test 4");
         System.out.println();
         System.out.println("The sorted array looks like");
         for (int k = 0; k < newArray.length; k++)
              System.out.print(newArray[k] + " ");
         System.out.println();
         System.out.println();
         obj1.resize(newArray.length);
         for (int i = 0; i < newArray.length; i++)
              obj1.array() = newArray[i];
         return;

  • Need help with multiple accounts

    I forgot my original password for my itunes account.  Stupidly, i set up another one.  Now I can't play my songs from my original account because I hace to put in that password.  Tried reseting the password, but the email address from that account has been deactivated, so when it says" will sennd to email address on file, I can't retrive the email to rest the password.  Is there a way to merge both accounts?

    No.  You cannot merge the accounts.  Sorry.
    You can try contacting itunes support for help with your password.

  • STILL NEED help with MULTIPLE COMPUTER usage

    please please... it wont let me transfer songs from this 2nd computer to the ipod... PLEASE... i already set it to manual and it still wont work!

    See this.
    Using iPod with multiple computers.
    If you don't understand how manual transfer works, see this also.
    Manual transfer.

  • Search Help With Input Parameter in WebDynpro ABAP

    Hello all,
    I have been facing a problem regarding a search help I wanted to attach to an input field on my UI. The search help expects an import parameter and offers four output parameters. What I did was to create a context node based on a ddic structure. The structure has one attribute for each of the five parameters. I defined the search help for all context attributes except the importing one where I deactivated the search help. The search help is available on one of the input fields on the view and bound to one of the attributes in the context. The other context attributes are not bound to anything. The names as well as the data types are the same in the search help as well as in the ddic structure, bound to the context node.
    During WDDOINIT, I am setting the "import" context attribute. The problem is that the table with the search help parameters is empty when the search help exit is entered. Do you have any idea what I have to do in order to provide the import value to the search help?
    Thanks in advance and best regards
    Simeon

    Hi,
    By context node, do u mean that u made a drop down with values in ddic structure ,
    rather than that u can use FM 'VRM_SET_VALUES' this would be simpler if that makes sense for ur requirement.
    pls revert if any comments on it.
    regards,
    Dinesh.

  • Search help with multiple key fields

    Hi,
    I want to dispaly search help on a field from a internal table have multiple key fields i.e combination of fld1 + fld2 +fld3 makes one single row. Therfore can any one tell me how to return that single row , because if I am using function F4IF_INT_TABLE_VALUE_REQUEST I get only one return field that I select by which I can't get the actual line that I have selected as there may be more that one line for that field.
    please suggest any way through programming not by creating any search help through se11.
    thanks

    Hi,
    Use select query to select the fields & display them.
    In the following code i've selected only a single field in select query but u can do it for more than 1 & proceed similarly.i've tried it before using this code.
    SELECT WERKS
             NAME1
             FROM T001W
             INTO TABLE ITEMP
             WHERE IWERK = 'M011'.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                  DDIC_STRUCTURE   = ' '
                RETFIELD         = 'WERKS'
                  PVALKEY          = ' '
                  DYNPPROG         = ' '
                  DYNPNR           = ' '
                  DYNPROFIELD      = ' '
                  STEPL            = 0
                  WINDOW_TITLE     =
                  VALUE            = ' '
               VALUE_ORG        = 'S'
                  MULTIPLE_CHOICE  = ' '
                  DISPLAY          = ' '
                  CALLBACK_PROGRAM = ' '
                  CALLBACK_FORM    = ' '
           TABLES
                VALUE_TAB        = ITEMP
                  FIELD_TAB        =
               RETURN_TAB       = T_RETURN
                  DYNPFLD_MAPPING  =
             EXCEPTIONS
                  PARAMETER_ERROR  = 1
                  NO_VALUES_FOUND  = 2
                  OTHERS           = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      S_WERK-LOW = T_RETURN-FIELDVAL.
    Hope this helps.
    Reward if helpful.
    Regards,
    Sipra

  • Help with multiple recordsets and pulling an ID value (ASP)

    I started this discussion when first developing my project and posted on the General Tab.  I have figured out that issue (trying to get my Insert to work in ASP) but now am having trouble retrieving an ID value.  It should be simple.  I want to insert a new record into a single table and want to create a unique ID field.  I am using SQL Server and tried the Identity setting but won't be able to have admin privileges which are required to set the ID.  So, I'd like to just take the ID value from the last record and just add '1' to it to get a new unique ID manually. My INSERT portion was working, so I just decided to query the records to retrieve the last CatalogID and add '1' to get my new ID.  But it's not working!  I tried opening both a command and a recordset, but get various errors on invalid command use. 
    Any help would be great!  I'm new to all of this!
    I've posted a code snippet of what I thought I should do:
    <%LANGUAGE = “VBSCRIPT” CODEPAGE=”65001”%)
    <!--#include file=”Connections/CapConnect.asp”” -->
    <%
    If (Cstr(Request(“MM_insert”)) = “form1”) Then
                    Dim MM_editCmd
                    Dim MM_Lookup
                    Dim NextCatalogID
                    Set MM_Lookup = Server.CreateObject (“ADOB.Recordset”)
                    MM_Lookup.ActiveConnection = MM_CapConnect_STRING
                    MM_Liikup.Source = “Select CatalogID From dbo.tblCatalogItems ORDERBY CatalogID Ascending”
                    MMLookup.Open
                    MM_Lookup.MoveLast
                    NextCatalogID = MM_Lookup.Fields(“CatalogID”) + 1   'this is supposed to be my new ID value
                    Set MM_Lookup = Nothing
                    Set MM_editCmd = Server.CreateObject(“ADOB.Command”)
                    MM_editCmd.ActiveConnection = MM_CapConnect_STRING
                    MM_editcmd.CommandText = “INSET INTO dbo.tblCatalogItems (CatalogID, ModelName, Description, POCName, [POCPhone]) VALUES (NextCatalogID, ?,?,?,?)
                    MM_editcmd.Prepared = True
                    MM_edit.Parameters.Append MM_editcmd.CreateParameter(“param2”, 202, 1, 100, Request.Form(“modelname”) )
                  MM_edit.Parameters.Append MM_editcmd.CreateParameter(“param3”, 202, 1, 300, Request.Form(“Description”) )
    [Subject line edited by moderator to add server model]

    Ok, you've got lots of problems. First, explain again why you are not able to modify the CatologID to be an identity column? What is the datatype of that column now?
    Next, you are going about selecting your recordset incorrectly. If you are just looking for the last value inserted, there is no need to return all values to the recordset. Just select the max value:
    MM_Liikup.Source = “Select MAX (CatalogID) From dbo.tblCatalogItems”
    Next, you have a typo in your insert statement "“INSET INTO" should be "INSERT INTO"
    Next, your CommandText is wrong. There is no ending quote, and NextCatalogID will be treated as a string literal, not a variable. Use a ? placeholder for it and use the CreateParameter method to populate it.
    Next, your command text includes 4 placeholder, but you are only populating 2.
    But even when you get this to work it will be problematic. What happens when 2 users execute this at the same time? They both read the same value for the max record and increment by one, but the first will succeed and the second will fail. That's why it is always better to use an auto increment (Identity) column.

  • Help With Multiple Selection

    I have a data template with several parameters. For one of the parameters I want to be able to select one, multiple or ALL values. At this time I can select one value and it runs fine. If I select more then one value, then I get an error that says: INVALID NUMBER
    I am not sure what I am doing wrong.
    Here is my data template:
    <dataTemplate name="ld_status" dataSourceRef="xmlpdemo">
         <parameters>
              <parameter name="p_ke" dataType="number"/>          <parameter name="p_beg_twn" dataType="number"/>
              <parameter name="p_td" dataType="character"/>
              <parameter name="p_beg_rng" dataType="number"/>
              <parameter name="p_rd" dataType="character"/>
              <parameter name="p_beg_section" dataType="number"/>
              <parameter name="p_end_twn" dataType="number"/>
              <parameter name="p_td2" dataType="character"/>
              <parameter name="p_end_rng" dataType="number"/>
              <parameter name="p_rd2" dataType="character"/>
              <parameter name="p_end_section" dataType="number"/>
              <parameter name="p_beg_parcel" dataType="number"/>
              <parameter name="p_end_parcel" dataType="number"/>
              <parameter name="p_beg_active" dataType="character"/>
              <parameter name="p_end_active" dataType="character"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="Q1">
                   <![CDATA[select distinct
         l.quad o_quad
    ,     l.twp o_twp
    ,     l.rng o_rng
    ,     l.section o_section
    ,     l.county o_county
    ,     l.fund o_fund
    ,     l.parcel o_parcel
    ,     get_land#_display(l.quad,l.twp,l.rng,l.section,l.county,l.fund,l.parcel)
         o_display_land
    ,     get_cnty_desc(l.county) o_county_display
    ,     get_fund_desc(l.fund) o_fund_display
    ,     decode(l.active, 'A','Active', 'I','Inactive', ' ') o_active
    ,     l.surface o_surface
    ,     l.oil_gas o_oil_gas
    ,     l.mineral o_mineral
    ,     l.surface_open o_surface_open
    ,     l.oil_gas_open o_oil_gas_open
    ,     l.mineral_open o_mineral_open
    ,     t018.description o_class_description
    ,     t002.description o_ownership_description
    ,     l.leased o_leased
    ,     l.surface_text o_surface_text
    ,     l.oil_gas_text o_oil_gas_text
    ,     l.mineral_text o_mineral_text
    ,     l.comments o_comments
    ,     l.last_maint o_last_maint
    ,     l.surface_maint o_surface_maint
    ,     l.oil_gas_maint o_oil_gas_maint
    ,     l.mineral_maint o_mineral_maint
    ,     l.comment_maint o_comment_maint
    from     land_legal l
    ,     t018_land_classification t018
    ,     t002_ownership t002
    ,     statmast s
    ,       quad q
    where l.class = t018.code (+)
    and  l.ownership = t002.code (+)
    and l.parcel = 1
    and l.quad = s.quad
    and l.twp = s.twp
    and l.rng = s.rng
    and l.section = s.section
    and l.county = s.county
    and l.fund = s.fund
    and l.quad = q.quad
    and (to_char(l.twp,'000')||'-'||to_char(q.td)||'-'||to_char(l.rng,'000')
    ||'-'||to_char(q.rd)||'-'||to_char(l.section,'00')) >=
    (to_char(:p_beg_twn,'000')||'-'||to_char(:p_td)||'-'||to_char(:p_beg_rng,'000')||'-'||to_char(:p_rd)||'-'||to_char(:p_beg_section,'00'))
    and
    (to_char(l.twp,'000')||'-'||to_char(q.td)||'-'||to_char(l.rng,'000')
    ||'-'||to_char(q.rd)||'-'||to_char(l.section,'00')) <=
    (to_char(:p_end_twn,'000')||'-'||to_char(:p_td2)||'-'||to_char(:p_end_rng,'000')||'-'||to_char(:p_rd2)||'-'||to_char(:p_end_section,'00'))
    ]]>
              </sqlStatement>
              <sqlStatement name="Q2">
                   <![CDATA[select     l.quad d_quad
    ,     l.twp d_twp
    ,     l.rng d_rng
    ,     l.section d_section
    ,     l.county d_county
    ,     l.fund d_fund
    ,     l.parcel d_parcel
    ,     get_land#_display(l.quad,l.twp,l.rng,l.section,l.county,l.fund,l.parcel)
         d_display_land
    ,     get_cnty_desc(l.county) d_county_display
    ,     get_fund_desc(l.fund) d_fund_display
    ,     decode(l.active, 'A','Active', 'I','Inactive', ' ') d_active
    ,     l.surface d_surface
    ,     l.oil_gas d_oil_gas
    ,     l.mineral d_mineral
    ,     decode(l.active, 'A', l.surface, 0) d_act_surface
    ,     decode(l.active, 'A', l.oil_gas, 0) d_act_oil_gas
    ,     decode(l.active, 'A', l.mineral, 0) d_act_mineral
    ,     decode(l.active, 'I', l.surface, 0) d_ina_surface
    ,     decode(l.active, 'I', l.oil_gas, 0) d_ina_oil_gas
    ,     decode(l.active, 'I', l.mineral, 0) d_ina_mineral
    ,     decode(l.active, 'A', 1, 0) d_act_count
    ,     decode(l.active,'I',1, 0) d_ina_count
    ,     l.surface_open d_surface_open
    ,     l.oil_gas_open d_oil_gas_open
    ,     l.mineral_open d_mineral_open
    ,     t018.description d_class_description
    ,     t002.description d_ownership_description
    ,     l.leased d_leased
    ,     l.surface_text d_surface_text
    ,     l.oil_gas_text d_oil_gas_text
    ,     l.mineral_text d_mineral_text
    ,     l.comments d_comments
    ,     l.last_maint d_last_maint
    ,     l.surface_maint d_surface_maint
    ,     l.oil_gas_maint d_oil_gas_maint
    ,     l.mineral_maint d_mineral_maint
    ,     l.comment_maint d_comment_maint
    ,     s.ke d_test_ke
    ,     decode(s.stat_code, 5,'LEASE', 21,'APPLICATION', null) d_stat_desc
    ,     s.evtdate d_evtdate
    ,     ltrim(to_char(s.ke,'000')) || '-'
    ||     ltrim(to_char(s.lease#,'000000')) || '-'
    ||     ltrim(to_char(s.lse_code,'000')) || '-'
    ||     ltrim(to_char(s.lse_seq,'000')) d_kelease
    ,     s.rolodex# d_rolodex
    ,     s.appdate d_app_date
    ,     s.effdate d_effdate
    ,     decode(s.perpetual, 'Y','PERPETUAL', to_char(s.expdate,'yyyy-MM-dd')) d_expdate
    ,     s.aus aus
    ,     decode( s.stat_code, 5,get_t005_lease_desc(s.stat_code)
                   , 21,get_t005_lease_desc(s.stat_code), null) d_desc_5_21
    ,     s.amend# amend
    ,     get_rolodex_lname(s.rolodex#) d_lname
    from     land_legal l
    ,     statmast s
    ,     t018_land_classification t018
    ,     t002_ownership t002
    where     [b]s.ke = :p_ke
    and     l.parcel >= :p_beg_parcel
    and     l.parcel <= :p_end_parcel
    and     l.active >= :p_beg_active
    and l.active <= :p_end_active
    and     14 <> s.stat_code (+)
    and     l.class = t018.code (+)
    and     l.ownership = t002.code (+)
    and     l.parcel <> 1
    and     l.quad = s.quad (+)
    and     l.twp = s.twp (+)
    and     l.rng = s.rng (+)
    and     l.section = s.section (+)
    and     l.county = s.county (+)
    and     l.fund = s.fund (+)
    and     l.parcel = s.parcel (+)
    and     l.active = s.active (+)
    and l.quad = :o_quad
    and     l.twp = :o_twp
    and     l.rng = :o_rng
    and     l.section = :o_section
    and     l.county = :o_county
    and     l.fund = :o_fund]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G_OWNERSHIP" source="Q1">
                   <element name="O_QUAD" value="O_QUAD"/>
                   <element name="O_TWP" value="O_TWP"/>
                   <element name="O_RNG" value="O_RNG"/>
                   <element name="O_SECTION" value="O_SECTION"/>
                   <element name="O_COUNTY" value="O_COUNTY"/>
                   <element name="O_FUND" value="O_FUND"/>
                   <element name="O_PARCEL" value="O_PARCEL"/>
                   <element name="O_DISPLAY_LAND" value="O_DISPLAY_LAND"/>
                   <element name="O_COUNTY_DISPLAY" value="O_COUNTY_DISPLAY"/>
                   <element name="O_FUND_DISPLAY" value="O_FUND_DISPLAY"/>
                   <element name="O_ACTIVE" value="O_ACTIVE"/>
                   <element name="O_SURFACE" value="O_SURFACE"/>
                   <element name="O_OIL_GAS" value="O_OIL_GAS"/>
                   <element name="O_MINERAL" value="O_MINERAL"/>
                   <element name="O_SURFACE_OPEN" value="O_SURFACE_OPEN"/>
                   <element name="O_OIL_GAS_OPEN" value="O_OIL_GAS_OPEN"/>
                   <element name="O_MINERAL_OPEN" value="O_MINERAL_OPEN"/>
                   <element name="O_CLASS_DESCRIPTION" value="O_CLASS_DESCRIPTION"/>
                   <element name="O_OWNERSHIP_DESCRIPTION" value="O_OWNERSHIP_DESCRIPTION"/>
                   <element name="O_LEASED" value="O_LEASED"/>
                   <element name="O_SURFACE_TEXT" value="O_SURFACE_TEXT"/>
                   <element name="O_OIL_GAS_TEXT" value="O_OIL_GAS_TEXT"/>
                   <element name="O_MINERAL_TEXT" value="O_MINERAL_TEXT"/>
                   <element name="O_COMMENTS" value="O_COMMENTS"/>
                   <element name="O_LAST_MAINT" value="O_LAST_MAINT"/>
                   <element name="O_SURFACE_MAINT" value="O_SURFACE_MAINT"/>
                   <element name="O_OIL_GAS_MAINT" value="O_OIL_GAS_MAINT"/>
                   <element name="O_MINERAL_MAINT" value="O_MINERAL_MAINT"/>
                   <element name="O_COMMENT_MAINT" value="O_COMMENT_MAINT"/>
                   <group name="G_DETAIL" source="Q2">
                        <element name="D_QUAD" value="D_QUAD"/>
                        <element name="D_TWP" value="D_TWP"/>
                        <element name="D_RNG" value="D_RNG"/>
                        <element name="D_SECTION" value="D_SECTION"/>
                        <element name="D_COUNTY" value="D_COUNTY"/>
                        <element name="D_FUND" value="D_FUND"/>
                        <element name="D_PARCEL" value="D_PARCEL"/>
                        <element name="D_DISPLAY_LAND" value="D_DISPLAY_LAND"/>
                        <element name="D_COUNTY_DISPLAY" value="D_COUNTY_DISPLAY"/>
                        <element name="D_FUND_DISPLAY" value="D_FUND_DISPLAY"/>
                        <element name="D_ACTIVE" value="D_ACTIVE"/>
                        <element name="D_SURFACE" value="D_SURFACE"/>
                        <element name="D_OIL_GAS" value="D_OIL_GAS"/>
                        <element name="D_MINERAL" value="D_MINERAL"/>
                        <element name="D_ACT_SURFACE" value="D_ACT_SURFACE"/>
                        <element name="D_ACT_OIL_GAS" value="D_ACT_OIL_GAS"/>
                        <element name="D_ACT_MINERAL" value="D_ACT_MINERAL"/>
                        <element name="D_INA_SURFACE" value="D_INA_SURFACE"/>
                        <element name="D_INA_OIL_GAS" value="D_INA_OIL_GAS"/>
                        <element name="D_INA_MINERAL" value="D_INA_MINERAL"/>
                        <element name="D_ACT_COUNT" value="D_ACT_COUNT"/>
                        <element name="D_INA_COUNT" value="D_INA_COUNT"/>
                        <element name="D_SURFACE_OPEN" value="D_SURFACE_OPEN"/>
                        <element name="D_OIL_GAS_OPEN" value="D_OIL_GAS_OPEN"/>
                        <element name="D_MINERAL_OPEN" value="D_MINERAL_OPEN"/>
                        <element name="D_CLASS_DESCRIPTION" value="D_CLASS_DESCRIPTION"/>
                        <element name="D_OWNERSHIP_DESCRIPTION" value="D_OWNERSHIP_DESCRIPTION"/>
                        <element name="D_LEASED" value="D_LEASED"/>
                        <element name="D_SURFACE_TEXT" value="D_SURFACE_TEXT"/>
                        <element name="D_OIL_GAS_TEXT" value="D_OIL_GAS_TEXT"/>
                        <element name="D_MINERAL_TEXT" value="D_MINERAL_TEXT"/>
                        <element name="D_COMMENTS" value="D_COMMENTS"/>
                        <element name="D_LAST_MAINT" value="D_LAST_MAINT"/>
                        <element name="D_SURFACE_MAINT" value="D_SURFACE_MAINT"/>
                        <element name="D_OIL_GAS_MAINT" value="D_OIL_GAS_MAINT"/>
                        <element name="D_MINERAL_MAINT" value="D_MINERAL_MAINT"/>
                        <element name="D_COMMENT_MAINT" value="D_COMMENT_MAINT"/>
                        <element name="D_TEST_KE" value="D_TEST_KE"/>
                        <element name="D_STAT_DESC" value="D_STAT_DESC"/>
                        <element name="D_EVTDATE" value="D_EVTDATE"/>
                        <element name="D_KELEASE" value="D_KELEASE"/>
                        <element name="D_ROLODEX" value="D_ROLODEX"/>
                        <element name="D_APP_DATE" value="D_APP_DATE"/>
                        <element name="D_EFFDATE" value="D_EFFDATE"/>
                        <element name="D_EXPDATE" value="D_EXPDATE"/>
                        <element name="AUS" value="AUS"/>
                        <element name="D_DESC_5_21" value="D_DESC_5_21"/>
                        <element name="AMEND" value="AMEND"/>
                        <element name="D_LNAME" value="D_LNAME"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>
    I want the parameter :p_ke to multiple select.
    Here is my List of Values for the parameter :p_ke:
    select     CODE KE
    from     T052_KE_EXPLOSION
    where CODE > 0
    ORDER BY CODE
    I have the option: MULTIPLE SELECTION....check for :p_ke
    Does anyone know what I am doing wrong?
    I appreciate any help I can get!
    Susie

    Susie,
    use in the Query inside the Data Template a lexical parameter like
    select * from emp &p_mylexical
    This lexical parameter could be filled in a BeforeReport Trigger. In this Package-Call you will have something like
    p_mylexcial := 'where deptno in ('||p_deptno||')';
    where p_deptno is your multi-select parameter.
    This should run if p_deptno is empty, has one value ore more.
    If you want to see every row when no value is choosen ('all') then use something like
    if p_deptno is not null then
    p_mylexical := 'where DEPTNO in ('||p_deptno||')';
    else
    p_mylexical := null;
    end if;
    So for your example that means
    - create a new lexical parameter (p_lexical)
    - replace in your query in the data template s.ke = :p_ke with &p_lexical
    - call a before report trigger in which is something like:
    p_mylexcial := 's.ke in ('||p_ke||')';
    Regards
    Rainer

Maybe you are looking for

  • Can't view videos in iTunes now

    My computer, previously running on Vista, recently crashed. I backed up my data and loaded Windows 7 instead. Things are running great now, and I have downloaded iTunes 9.2. I have all my music and videos back, but I cannot watch any of the videos on

  • Thumbnail view issues in PSE 10.

    Hello, new member here. I can't view RAW thumbnails when I go into the open dialog (not organizer)  just regular file/open in PSE10.  (win 7 x64).  (Sony alpha 33) Is there a cache issue?  Can I clear it? I can see a preview of the file on the bottom

  • Vertical Alignment in table columns

    Using JHeadstart 10.1.3.4. Different display types are differently positioned in table columns. Single text seems vertically centered; text fields with multiple lines are vertically aligned at the top of a table column; vertical radio buttons are ver

  • When validate item for a particular item number

    hi all i am using forms 6i In a master detail form the block XXNP_JL_OO1 has 2 fields like Manual--checkbox item Field--text item (populated from Lov RECORD group names Field) the query for the record group of FIELD is select flex_value from fnd_flex

  • Send CURSOR to Function/Store Procedure

    Hi to all, I want to send a cursor to a function or store procedure. I got 3 tables with the same structure, I made a cursor for update and other stuff but I want to save some data to a text file, so I want to make a function or sotre procedure that