Package -  using procedure names and variables

I know that having created a package I can call the procedures using the form PACKAGE_NAME.PROCEDURE_NAME --
However, for speed and clarity of code is there a way to 'open' the package once and then simply refer to the PROCEDURE_NAME ???
This would be a sort of temporary synonym.
Thanks

You do not need to refer to qualify a procedure with the package name within the package, otherwise you must use the full package.prodedure name. So if package :pkg1 contains procedures A & B, then A can simply refer to B and vice versa, but from another package you would have to call pkg1.B.

Similar Messages

  • 'use dynamic name' and 'caching properites' options for alias table...

    Hello everybody,
    can anybody please explain 'use dynamic name' and 'caching properites' options for alias tables...
    Thanks...
    eagerly waiting for a response..
    Vijay

    You want to create dynamic target table name right?
    You can refresh a variable like #GET_SESSION
    #GET_SESSION= SELECT <%=odiRef.getSession("SESS_NAME")%> FROM DUAL
    My tmp table name like TMP_#GET_SESSION
    then in your package refresh #GET_SESSION variable and you can use it.
    I hope this can be helpful
    Thanks

  • Find package using program name/FM name.

    Hi,
    I want to find package using program name/FM name.
    Thanks,
    Amol

    open se38
    give program name and GOTO -> Attributes
    or  for forms
    open se71 and give formname and goto-> attributes
    u can findout package name.
    Regards,
    Ajay

  • How to put the column name and variable value in the alert message.

    Dear,
    how can i put the column name and variable value in the alert message text. i want to display an alert which tell the user about the empty textboxes. that these textboxes must be filled.
    Regards:
    Muhammad Nadeem
    CHIMERA PVT. LTD.
    LAHORE
    [email protected]

    Hello,
    The name of the item that fires the current trigger is stored in the :SYSTEM.TRIGGER_ITEM system variable.
    The value contained in this item can be retrived with the Name_In() built-in
    value := Name_In( 'SYSTEM.TRIGGER_ITEM') ;
    LC$Msg := 'The item ' || :SYSTEM.TRIGGER_ITEM || ' must be entered' ;
    Set_Alert_Property('my_alert_box', ALERT_MESSAGE_TEXT, LC$Msg ) ;
    Ok := Show_Alert( 'my_alert_box' ) ;
    ...Francois

  • JAXB 2.0 with JXDM gives error.  Use @XmlType.name and @XmlType.namespace

    Hi,
    I am getting the below error for JXDM when using. It was mentioned in http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302524 that it is fixed. Still getting this error.
    a) Appreciate if anyone can tell how to use the bug fix b20 that is mentioned in the above? I downloaded the latest jaxb 2.0 from this site and also from the jaxb RI(Reference Implementation and tried both).
    b) Is there any workaround to get through this?
    Will appreciate if any one can give advise on this.
    ************** Here is the error message ******************
    There was this problem creating a context com.sun.xml.bind.v2.runtime.IllegalAnn
    otationsException: 1 counts of IllegalAnnotationExceptions
    Two classes have the same XML type name "usStateCodeType". Use @XmlType.name and
    @XmlType.namespace to assign different names to them.
    this problem is related to the following location:
    at gov.ojp.it.jxdm.usps_states._1.USStateCodeType
    at protected gov.ojp.it.jxdm.usps_states._1.USStateCodeType gov.
    ojp.it.jxdm._3_0_2.proxy.usps_states._1.USStateCodeType.value
    at gov.ojp.it.jxdm._3_0_2.proxy.usps_states._1.USStateCodeType
    at protected gov.ojp.it.jxdm._3_0_2.proxy.usps_states._1.USState
    CodeType generated.CjsAddressType.locationStateCodeUSPostalService
    at generated.CjsAddressType
    at protected java.util.List generated.CjsPersonType.personAddres
    s
    at generated.CjsPersonType
    at protected generated.CjsPersonType generated.CjsSuspectType.su
    spectPerson
    at generated.CjsSuspectType
    at protected generated.CjsSuspectType generated.CjsReportType.su
    spect
    at generated.CjsReportType
    at public generated.CjsReportType generated.ObjectFactory.create
    CjsReportType()
    at generated.ObjectFactory
    this problem is related to the following location:
    at gov.ojp.it.jxdm.fips_5_2._1.USStateCodeType
    at protected gov.ojp.it.jxdm.fips_5_2._1.USStateCodeType gov.ojp
    .it.jxdm._3_0_2.proxy.fips_5_2._1.USStateCodeType.value
    at gov.ojp.it.jxdm._3_0_2.proxy.fips_5_2._1.USStateCodeType
    at protected java.util.List gov.ojp.it.jxdm._3_0.AddressType.loc
    ationStateCodeFips52Alpha
    at gov.ojp.it.jxdm._3_0.AddressType
    at protected java.util.List gov.ojp.it.jxdm._3_0.LocationType.lo
    cationAddress
    at gov.ojp.it.jxdm._3_0.LocationType
    at protected java.util.List gov.ojp.it.jxdm._3_0.OrganizationTyp
    e.organizationLocation
    at gov.ojp.it.jxdm._3_0.OrganizationType
    at protected java.util.List gov.ojp.it.jxdm._3_0.BookingType.boo
    kingAgency
    at gov.ojp.it.jxdm._3_0.BookingType
    at generated.CjsBookingType
    at public generated.CjsBookingType generated.ObjectFactory.creat
    eCjsBookingType()
    at generated.ObjectFactory
    Check this out
    Exception in thread "main" java.lang.NullPointerException
    at bpd.MakeNewItem.marshallItem(MakeNewItem.java:119)
    at bpd.MakeNewItem.persistItem(MakeNewItem.java:112)
    at bpd.MakeNewItem.<init>(MakeNewItem.java:31)
    at bpd.MakeNewItem.main(MakeNewItem.java:137)
    ********************End of error message ******************
    Thanks
    Sat
    Message was edited by:
    sat_p

    In Help > About > Properties:
    sqldeveloper.oci.available = true

  • Can I use user names and password of Microsoft Office Outlook for hyperion

    I'm new to Hyperion. Can anyone tell that can I use "user names" and "passwords" of Microsoft Office Outlook for login into hyperion applications.
    I'm not talking about single sign on, but want to use same user names and passwords as that in Outlook.
    ANy suggestions?

    That depends on how your Outlook authentication is configured.
    Hyperion is generally configured to authenticate against a network directory (NTLM, MSAD or LDAP). I'm not an Outlook expert, but my Outlook user ID and password is almost always my MSAD id and password (I change clients regularly, and it's almost always the same situation). So it's also usually the same as my Hyperion ID and password.
    Ask your Outlook administrator whether it uses (or syncs with) MSAD, NTLM or LDAP. If the answer is yes, then you're in good shape because Hyperion can use these as well.
    Hope this helps,
    - Jake

  • Migrate WSUS server from 2003x86 to 2008x64, new hardware, use same name and IP address?

    Searching through the WSUS forums and reading the TechNET migration documentation, I have bits and pieces of information to make this a smooth transition...I think. I have a plan in mind but
    would like the communities input on what I am thinking before moving forward and having it blowup in my face :). <o:p></o:p>
    I have the following currently:<o:p></o:p>
    A single WSUS 3.0 SP2 server, running on Server Win2003x86, using the default WID (susdb.mdf) on the same server. I have SQL 2005 Express installed on this server as well for other services
    but this has no bearing on the WID correct?<o:p></o:p>
    What I would like to do:<o:p></o:p>
    I have a new server (a much better one) that I would like to move WSUS on to, that will be running Server Win2008x64 (I have to setup first). <o:p></o:p>
    Steps that I would like to follow:<o:p></o:p>
    1. I will go through and setup this new server with all M$ updates etc... under a new name (ex. wsusnew) and DHCP acquired IP address and then power it down. <o:p></o:p>
    2. Get on my current WSUS server and backup all current WSUS settings, groups, DB etc... to a network location for temporary storage. Then power it down.<o:p></o:p>
    3. Delete the current WSUS server computer object in AD, DNS entry I will leave because my intension is to give the same IP address to the new WSUS server.<o:p></o:p>
    4. Start the new server, static assign the IP address from the old WSUS server to this new server and then change the name of (wsusnew) to the old servers name, which should be ok sense I deleted
    the AD object in step 3.<o:p></o:p>
    5. After the obvious restart, the new server will have the same name and IP address as the old server. <o:p></o:p>
    6. Now that the new server is up (with same settings name/IP as old server), I will then go through and install the WSUS role on the server and restore my WSUS information.<o:p></o:p>
    Questions:<o:p></o:p>
    1. Step 2 above, is it possible to do this, without making replica servers? I kept reading about this as I was researching doing this, I would rather just copy the DB and folders and simply
    put them in-place on the new server.<o:p></o:p>
    2. Step 6 above, restoring of the data, what is the proper way to do this in the scenarioI described? <o:p></o:p>
    Thank you to anyone who can provide me some information.
    Jeff

    Thank you for the reply, I will follow and let you know. Proabably be next week sometime before I'm able to try though. So look for a reponse then. Thank you again.
    Jeff
    OR...
    You can use the much more simple, much more reliable, and much more proven method of:
    Install new server as a replica of the old.
    Replicate.
    Configure new server as upstream server.
    Point clients to new server.
    Turn off old server after all clients have redirected to the new server.
    For everybody that has tried the backup/restore the database procedure described above, they have encounted complications of one form or another.
    WSUS has a built-in and fully supported comprehensive replication capbility. use it! :-)
    Lawrence Garvin, M.S., MCITP:EA, MCDBA, MCSA
    Microsoft MVP - Software Distribution (2005-2012)
    My MVP Profile: http://mvp.support.microsoft.com/profile/Lawrence.Garvin

  • Unable to deploy a Windows 8.1 image using WDS name and approve!

    Hello,
    Hopefully some of you residing Windows 8.1/2012R2 WDS experts are able to answer this question that has been tormenting me for 3 weeks now!
    I have been trying to deploy a custom Windows 8.1 image to a test VM using an answer file and WDS for a mostly unattended process (outside of selecting the image to apply).
    The image and installation process actually works flawlessly if I let WDS handle all known and unknown clients.  The problem comes when I try to "name and approve" the stations.  All I do is enter the name and leave everything else blank
    and/or at their default settings but it always fails no matter the tweaks I've been trying to apply to the answer file, UnsecureJoin true or false with the credentials and whatnot does not matter.  For the sake of simplicity, I'll post the "specialize"
    portion of my answer file which worked using UnsecureJoin without name and approve here:
    <settings pass="specialize">
    <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Identification>
    <UnsecureJoin>true</UnsecureJoin>
    </Identification>
    </component>
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ComputerName>%MACHINENAME%</ComputerName>
    <RegisteredOrganization>Organization</RegisteredOrganization>
    <RegisteredOwner>Utilisateur</RegisteredOwner>
    </component>
    <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <InputLocale>1009:00001009</InputLocale>
    <SystemLocale>en-US</SystemLocale>
    <UILanguage>fr-FR</UILanguage>
    <UserLocale>en-US</UserLocale>
    </component>
    </settings>
    The error I retrieved from C:\Windows\panther\setuperr.log is: "[DJOIN.EXE] Unattended Join: At least one of JoinWorkgroup/JoinDomain must be specified: 0x57".  Thus, I retry with name and approve but by specifying the JoinDomain with the
    %MACHINEDOMAIN% value as such:
    <Identification>
    <UnsecureJoin>true</UnsecureJoin>
    <JoinDomain>%MACHINEDOMAIN%</JoinDomain>
    </Identification>
    This seems weird since WDS should already have this information which is specified in the WDS server properties.  Still, I add the requested information and try again which then gives me the following error fetched from C:\Windows\debug\NetSetup.log:
    "NetpGetDomainData: Failed to find the domain data: 0x6e"
    Anybody else ran into this and know the fix for it?
    Also, as an additional note, not sure if it is relevant, but doing only "Approve" will not work at all either as it gives me the following error when I attempt to do so: "The name provided is not a properly formed account name." despite
    the fact that I've formatted it to use "CVL%MAC" which should pass by fine.

    Hi,
    Firstly, I need to confirm how the name setting got passed? Because according to my test, if the device named uncorrectly, it would prompt the error and couldn't go to next step:
    As far as I know, the naming standard is different between Device Identity and ADDS server naming policy, the second naming policy should be like: %61username%#
    Therefore, please check your PC device name if there is any problem with it. You can also refer to the contents of the link below for more details about Naming Standard:
    http://programming4.us/desktop/21662.aspx
    Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    For another problem, Unsecure join, according to the contents of the link below. since Vista, shared computer password is a dynamically generated, no need to assign the password manually.
    http://technet.microsoft.com/en-us/library/cc730845(v=ws.10).aspx
    Roger Lu
    TechNet Community Support

  • BAPI Structure populating using field name and field value frm internal tbl

    Hi Experts,
                     Need your help, my requirement is to populate BAPI import structure using its field name and filed value  stored in a internal table.  Please advise the best approach.
    Regards
    Ram.

    Hi, in an ABAP program you can make use of FIELD-SYMBOLS and the ASSIGN statement for filling the BAPI fields based on the fieldname found in the internal table. Hopes it answer your question. Succes

  • In Which scenario do we use Input parameter and Variable in HANA?

    Hi Every one,
    Can any one let me know in which scenario do we use the Input parameter and Variables in HANA.??
    Do variables does the same functionality as like Input paramater.
    Is there any major differences between these??
    Thanks and regards
    Sanjay

    Hi
    Have a look on this:
    Input Parameters and Variables in SAP HANA Modeling
    Regards,
    Krishna Tangudu

  • Connecting to SMTP mail server using user name and password in java

    Hi,
    I am trying to send mail using SMTP server in java.
    But my SMTP server only allows valid users to send mails. I need a way to pass my user name and password to my SMTP server.
    How do I do this ?
    Thank you
    Ramesh

    I think the client is not able to do a HTTP POST
    to the WLS server but it can do a HTTP GET.
    I dont know why.
    http://manojc.com
    "Ganesh" <[email protected]> wrote in message
    news:3eba91bc$[email protected]..
    >
    Hi,
    I deployed a rpc web service using WLS 7.0 SP2 in HP-UX 11 environment.When I
    invoke the web service through my browser (IE 6.0) using the web servicesurl,
    it brings my service method correctly. From there, if I click the invokebutton
    it asks me for a network user name and password under "weblogic" realm???If I
    provide the admin user credentials (which I supplied while creating mydomain)
    it is not accepting that it keeps popping up this network user passwordwindow
    over and over. Not sure which username/password I have to provide here tosee
    the result of my service.
    If I try to invoke the web service through my client (static) I am gettinga connection
    refused exception. I guess either way, I am not able to access my webservice.
    In the attached file, I have cut and pasted the client stack trace as wellas
    the server log trace from weblogic.
    Any ideas would be highly appreciated.
    Thanks,
    Ganesh

  • Using java class and variables declared in java file in jsp

    hi everyone
    i m trying to seperate business logic form web layer. i don't know i am doing in a right way or not.
    i wanted to access my own java class and its variables in jsp.
    for this i created java file like this
    package ris;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class  NewClass{
        public static void main(String args[]){
            Connection con = null;
            ResultSet rs=null;
            Statement smt=null;
            try{
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con=DriverManager.getConnection("jdbc:mysql:///net","root", "anthony111");
                smt=con.createStatement();
               rs= smt.executeQuery("SELECT * FROM emp");
               while(rs.next()){
                String  str = rs.getString("Name");
                }catch( Exception e){
                    String msg="Exception:"+e.getMessage();
                }finally {
          try {
            if(con != null)
              con.close();
          } catch(SQLException e) {}
    }next i created a jsp where i want to access String str defined in java class above.
    <%--
        Document   : fisrt
        Created on : Jul 25, 2009, 3:00:38 PM
        Author     : REiSHI
    --%>
    <%@page import="ris.NewClass"%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <h1><%=str%></h1>
        </body>
    </html>I wanted to print the name field extracted from database by ResultSet.
    but it gives error cannot find symbol str.
    please help me to find right way to do this.
    i am using netbeans ide.

    Very bad approach
    1) Think if your table contains more than one NAMEs then you will get only the last one with your code.
    2) Your String is declared as local variable in the method.
    3) You have not created any object of NewClass nor called the method in JSP page. Then who will call the method to run sql?
    4) Your NewClass contains main method which will not work in web application, it's not standalone desktop application so remove main.
    Better create an ArrayList and then call the method of NewClass and then store the data into ArrayList and return the ArrayList.
    It should look like
    {code:java}
    package ris;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class  NewClass{
        public static ArrayList getNames(){
            Connection con = null;
            ResultSet rs=null;
            Statement smt=null;
            ArrayList nameList = new ArrayList();
            try{
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con=DriverManager.getConnection("jdbc:mysql:///net","root", "anthony111");
                smt=con.createStatement();
               rs= smt.executeQuery("SELECT * FROM emp");
               while(rs.next()){
                nameList.add(rs.getString("Name"));
               return nameList;
                }catch( Exception e){
                    String msg="Exception:"+e.getMessage();
                   </code><code class="jive-code jive-java"><font>return nameList;</code><code class="jive-code jive-java">
                }finally {
          try {
            if(con != null)
              con.close();
          } catch(SQLException e) {}
          </code><code>return nameList;</code>
    <code class="jive-code jive-java">    }

  • Using table names as variables

    Hello!
    I have a table containing only 2 columns - SEQUENCE_NUMBER and TABLE_NAME.
    The sequence numbers are unique numbers and this table shows in which table a certain sequence number can be found. For example:
    table cross:
    SN | TABLE_NAME
    1  | table1
    2  | table1
    3  | table3
    4  | table2Each one of the tables referenced in the TABLE_NAME column has a column named OPERATION, for example:
    table table1:
    SEQNUM | OPERATION
    1      | i
    2      | u
    </code>table table2:
    SEQNUM | OPERATION
    4 | d
    What I want to achieve is to display all operations in order:
    SN | OPERATION
    1  | i
    2  | u
    3  | ...
    4  | d
    and so onAnd I succeeded with this pl/sql:
    DECLARE
       text   VARCHAR2 (100) := '';
       op   VARCHAR2 (1) := '';
       CURSOR c_tmp
       IS
            SELECT   *
              FROM   CROSS
          ORDER BY   sn;
    BEGIN
       FOR tmp IN c_tmp
       LOOP
          text := 'select operation from ' || tmp.table_name || ' where seqnum = ' || tmp.sn;
          DBMS_OUTPUT.put_line (text);
          EXECUTE IMMEDIATE text INTO op;
          DBMS_OUTPUT.put_line ('operation: ' || op);
       END LOOP;
    END;Now I want to extend the functionality of the code. Suppose there are more fields in every table and every one of the tables (table*) has a different number of fields, for example:
    table table1:
    SEQNUM | OPERATION | COL1 | COL2 | COL3
    1      | i         | bla | foo | bar
    2      | u         | blq | foq | baq
    </code>table table2:
    SEQNUM | OPERATION | COL1 | COL2
    4 | d | 111 | 222
    Now I want (using SELECT IMMEDIATE) to select not only the operation of every row, but the whole row (!) and then do something with the other fields, like:
    BEGIN
       FOR tmp IN c_tmp
       LOOP
          text := 'select * from ' || tmp.table_name || ' where seqnum = ' || tmp.sn;
          DBMS_OUTPUT.put_line (text);
          EXECUTE IMMEDIATE text INTO whole_record;
          DBMS_OUTPUT.put_line ('field1: ' || whole_record.operation);
          DBMS_OUTPUT.put_line ('field1: ' || whole_record.col1);
       END LOOP;
    END;How is that possible? The type of the "whole_record" variable is defined by the cursor c_tmp, which means, that the variable must be declared in the beginning of the loop!
    How can I do that?
    Regards.
    Edited by: user10962462 on Dec 11, 2009 7:48 AM

    Sounds like you want to dynamically extract the columns at run time when you don't know what they are at design time.
    Generally this is poor design and practice, but there are a few applications where it's handy e.g...
    The following allows any query to be executed and the data retrieved (in this case to generate a CSV file)...
    As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    PL/SQL procedure successfully completed.Output.txt file contains:
    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required.

  • How to use table name as variable

    P.s. I wish to send a tablename through a function as a variable
    and then want to make a use in sql query. How can I make a use
    of it.
    null

    Rajeev Grover (guest) wrote:
    : P.s. I wish to send a tablename through a function as a
    variable
    : and then want to make a use in sql query. How can I make a use
    : of it.
    Use the dbms_sql package.
    E.g.
    DECLARE
    tbl_name VARCHAR2(40);
    cur_stmt VARCHAR2(2000);
    cur_hndl INTEGER;
    BEGIN
    cur_stmt :=
    'SELECT column1, column2, column3, ... '

  • Form processing using getParameter Names() and Values() Seriously confused

    Hi all,
    I have an HTML table containing multiple <INPUT name='Flows[]' ...> to create arrays. However, when I try to process the code in my servlet it gets ignored and no excpetions are thrown. I know I must be doing something wrong but for the life of me I cannot see what or where it is.
    Enumeration <String> paramNames = request.getParameterNames() ;
    double dFlows[] = null ;
    while (paramNames.hasMoreElements())
         try
              String pName = paramNames.nextElement() ;
              System.out.println(String.format("Parameter Name : %s Length %d", pName, pName.length())) ;
              if (pName == "Flows[]")
                   String pValues[] = request.getParameterValues(pName) ;
                   nParams = pValues.length ;
                   System.out.println(String.format("Found %s Flow Readings", nParams)) ;
                   dFlows = new double[nParams] ;
                   for (p = 0; p < nParams; p++)
                        dFlows[p] = Double.parseDouble(pValues[p]) ;
              else
                   System.out.println(String.format("%s != Flows[]", pName)) ;
         catch (Exception e)
              e.printStackTrace(System.out) ;
    }The output I get in the log file is :
    Parameter Name : Flows[] : Length 7
    Flows[] != Flows[]
    If the log is to believed then the error is in the if (pName == "Flows[]") but the log proves this to be wrong!
    Can anyone help me out with this, I really am seriously confused.
    Bill Moo

              if (pName == "Flows[]")
              if (pName.equals("Flows[]"))But why on earth are you looping through all the parameters when you already know the name? Use request.getParameter("Flows[]");

Maybe you are looking for

  • Best practice for schedule printing of spool requests

    Hi there, I am searching for a method / best practice how to schedule the printing of different spool requests. The following situation: A lot of different spool requests are generated in the night, but they should be printed at a specific time in th

  • Ipad mini battery issues

    device is showing 100% chared while pluged in and 98% as soon as i remove the charger ? iOS 6.1.2 upgraded

  • Pci-x slot

    how can i tell if the pci-x slot on my power mac g5 is broken.

  • My iphone 5 charger is breaking. Where can I buy a replacement?

    I have looked on the website because I can see the end of it starting to split and am worried it will stop recharging soon. Anyone can help?

  • Sequence Page Display Dashboard

    Dynamic Dashboard, I want 3 reports, which needs to be displayed sequentially i.e. 00:00 - 00:59 Report1 01:00 - 01:59 Report2 02:00 - 02:59 Report3 03:00 - 03:59 Report1 (Refreshed i.e. new data) and the cycle repeats Please help.