How to use dbms_random in TimesTen

Hi, All,
dbms_random is the supplied procedure in TimesTen 11.2.1,
but I failed with the following select statement:
select dbms_random.value from dual; or select sys.dbms_random.value from dual
the error I got is "1024: Referenced table DBMS_RANDOM not in FROM list"
But all of the query is OK for OracleDB.
How can I use dbms_random in TimesTen?
Thanks
Edited by: user536764 on 2011-1-5 上午8:24

In pl/sql work fine
declare
v number;
begin
v := dbms_random.value(1,100);
dbms_output.put_line(v);
end;
85.95011054036622138729731389231348690891

Similar Messages

  • How to use DBMS_RANDOM

    I use The ORACLE version is 8.05 and the OS is win2000 server.
    I want to know execute DBMS_RANDOM, it must be installed what
    associated packages? And before this i run the script
    dbmsoctk.sql and dbmsrand.sql and grant execute privilege to the
    user, Why when I Execute the procedure randomdata the ORACLE
    tell me the package body "SYS.DBMS_CRYPTO_TOOLKIT" not exist?
    Urgent! Pls help me!

    If you can find later versions of dbmsrand.sql, they don't
    require that package. Or you could use
    http://burtleburtle.net/bob/other/rnd.sql
    which is similar to the later versions.

  • How to use Rand()  (ANSI Function)as such in Oracle

    I need to use Rand() function as such in ANSI format in oracle how to use it.
    I don't want to use the available DBMS_RANDOM.RANDOM(), i want to use ANSI Function as such in Oracle
    Please help me

    I don't want to use the available DBMS_RANDOM.RANDOM()Whats wrong with dbms_andom?
    In any case you can simply write a function wrapper to have same functionality as rand():
    SQL> create or replace function rand (max_val int default 32767)
      return int
    as
    begin
      return dbms_random.value (0, max_val);
    end rand;
    Function created.
    SQL> select rand(50) from dual
           RAND(50)
                 44
    1 row selected.

  • How to use date column index

    Hi,
    Why is that I got different results for my queries?
    Note that emp_date is indexed, so i dont want to use
    a function to it.
    QUERY1(full table scan)
    SELECT COUNT(*) FROM EMP WHERE TRUNC(EMP_DATE)=TRUNC(SYSDATE-30); (RESULT=8,842)
    QUERY2
    SELECT COUNT(*) FROM EMP WHERE
    EMP_DATE >=(SYSDATE-30) and EMP_DATE < (SYSDATE-30); (RESULT=0)
    QUERY3
    SELECT COUNT(*) FROM EMP WHERE
    EMP_DATE BETWEEN TRUNC(SYSDATE-30) and TRUNC(SYSDATE-30); (RESULT=2,100)
    Please help me how to use indexed date column...

    > Why is that I got different results for my queries?
    Because your queries are different.
    1) This one selects all records on 20 october, regardless of their time component
    2) This one selects all records with an emp_date at least being 20 october 14:56:30 AND being smaller than 20 october 14:56:30. No record will ever satisfy this condition.
    3) This one selects all records on 19./20 october at midnight 00:00:00
    Please see this example:
    SQL> create table myemp (emp_date)
      2  as
      3   select trunc(sysdate) - 30 +
      4          case
      5          when level <= 2100 then 0
      6          when level <= 8842 then dbms_random.value(1,86399)/86400
      7          else 2
      8          end
      9     from dual
    10  connect by level <= 100000
    11  /
    Tabel is aangemaakt.
    SQL> create index i1 on myemp(emp_date)
      2  /
    Index is aangemaakt.
    SQL> exec dbms_stats.gather_table_stats(user,'myemp',cascade=>true)
    PL/SQL-procedure is geslaagd.
    SQL> set autotrace on explain
    SQL> select count(*) from myemp where trunc(emp_date)=trunc(sysdate-30)
      2  /
                                  COUNT(*)
                                      8842
    1 rij is geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=88 Card=1 Bytes=8)
       1    0   SORT (AGGREGATE)
       2    1     TABLE ACCESS (FULL) OF 'MYEMP' (Cost=88 Card=1000 Bytes=
              8000)
    SQL> select count(*) from myemp where
      2  emp_date >=(sysdate-30) and emp_date < (sysdate-30)
      3  /
                                  COUNT(*)
                                         0
    1 rij is geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=8)
       1    0   SORT (AGGREGATE)
       2    1     FILTER
       3    2       INDEX (RANGE SCAN) OF 'I1' (NON-UNIQUE) (Cost=4 Card=2
              50 Bytes=2000)
    SQL> select count(*) from myemp where
      2  emp_date between trunc(sysdate-30) and trunc(sysdate-30)
      3  /
                                  COUNT(*)
                                      2100
    1 rij is geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=8)
       1    0   SORT (AGGREGATE)
       2    1     FILTER
       3    2       INDEX (RANGE SCAN) OF 'I1' (NON-UNIQUE) (Cost=4 Card=2
              50 Bytes=2000)
    > Please help me how to use indexed date column...
    Use this query instead:
    SQL> select count(*)
      2    from myemp
      3   where emp_date between trunc(sysdate)-30 and trunc(sysdate)-29 - interval '1' second
      4  /
                                  COUNT(*)
                                      8842
    1 rij is geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=8)
       1    0   SORT (AGGREGATE)
       2    1     FILTER
       3    2       INDEX (RANGE SCAN) OF 'I1' (NON-UNIQUE) (Cost=4 Card=2
              50 Bytes=2000)Regards,
    Rob.

  • How to use temporary database?

    hi
    i am using timesten as cachedb for oracle database。i have some problem about how to use temporary database?
    1) what's the difference between temporary and non-temporary database,if i use awt cache group,then timesten will automatically replicate all change to oracle database , even if timesten crashed,i can set up another timesten quickly,no data loss?
    2)since all data is in oracle database,does timesten‘s transaction log and checkpoint file useful ? does timesten need backup ?

    Temporary databases have very limited usefullness; you can't use them with replication or caching for example. They are a very 'niche' use case; I'd recommend that you avoid them for mainstream use.
    TimesTen checkpoiint and transaction log files are always required (except for Temporary database which do not have checkpoint files but do have log files).
    Chris

  • How to create database in timesten?

    Please let me know how to create database in timesten as we create in Oracle 10g named orcl
    Please guide in detail
    Thanks.

    Hi!
    You can use TimesTen in standalone mode instead of Cache connect to Oracle.
    If you have deployed TimesTen on Linux then you should make DSN in sys.odbc.ini which is located in info folder of TimesTen. If you are using Windows then you can use ODBC utility in control panel.
    You can see the documentation of TimesTen for more detailed information.
    /Ahmad

  • How to use one email adress for multiple recipients

    Hello,
    I'd like to know how to use one email adress for multiple recipients. 
    this would be very useful or projects. for example;
    if i send one mail to [email protected], all people in this project get an email.
    I will add the people in this project myself. 
    I know it is possible, but I don't know how to do it ;-)
    please help me! 

    Hope this help.
    _http://technet.microsoft.com/en-us/library/cc164331(v=exchg.65) .aspx

  • Can't figure out how to use home sharing

    Since the latest couple iTunes updates, my family and I can not figure out how to use home sharing. Everyone in our household has their own iTunes, and for a long time we would just share our music through home sharing. But with the updates, so much has changed that we can no longer figure out how to use it.
    I have a lot of purchased albums on another laptop in the house, that im trying to move it all over to my own iTunes, and I have spent a long time searching the internet, and everything. And I just can't figure out how to do it. So.... how does it work now? I would really like to get these albums from my moms iTunes, onto mine. I would hate to have to buy them all over again.
    If anyone is able to help me out here, that would be great! Thanks!

    The problem im having is that after I am in another library through home sharing, I can't figure out how to select an album and import it to my library. They used to have it set up so that you just highlight all of the songs you want, and then all you had to do was click import. Now I don't even see an import button, or anything else like it. So im lost... I don't know if it's something im doing wrong, or if our home sharing system just isn't working properly.
    Thanks for the help.

  • How to use the same POWL query for multiple users

    Hello,
    I have defined a POWL query which executes properly. But if I map the same POWL query to 2 portal users and the 2 portal users try to access the same page simultaneously then it gives an error message to one of the users that
    "Query 'ABC' is already open in another session."
    where 'ABC' is the query name.
    Can you please tell me how to use the same POWL query for multiple users ?
    A fast reply would be highly appreciated.
    Thanks and Regards,
    Sandhya

    Batch processing usually involves using actions you have recorded.  In Action you can insert Path that can be used during processing documents.  Path have some size so you may want to only process document that have the same size.  Look in the Actions Palette fly-out menu for insert path.  It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..

  • How to use airport time capsule with multiple computers?

    I'm sure there are some thread about this but i couldn't find it... so sorry for that but hear me out! =)
    I bought the AirPort Time Capsule to back up my MBP
    And so i did.
    then i thought "let give this one a fresh start" so i erased all of it with the disk utility and re-installed the MBP from the recovery disk.
    I dont want all of the stuff i backed up just a few files and some pictures so i brought that back.. so far so good.
    Now i want to do a new back up of my MBP so i open time machine settings, pick the drive on the time capsule and then "Choose" i wait for the beck up to begin, and then it fails.  It says (sorry for my bad english, im swedish haha) "the mount /Volume/Data-1/StiflersMBP.sparsebundle is already in use for back up.
    this is what i want:
    i want the "StiflersMBP.sparsebundle" to just be so i can get some stuf when i need them. it's never to be erased.
    i want to make a new back up of my MBP as if it's a second computer...
    so guys and girls, what is the easiest and best solution?
    Best regards!

    TM does not work like that.
    If you want files to use later.. do not use TM.
    Or do not use TM to the same location. Plug a USB drive into the computer and use that as the target for the permanent backup.
    Read some details of how TM works so you understand what it will do.
    http://pondini.org/TM/Works.html
    Use a clone or different software for a permanent backup.
    http://pondini.org/TM/Clones.html
    How to use TC
    http://pondini.org/TM/Time_Capsule.html
    This is helpful.. particularly Q3.
    Why you don't want to use TM.
    Q20 here. http://pondini.org/TM/FAQ.html

  • How to use multiple ipods on one account

    I have an Ipod classic and just bought my sons two nano's how do I use these on the same account without changing my account info?

    Take a look here:
    How to use multiple iPods with one computer
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Discussions page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums, in the User Tips Library and in the Apple Knowledge Base before you post a question.
    Regards.

  • How to use a Table View in AppleScriptObjC

    How can I use a table view and add data to it? And how can I display a button cell and image cell in the table? Thanks.

    Hi all,
    Actually i need some more clarification. How to use the same select statement, if i've to use the tabname in the where clause too?
    for ex : select * from (tab_name) where....?
    Can we do inner join on such select statements? If so how?
    Thanks & Regards,
    Mallik.

  • How to use '|' delimited as seprator in GUI_DOWNLOAD ? Plz suggest me ,,

    how to use '|' delimited as seprator in GUI_DOWNLOAD ? Plz suggest me ,,
    i want the output should be seprated by '|' delimited when i download the file.

    Hi,
    We will pass the seperator to the WRITE_FIELD_SEPARATOR parameter as
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = v_file
    write_field_separator = '|'
    TABLES
    data_tab = itab[] . "Our internal talbe filled with data
    Re: Why Function GUI_DOWNLOAD can create XML file but not a flat file?
    Award points if useful
    Thanks,
    Ravee...

  • ** How to use TO_DATE function in Stored Proc. for JDBC in ABAP-XSL mapping

    Hi friends,
    I use ABAP-XSL mapping to insert records in Oracle table. My Sender is File and receiver is JDBC. We use Oracle 10g database. All fields in table are VARCHAR2 except one field; this is having type 'DATE'.
    I use Stored procedure to update the records in table. I have converted my string into date using the Oracle TO_DATE function. But, when I use this format, it throws an error in the Receiver CC. (But, the message is processed successfully in SXMB_MONI).
    The input format I formed like below:
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">
    Value in Payload is like below.
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">TO_DATE('18-11-1991','DD-MM-YYYY')</X_EMP_START_DT>
    Error in CC comes as below:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_EMP_DETAILS' (structure 'STATEMENT'): java.lang.NumberFormatException: For input string: "TO_DATE('18"
    Friends, I have tried, but unable to find the correct solution to insert.
    Kindly help me to solve this issue.
    Kind Regards,
    Jegathees P.
    (But, the same is working fine if we use direct method in ABAP-XSL ie. not thru Stored Procedure)

    Hi Sinha,
    Thanks for your reply.
    I used the syntax
    <xsl:call-template name="date:format-date">
       <xsl:with-param name="date-time" select="string" />
       <xsl:with-param name="pattern" select="string" />
    </xsl:call-template>
    in my Abap XSL.  But, its not working correctly. The problem is 'href' function to import "date.xsl" in my XSLT is not able to do that. The system throws an error. Moreover, it is not able to write the command 'extension-element-prefixes' in my <xsl:stylesheet namespace>
    May be I am not able to understand how to use this.
    Anyway, I solved this problem by handling date conversion inside Oracle Stored Procedure. Now, its working fine.
    Thank you.

  • Sender Mail Adapter - S/MIME - How to use it?

    Hi guys,
    I am trying to figure out how to use the S/MIME security parameter of the Sender Mail Adapter in PI 7.1.
    Could anyone point me to some useful documentation/examples/blogs ?
    Or perhaps explain what steps are involved when configuring this parameter?
    We are pulling emails from an Microsoft Exchange server.
    Many thanks,
    Aldo

    First of all one sender mail adapter has to be tight with a specific sender email address.
    The email has to be decrypted as whole, you cannot decrypt parts of it.
    Then you store certificates to secure store in J2EE server and point to it in send agreement, this should be equal to HTTPS setup
    Check security guide:
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/f7/c2953fc405330ee10000000a114084/frameset.htm

