Get Oracle SID in PL/SQL with out a query

Hi,
Is there any way where I can get ORACLE SID value in the PL/SQL layer with out actually querying v$database tables.
I am looking for key word in PL/SQL which stores currect SID name, just like how keyword 'user' stores the current user who has logged in.
Thanks
Sree

Hi,
Is there any way where I can get ORACLE SID valuein
the PL/SQL layer with out actually querying
v$database tables.
I am looking for key word in PL/SQL which stores
currect SID name, just like how keyword 'user'stores
the current user who has logged in.Subtle correction ...
[url=http://download-east.oracle.com/docs/cd/B19306_01
/appdev.102/b14261/subprograms.htm#sthref1776]'user'
is a built-in function provided by Oracle. Why don't you create your own function to perform the
Select?
I know I can create a function but, I dont want to read the table everytime it is called. Knowing that Database sid is going to be constant for next couple of years.
The procedure in which I am going to use database sid is called for almost every transaction in the database. I am trying to avoid IO operation for a constant value. I cant declare a global constant as it is going to be different for each environment Dev, QA, Production etc..and we are looking to deploy same code for all the environments. We are anticipating to have multiple databases for production too.

Similar Messages

  • How do i get through find my i phone with out knowing the past apple id or password?

    how do i get through find my i phone with out knowing the past apple id or password?

    If the iPhone has Activation Lock - that is, it's asking for the previous owner's Apple ID and password to activate the device - then you will need that information, or you'll need to get the previous owner to remove the device from his/her iCloud account:
    http://support.apple.com/kb/PH2702
    If you can't reach the previous owner or he/she is unwilling to cooperate, then the device is unusable by you. If you recently purchased the iPhone, return it for a refund if you can.
    Regards.

  • HT1146 I wiped out my mail icon on my desktop. I can't find awat to restore it so I can get to my emails. any suggestions with out having to reload my OS?

    I wiped out my mail icon in my dock, I guess I deleted it totally? I can not locate it anywhere. Does anyone know how to recreate the mail icon so I can get to my incoming mail? With out having to restore my OS?
    Thanks,

    Yes, I think my GF some dragged the mail icon into the trash bin and emptied the trash. because the bin has nothing in it? I think that could be why i can't find anything of a mail folder or icon?
    Thanks,

  • Hi!!! I'm new to apple, can I get an American apple I'd with out a credit card?

    Hi!!! I'm new to apple, can I get an American apple I'd with out a credit card?

    If you mean that you wish to purchase from the US iTunes Store, you cannot. That requires not only a US-based payment method (US credit card or US prepaid iTunes card) but also that you be physically present in the US.
    Regards.

  • To get the SID in PL/SQL

    Hi Gurus,
    Can you please help me on how to get the SID (Connection_string) from PL/SQL.
    Thanks,

    Hi,
    I am writing to file using UTL file using an Oracle Stored procedure.
    The path name changes according to the environment where it gets executed.
    aotdev Development instance
    aotuat QA instance
    aotnycp Production instance
    If it is executed in Dev the file should be generated in /apps/xopdev/out.
    If it is executed in QAthe file should be generated in /apps/aotuat/out.
    If it is executed in Dev the file should be generated in /apps/aotnycp/out.
    So can you please help me with this?

  • How to get movie files on my iPad with out a computer

    Can you please let me know if there is any way that I can put my movie files onto my iPad 2 with out having a lap top or a computer with me when I head order sea's. Please email the response to my [email protected] address. I am trying to find a way that I can add my movie files onto my iPad when I do not have access to a computer but I have access to the Internet.
    THanks
    Dave

    Where are these movie files now? You can't copy DVD's directly onto it, so you'll need some kind of computer to access them to get them on the iPad.
    If you can get them into a cloud storage app such as Dropbox, you can then view them on your iPad. 

  • Can I Get a I Phone 4s unlocked with out Jailbreak if so how

    Can I Get a New I Phone 4s unlocked with out Jailbreak if so how,it is locked to a Network and I want it sim free.

    Only Apple retail stores sell genuinely unlocked GSM iPhone 4S in US and elsewhere
    Any other source will be locked or tampered with to unlock it

  • How to get the inserted row primary key with out  using select statement

    how to return the primary key of inserted row ,with out using select statement
    Edited by: 849614 on Apr 4, 2011 6:13 AM

    yes thanks to all ,who helped me .its working fine
    getGeneratedKeys
    String hh = "INSERT INTO DIPOFFERTE (DIPOFFERTEID,AUDITUSERIDMODIFIED)VALUES(DIPOFFERTE_SEQ.nextval,?)";
              String generatedColumns[] = {"DIPOFFERTEID"};
              PreparedStatement preparedStatement = null;
              try {
                   //String gen[] = {"DIPOFFERTEID"};
                   PreparedStatement pstmt = conn.prepareStatement(hh, generatedColumns);
                   pstmt.setLong(1, 1);
                   pstmt.executeUpdate();
                   ResultSet rs = pstmt.getGeneratedKeys();
                   rs.next();
    //               The generated order id
                   long orderId = rs.getLong(1);

  • Cannot get Oracle sequence to be used with SQL Loader direct path load.

    I attempted to load approximately 3 million rows from a flat file into a 10g database using SQL Loader direct path load. In order to generate a primary key for each of these rows I used a simple SQL expression which gets the next number of an Oracle sequence and assigned that to my primary key column inside the control file. The strange thing is no primary key was generated for each of these columns as I see the sequence was not advanced. Furthermore when I try to run a query to find the count on those rows which have this column as NOT NULL ,I get the total of all the rows even though on inspection this column is empty in each of the rows.
    As far as I know, in the control file for a direct path load I am able to use a SQL Expression that returns simple scalar data which a NEXTVAL on a sequence does. (Oreilly Oracle SQL Loader The Definitive Guide p.184)
    Does anybody why my primary key was not generated and furthermore why is this column in a query appear to be NOT NULL when in fact it has nothing in it?

    Daniel,
    I appreciate your response alot.
    Now a follow on. You say that SQL*Loader is the fastest way to get data into Oracle Spatial even though the conventional path. How does SQL*Loader do this? Doesn't it use OCI?
    I just can't help but think that coverting my data to SQL*Loader format, and then having it parse it and send it to the database in some form must be slower than me just sending whatever SQL Loader sends to the DB myself using OCI. Am I missing something?
    The SQL Loader documentation seems to suggest that SQL*Loader just turns the input into alot of INSERT stateemnts. If so, can't I just do this?
    My performance with OCI and INSERT statements isn't very good, but I believe I am doing one transaction per insert. Might I be as well off to concentrate on fine tuning my OCI based code using INSERTs?
    I will actually do some time tests myself, but I would appreciate your opinion.
    Once again thanks for the great info you have provided.

  • Can we create LOV using free hand sql with out hardcoding

    Hi gurus,
    Dear All,
    For some of the reporst we don't have universe, so we use to get the report with the help of free hand sql,
    but here I have to hardcode the list of values by using @prompt, but instead of hardcoding is there any ways to get the list of vaues  by using @prompt, if then can any one help me out.

    Yes and no.
    When we use a LOV in a universe, the SQL is generated from the object definition. With Free Hand SQL (FHS) there is no universe. However...
    If you create a very simple universe to host your LOV, and then reuse the same prompt text in your FHS then you can fake the LOV. This is not a great solution, but to be honest, FHS is never really a solution that I would consider. You might consider using Crystal to replace Deski in these cases.

  • Problematic sql with outer join

    There is one sql statement:
    INSERT INTO XXOM_SSC_TEMP_MMI_GTEMP (HEADER_ID, LAST_UPDATE_DATE) SELECT DISTINCT OOH.HEADER_ID, XSOH.LAST_UPDATE_DATE FROM OE_ORDER_HEADERS_ALL OOH INNER JOIN (SELECT TRANSACTION_TYPE_ID FROM OE_TRANSACTION_TYPES_TL OTT WHERE OTT.NAME NOT IN ('ORDER_RMA_MMI' ) AND OTT.LANGUAGE = 'US') OTT ON (OTT.TRANSACTION_TYPE_ID = OOH.ORDER_TYPE_ID) LEFT OUTER JOIN XXOM_3LP_SYM_ORA_ORDER_HDR XSOH ON (TO_CHAR (XSOH.ORDERTYPE) = SUBSTR ( OOH.ORIG_SYS_DOCUMENT_REF, 1, INSTR (OOH.ORIG_SYS_DOCUMENT_REF, '-', 1) - 1) AND TO_CHAR (XSOH.ORDERNBR) = SUBSTR ( OOH.ORIG_SYS_DOCUMENT_REF, INSTR (OOH.ORIG_SYS_DOCUMENT_REF, '-', 1) + 1) AND (XSOH.LAST_UPDATE_DATE >= :B1 )) INNER JOIN OE_ORDER_LINES_ALL OOL ON (OOH.HEADER_ID = OOL.HEADER_ID AND OOL.SHIP_FROM_ORG_ID = :B2 ) WHERE OOH.BOOKED_FLAG = 'Y' AND XSOH.ORG_ID = OOH.ORG_ID
    Porblematic query has insufficient and sub-optimal join conditions which makes it more expensive.One has recommended to remove one unnecessary outer join from the query and also fix the join to pick index.
    But how can we remove outer join and in place of that what should we write.

    Your code is unreadable, man! Surely your boss does not let you produce stuff like that? Format it. Because I'm a helpful person, I just put it through the formatter on http://www.dpriver.com/pp/sqlformat.htm :INSERT INTO xxom_ssc_temp_mmi_gtemp
                (header_id,
                 last_update_date)
    SELECT DISTINCT OOH.header_id,
                    XSOH.last_update_date
    FROM   oe_order_headers_all OOH
           inner join (SELECT transaction_type_id
                       FROM   oe_transaction_types_tl OTT
                       WHERE  OTT.name NOT IN ( 'ORDER_RMA_MMI' )
                              AND OTT.LANGUAGE = 'US') OTT
                   ON ( OTT.transaction_type_id = OOH.order_type_id )
           left outer join xxom_3lp_sym_ora_order_hdr XSOH
                        ON ( To_char (XSOH.ordertype) =
                             Substr (OOH.orig_sys_document_ref,
                             1,
                             Instr (OOH.orig_sys_document_ref,
                             '-', 1)
                             - 1)
                             AND To_char (XSOH.ordernbr) =
                                 Substr (OOH.orig_sys_document_ref,
                                 Instr (OOH.orig_sys_document_ref, '-', 1) + 1
                             AND ( XSOH.last_update_date >= :B1 ) )
           inner join oe_order_lines_all OOL
                   ON ( OOH.header_id = OOL.header_id
                        AND OOL.ship_from_org_id = :B2 )
    WHERE  OOH.booked_flag = 'Y'
           AND XSOH.org_id = OOH.org_id

  • How. Do I get free apps on my iPad with out putting in  credit card info?

    Iam trying to get free apps without putting in a credit card how do I that please help!

    You can set up an account with the payment type of None.  If the current Apple ID you want to use was created more than 48 hours ago, you won't be able to change the payment type to None and will need to either create a new Apple ID account (using an previously unused email address) or provide a valid payment method to the account such as a credit/debit card or iTunes gift card.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    B-rock

  • How do I get my music off my ipod with out getting rid of the music from my oter computer?

    I am trying to get my music from my broken computer that is on my ipod nano to my parents computer is there any way to do this?

    Hey Rjd1988,
    Thanks for the question. The following resource outlines what you can transfer from your iPod to your computer:
    iTunes: Transferring media from your iPhone, iPad, iPod touch, or iPod
    http://support.apple.com/kb/HT1209
    Thanks,
    Matt M.

  • How do I get Server Side Includes to work with the .html extension?

    Do I have to rename the files with .shtml? This is an existing web site that is probably NOT running on an OS X web server, that I want to load onto my Snow Leopard server as a testing environment before uploading to the live site.

    Do I have to rename the files with .shtml? This is an existing web site that is probably NOT running on an OS X web server, that I want to load onto my Snow Leopard server as a testing environment before uploading to the live site.

  • Dynamic orderby clause for multiple columns with out Dynamic query

    Hi,
            I've a query like
    "select  * from tablename order by column1,column2,column3,column4,column5,column6"
    in the above query the order by column will be dynamically changed. The query is placed in a stored procedures and the order by column will come by parameter.
       For ex: @orderbycol = column2,column1,column3,column4,column5,column6
                                         or
                    @orderbycol = column3,column2,column1,column4,column5,coumn6
    How can we manage the order by clause as dynamically without go to dynamic query.

    ORDER BY CASE @sortcol1
                 WHEN 'col1' THEN col1
                 WHEN 'col2' THEN col2
             END,
             CASE @sortcol2
                 WHEN 'col1' THEN col1
                 WHEN 'col2' THEN col2
             END,
    Note: these CASE expressions assumes that all columns have the same data type.
    You could consider sorting in the presentation layer instead.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for