Random record for ASP

I would like to have a section on my ASP page to generate a
random record that pulls from my database. So that each time the
page is opened/refreshed, a different record is displayed.
Any ideas?

"Biggest Dave" <[email protected]> wrote in
message
news:e2nn6n$83e$[email protected]..
>I would like to have a section on my ASP page to generate
a random record
>that pulls from my database. So that each time the page
is
>opened/refreshed, a different record is displayed.
>
> Any ideas?
Yes.
Of course, since I don't know what database you're using, any
or all of
those ideas could be useless.

Similar Messages

  • Help with selecting 10 random records from all records meeting report selection criteria in Crystal 11

    <p>I am trying to select ten random records from all that match the report selection criteria then report on each of these random records for QA/QI.  I have tried the RND function however it is giving me a random number rather than a random record selection.  I cannot figure this out and am despirately seeking assistance.</p><p>Thank you,</p><p>Amy</p>

    <p>I don&#39;t know of any Random record selection functions but maybe you could write your own custom function inside of a record selection to randomly filter the records.  You would use the Rand function we currently have to decide if a record was included in the report data or not.</p><p>Another possible option is to filter the records before they get to the report.  You can only do this if you are pushing the data into the report instead of having the report pull the data.  An example of this would be passing an ado recordset to a report at runtime. </p><p>Rob Horne</p><p>http://diamond.businessobjects.com/blog/10 </p>

  • How can I select the random records in u201Cstep loopu201D.

    Hi, Experts,
    I am using step loop to display the data on screen now I want to select the random records from this step loop display. Like 1st 3rd or 5th record, is there any way to select the records,
    like I did in Table control there was a filed in internal table named marked char length 1, I gave this field name in u201Cw/ SelColumnu201D it fill that field with u2018Xu2019 from where I can get the info about the selected records, in this way I can easily perform the operation on that internal table with the help of that marked field.
    Is there any way to select the records in step loop too ?
    Kind Regards,
    Faisal

    thanks for replay shwetali,
    but i just gave you example of random records with 1st 3rd and 5th my goal is not select only these records. i want to select the random mean any records from the step loop display.
    like we can select from the table control. and when select any record it place 'X' in the given internal table field.
    Thanks and kind Regards,
    Faisal

  • Randomly Records are missing from R/3 to BW

    Hi all,
    I have a Employee Cube, which maintains Daily time sheet (Empid, workingday, Working Hours etc..) of each employee.
    For Employee Cube,  deltas are running daily basis. In R/3 side all data is available.
    Problem is I missed randomly some data records for each employee from R/3 to BW.
    I did some full loads , put selection  conditions (Empid =009223, calday=04092005)  , it loads missed data successfully for that date .
    To laod like this for each employee it is very much painful.
    Why (0cats_is_1)standard R/3 extractor not picking up all data? What is the solution for this? Advise me.
    Please help me. It is little bit urgent.
    Warm Regards
    Sri.

    Hi Sri,
    Update mode "C" is to check the data for the Initialization of the delta.
    Update mode "D" is to check the data for delta since last request.
    Update mode "R" is to check the data for repeat of the last delta.
    This mode must no longer be supported by the extractor under the following conditions:
    1. The system has an R/3 Release >= 4.0B
    2. The extractor is completely roll back-capable within an extraction process, meaning that no database-commit takes place in the extractor.
    Update mode "S" is for Simulate the initialization of the delta.If an extractor is called in this mode, it is not permitted to deliver any data. Its only job is to make sure that for this request, the delta mode ('D') is possible for any following requests.
    Example The extractor uses a time stamp stored in an administration table to determine the delta. In the delta mode, only those records that have been changed or generated since the last extraction are actually transferred. In mode 'S', the current time stamp is included in the administration table, but no data is transferred into BW.
    Hope this helps.
    Bye
    Dinesh

  • Select Random Records with Group By?

    Hi,
    I currently select random records by using this type of SQL:
    (SELECT *
    FROM ( SELECT *
    FROM ( SELECT *
    FROM TABLEA
    ORDER BY dbms_random.value
    WHERE ROWNUM <= 100
    Based on the following data, I now want to still pick out random records but I only want 1 record from the same ID and START_DATE but where the FLAG could be Y or N.
    So with grouping by ID and START_DATE, I need to still be able to choose the record if it has anything from 1 entry or 10 entries per ID and START_DATE.
    Could this be performed with a GROUP BY?
    ID START_DATE FLAG
    1 12/12/2005 Y
    1 12/12/2005 N
    1 12/12/2005 N
    1 30/12/2005 Y
    1 30/12/2005 N
    1 30/12/2005 N
    2 10/10/2005 Y
    2 07/07/2005 Y
    Thanks for any help.
    Daniel

    Try this [not tested]:
    SELECT *
         FROM
              (SELECT *
                   FROM
                   ( SELECT
                              ID
                             ,START_DATE
                             ,FLAG
                             ,ROW_NUMBER() OVER
                                  (PARTITION BY ID,START_DATE ORDER BY dbms_random.value) RN
                        FROM TABLEA
                   ORDER BY dbms_random.value
         WHERE RN = 1
              AND ROWNUM <= 100
         ;

  • Display random records

    Hi guys,
    Is there an easy way to display a random record from an XML
    file? Current code:
    HEAD
    <script type="text/javascript">
    <!--
    var dsPower = new Spry.Data.XMLDataSet("broadband.xml",
    "software/product");
    //-->
    </script>
    BODY
    <div spry:region="dsPower">{product_name}</div>
    What i want to happen is when the page is loaded (and/or
    reloaded) i want the {product_name} to randomly display any one of
    my ten product names. I presume it requires use of {ds_RowID} and
    some JavaScript, but am unsure of where to begin.
    Thanks in advance for any help.

    nevermind people, i figured it out already. please close this topic.

  • Random Record Display

    Can someone tell me how to display a random record from a database? I want to use it on my site to show a "review"... am able to do it in ASP but not sure how to in JSP.
    Any advice is gratefully received.
    M

    ok man
    you can put all object that you get it form DB in not
    sorted contener as HashMAP. okYeah, then to further randomize it, you can use a Random Number to lookup in that HashMap. ;) Sounds interesting.
    Annie.

  • How to get the sample repository data of over 6000 records for products

    Hi,
    I have MDM installed and ready to use with the standard 9 repositories provided by SAP. I was wondering if I can get the unarchive .a2a file with the sample data of records (I think over 6000 records) for the Products repository. I have tried to bring in the two .a2a product files that I have, but it was giving version inconsistent errors. How do and where do I get the real sample data (not the one we can create in data manager) correct version provided by SAP, so that I can get my hands on SAP data manager funtionality.
    Thanks in advance,
    N@v!n K

    Hi Navin,
    Business Content archives that are provided by SAP for MDM do not come with the sample data.
    In the bsuiness content ,if you unzip the file you will see the a2a archive of the rep as provided by SAP and the import /export maps and the lookup data file.
    There is no main records that SAP provide with the sap content it is basically the data modell that SAP provides so that the foundation is set for you and you can now import and work with the data.
    However if you wish to use the demo repository or the training rep from Inquera then you will same some sample data already loaded in MDM rep to work upon.
    Regarding the version problem
    Check the MDM version of the business content rep with the MDM server you are using .They have to match to work correctly.
    You can work with a lower archives of the rep(say SP04) with an Upgraded MDM server (say SP06) by using the Update Repository option in the context menu of the MDM server in Console.
    But the vice versa is not possible.
    Check you MDM server version by clicking on the MDM server and see its details in the right side record detail pane.
    To know more on the demo and Inquera rep kinldy view the below links:
    https://www.sdn.sap.com/irj/sdn/nw-demomodel#section21 (Demo Rep)
    http://www.inquera.com/InqueraCatalog/CustomerLogin.asp(Demo Rep from Inquera you need to register and they will mail you)
    Hope It Helped
    Thanks & Regards
    Simona Pinto

  • Random Record from a Query

    I have a page on my site that displays certain information in
    kind of a "feature" section, where it needs to query the database
    based on certain criteria and then display the data for just one of
    the records. The record should be different each time the page
    loads. So, if my query has 10 or 20 records, I just want to select
    one of them randomly and disply its data. What would be the best
    way to code such a scenario?
    Many thanks.

    first, a statement that contains "The record
    should be different each time the page loads" and "select one
    of them
    randomly and display its data" is a bit of a contradiction:
    you either
    display a random record or you control which record to
    display to make
    sure each page load displays a different one.
    if you just want a random record displayed (which means same
    record may
    be displayed on subsequent page loads) then how to do it
    depends on
    which database you are using, as cfSearching pointed out.
    here's a great place to look to sql statements for this for
    various db
    systems:
    http://www.petefreitag.com/item/466.cfm
    if you want to display a different record each page load, you
    need to
    keep track which records have already been displayed
    previously and
    display the next one in sequence. you could do this by
    storing the list
    of record ids in an application-scope variable, displaying
    the record
    with the first id and removing that id from the list of ids.
    when the
    list is empty, query the db for record ids again and make a
    list anew.
    hth
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • Exchange 2003 SMTP resolves to incorrect MX record for Outbound emails

    Starting October 2007, we have encountered numerous incidents where users complaint that they can not send emails to randomly with Relayed Denied error. 
    First we thought the problem is with the receipient servers, but after reviewing the SMTP log intensively, I have noticed that the SMTP service on Exchange Server 2003 SP2 tries to send out emails to wrong IP Addresses (instead of sending out to listed IP of MX record, it tries to send to primary domain IP address).
    To test further, we have changed the DNS server of the Exchange Server to public DNS service provided by the ISPs and still received same result.
    If the user tries to send the email again (from the bounced back message), it some times goes through.
    Has anyone know what the problem is?
    Have checked the server configuration, DNS configuration, ran all updates, and yet still same result.  Is one of the Microsoft Updates causing this issue?

    Here is the official explanation i got from MS, sounds like it is doing what they expect it to do.
    Problem Description
    When Exchange 2003 sends e-mail to the Internet using DNS to resolve external domain names a DNS query is done for the remote domain's MX records. In the event that the initial MX query returns a "server failure", Exchange 2003 will fall back to a DNS A record query. If this query is, in turn, successful and there is an A record for the domain in question that happens to be listening on port 25, Exchange will make a connection to that server. However, if this server does not relay, or accept e-mail for the intended domain a NDR will be generated with a 5.7.1, or
    5.5.0 error message.
    There are several domains that have A records that point to IP addresses that accept connections on port 25, but do not relay for the same name space:
    Eg: Mindspring.com; Earthlink.net
    Resolution
    Resolve the DNS resolution problems that are causing occasional MX record failures.
    Examples:
    1. The Exchange server has multiple default gateways set on a multi-homed server.
    This is not a recommended configuration and can cause a number of unexpected network problems. If the internal DNS server the internal NIC points to cannot resolve external DNS queries, this problem can occur.
    Action: remove the default gateway from one of the NICs.
    This doesn’t applies to us, as we don’t use Internal DNS
    2. If the Exchange server points to multiple DNS servers on TCP/IP properties, or on the SMTP Virtual Server properties, verify that each of these DNS servers will return MX records properly. If one of the DNS servers does not return DNS records consistently, rectify this problem.
    Action: remove this DNS server from the external DNS tab.
    Workaround:
    Bypass DNS by creating a SMTP connector with address space of <domain.com> and forward to smart host as the IP address the MX/A points to.
    Exchange Query Explained
    1. If Exchange finds the MX record(s) for a remote domain (through DNS query) it will not fall back to an A record query in the event the MX record (more precisely, the A record the MX record points to) is temporarily not responding on port 25. Instead, Exchange will try another MX record if one exists. If no other MX records exist and none are responding on port 25, the queue will go into a retry state for this remote domain. When that retry state has expired, Exchange will again attempt to resolve MX records for this domain, and so on.
    2. Exchange will fall back to an A record query for the remote domain in the event that no MX record can be found. This is not to say that the MX record does not exist - only that when Exchange issued a DNS query for the remote domain the DNS response was "server failure", which basically means no MX was found. So, the MX record may indeed exist, but Exchange simply could not find it through DNS resolution.
    3. Exchange then queries the A record and this happens to return a result. If the A record is listening on port 25, but does not accept mail for <domain.com> then we will get the NDR with 550 5.7.1 unable to relay (or some variation of this NDR error code) when Exchange connects and attempts to send the e-mail.
    So, the intermittent nature of the problem is caused by a failure to find the MX record and a success in finding A record. This can happen for a variety of reasons, but it boils down to flakey DNS resolution.
    For example:
    a. A bad DNS server listed as a forwader on the DNS server.
    b. A bad DNS server on the TCP/IP properties.
    c. A bad DNS server on the SMTP VS (external DNS servers)
    d. Multiple default gateways on Exchange (ie. multiple NICs on different networks, each NIC having a default GW)
    A netmon on Exchange will show the failed MX lookup and successful A record lookup; however, it may not be conclusive unless the "bad" DNS server is listed in the netmon trace. For example, if Exchange points to internal DNS server(s) for name resolution and these DNS servers service these DNS queries by Exchange, you may need a netmon on the DNS server(s) as well to determine which DNS server/Forwarder/etc is at fault.
    Regards,
    Shahul Hameed Dasthagir
    Support Engineer | Enterprise Communications Support 

  • Selecting Non repeatable random records

    HI all,
     I have 20 records in table. I want to get a random single  record from that table.And the main thing is
    if i having 20 records 1st time i'm getting a random record.the upcoming execution result that does not show previous random record .
    That is out of 20 records ,each time i want to select record that does not occur previously.so at 20 executions i have 20 result with non-repeatable.
    If i am confusing you,sorry for this.....pls help me to get a suffled record at each time
    note: i'm used NEWID() that gives random records but it occurs previously some time

    I cannot reproduce this :-)
    with
    [10] as (select 0 as c union all select 0),
    [11] as (select 0 as c from [10] as a, [10] as b),
    [12] as (select 0 as c from [11] as a, [11] as b),
    [13] as (select 0 as c from [12] as a, [12] as b),
    nums as (select top(20) row_number() over(order by c) as n from [13]),
    choice as (select top(1) n from nums order by checksum(newid()))
    select * from choice order by n 
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Since you don't allow emails any more – I suspect because of the numerous complaints with your service and the way you treat people that you don't want documented, I am calling and I want this call recorded for future reference. I have been a long time fa

    Since you don’t allow emails any more – I suspect because of the numerous complaints with your service and the way you treat people that you don’t want documented, I am calling and I want this call recorded for future reference.
    I have been a long time faithful customer of vzw and although the past year I have been late on payments many times and really couldn’t afford your exorbitant prices for services lots of other companies offer sometimes three times cheaper than what you charge, I have hung in there trying my best to meet my obligations.
    This month has been no exception. You don’t know the background; the whole story of people’s lives. I know you could care less because all you care about is the profit-the money that comes in.
    I was told when I agreed to pay my bill on the third per the recorded message that I had 14 days to pay…you cut me off anyway. The phones are not the tissue; your suspending my service means I cannot work. I may lose my job…how do you justify that? In any case? The least you could do would be to keep 4986 on and cut the phones off. But no. You refuse to compromise and meet the basic needs of your customer. What does that say about your company? I tried to call back on three separate occasions to tell you I couldn’t pay because of unexpected expenses but couldn’t get out of the automated system…sadly couldn’t get to a real person which also speaks volumes to me.
    All this tells me this is a company I don’t wish to be affiliated with any more. As soon as I can, I will discontinue service with you…I know you could care less. I will honor the remaining portion of the contract but that’s it. You don’t deserve my business. I am a good, hardworking person who, at the sacrifice of myself and my needs, always pays her bills…albeit late at times. I realize others tell you stories and lies to justify themselves. That’s not me. If you knew what I had been through the last 7 yrs you would marvel that I am  still on my feet…don’t judge too quickly. You could be wrong…and in my eyes you are by doing this to me.
    God will see us through this extremely scary time of that I have no doubt. No thanks to your company and lack of understanding and mercy. I am doing the best I can. Sadly you are not.
    See I have choices. MANY choices of providers for services you offer. I don’t have to be treated like this. I don’t have to succumb to your coldness and callousness. I intend to choose better (and cheaper). If your company doesn’t get the “people factor” back you will be sorry.

    Problem here is you admit you cannot afford the service.
    And you want to blame Verizon for losing a job because you have no cell phone.
    If your job depends on that phone I would pay it on time every time if you need a job to pay your bill.
    No other service is going to treat you any different. And if you cannot afford Verizon's monthly invoice how are you going to afford new devices, activation fees, possible security deposits on any other cellular carrier? You can't.
    Also if you made an arraignment to pay and then decide you cannot do so, why should Verizon extend you service or credit, or why is it you want to use the service and data and not pay for it as agreed.
    Get a prepay phone. Its evident the cost is too high for you to afford on post pay.
    Good Luck

  • SQL help: return number of records for each day of last month.

    Hi: I have records in the database with a field in the table which contains the Unix epoch time for each record. Letz say the Table name is ED and the field utime contains the Unix epoch time.
    Is there a way to get a count of number of records for each day of the last one month? Essentially I want a query which returns a list of count (number of records for each day) with the utime field containing the Unix epoch time. If a particular day does not have any records I want the query to return 0 for that day. I have no clue where to start. Would I need another table which has the list of days?
    Thanks
    Ray

    Peter: thanks. That helps but not completely.
    When I run the query to include only records for July using a statement such as following
    ============
    SELECT /*+ FIRST_ROWS */ COUNT(ED.UTIMESTAMP), TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY') + (ED.UTIMESTAMP/86400)), 'MM/DD') AS DATA
    FROM EVENT_DATA ED
    WHERE AGENT_ID = 160
    AND (TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY')+(ED.UTIMESTAMP/86400)), 'MM/YYYY') = TO_CHAR(SYSDATE-15, 'MM/YYYY'))
    GROUP BY TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY') + (ED.UTIMESTAMP/86400)), 'MM/DD')
    ORDER BY TO_CHAR((TO_DATE('01/01/1970','MM/DD/YYYY') + (ED.UTIMESTAMP/86400)), 'MM/DD');
    =============
    I get the following
    COUNT(ED.UTIMESTAMP) DATA
    1 07/20
    1 07/21
    1 07/24
    2 07/25
    2 07/27
    2 07/28
    2 07/29
    1 07/30
    2 07/31
    Some dates donot have any records and so no output. Is there a way to show the missing dates with a COUNT value = 0?
    Thanks
    Ray

  • How do I get ALL the info records for a materials plants using an SAP FM?

    I need to get all of the info records from the EINE table for a material - all of its sites (plants, we are using SAP retail).
    The problem is this:  I call the FM MD_INFORECORDS_READ - here is the code for my call:
    CALL FUNCTION 'MD_INFORECORDS_READ'
              EXPORTING
                imatnr               = t_output_data-article <-- the material number
                iliefnr              = lv_eina_key < -- see below on how I get this
              importing
                eeine                =
              TABLES
                exp_eina             = it_eina
                exp_eine             = it_eine
              EXCEPTIONS
                no_eina_record_found = 2
                no_eine_record_found = 3.
    lv_eina_key is taken from this call:
    SELECT SINGLE altkn INTO lv_vendor_no
            FROM lfb1
            WHERE lifnr = lv_site (plant)
            AND bukrs = t_output_data-company_code.
    The probelm is it only returns the first record it finds for each site.  There could be multiple info records, each one based a a different Valid From date for each site.  I need either ALL of the EINE records for each site OR the most current one
    I know I am not using ALl of the parms in the FM - but are there  maybe there are other ones should I be using.
    Perhaps there is there another FM I should be using - cause I do not have the info record number to pass. 
    Thanks.
    Scott

    Never mind - the FM does work - this was bad data.

  • Report of result recording for multiple batches in a given time span .

    Dear team ,
    I am looking for a standard SAP report that gives the details of result recording with all the characteristics for mulitple batches in a given span of time . The MICs will show the actual values recorded for each of the batches.
    The colums may be like this
    material/batche/lot/quanity/mic1 value/mic2 value/mic 3 value...........
    A standard report is prefered and we would also like to have a trend analysis done for the batches .
    Looking forward to hearing from you .
    Ram

    Thanks for the answer Firefighter.... cheked the t code and seems to be useful . But I would like to have the report in the folowing format . Kindly guide.
    SN     MATERIAL     BATCH     INSPECTION LOT      QUANTITY     CHARACTERISTIC 1     CHARACTERISTIC 2     3     4
    Ram

Maybe you are looking for

  • Settting up network with mac and windows

    If its possible to set up a network using a  1 imac and 3 windows xp computers,can sombody tell me how to do this or point me in the right direction for instructions on how to do it? im looking but so far im not finding the right stuff. thanks

  • Statistical posting to WBS

    Hi PS Gurus, Good day. Can anyone advise how to remove statistical actual posting to WBS? Our scenario is, we have actual amount of -30000 to WBS XXXX. After settlement to AUC CJI3 now shows -60000 as actual amount. When we checked in table RPSCO the

  • Can't use Overall Release for Purchase Requisitions

    I have two groups, AA and ZZ.  Each group has it's own Class. Group AA uses Cost Center Class (CN)  (uses Characteristics Cost Center and Line Amount) Group ZZ uses Order Class (OC) (uses Characteristic Order) I have built one and only one Release St

  • Updated to OS X Maverick and now the keyboard doesn't work. Anyone with similar problem and a solution?

    I recently updated to the OS X Maverick  and the keyboard   just stopped functioning after working fine the first day. Pressing any key just produces a ding, but no mark. Pressing the return key produces a black dot as if you were putting in a confid

  • Workaround for TestConnectionsOnReserve

    We have a very database dependent architecture where a cluster of weblogic servers talk to one database. Since we don't want to recycle our weblogic servers when the database would crash, we set the testConnectionsOnReserve to "true". This increases