Maybe you are looking for

  • Change Subject Line on received mails

    Trying to change the subject line on a received mail. Many mails do not have a correct subject and i want to change the subject line to meet my needs in my folders. Any solution? Thanks,

  • Some Internet hypertext links or pop-ups not reacting

    Hi, Please, please I really need some help. I am about to throw Windows Vista and my Toshiba out the window!! For whatever reason some internet links that I try and click on - from trusted sights just don't work - I get absolutely no reaction from my

  • DVD - Fails After Burn

    Please help, I have tried two DVDr's now and the same problem. I have put together a dvd with slideshows created in idvd, added music from itunes to the 4 chapters, plus the main title screen. The project info is as follows. 3.8mb of 4.7, so there is

  • Jdev too slow.

    hi experts, am using jdev 11.1.1.5.0 using adfbc. am using windows7 ultimate service pack1. processor : Intel(R) Core(TM)2 Duo CPU E7400 @2.80GHZ Installed memory(RAM) 4.00gb(2.99 gb usable) System type: 32-bit Operating System. 2months backs it fine

  • Help! Colours are all washed out

    Hi Folks, I have an LG Flatron M2380 DF monitor/tv which I have calibrated with a Pantone Huey Pro to D65 colour temp and 2.20 gamma. My photoshop CS5 colour settings are set shown below. The pictures look great on the screen but if I print on my Eps