How to use the command the reel with Bind Variables

For the next REEL, I want the GEN_DATE to be entered by the user at the time of execution of the SQL Script. Is this possible in the command of the COIL.


the colsep value,-separate the columns with a comma
set pagesize 1000 - get rid of disturbing - between pages
set position-the title of column Print
Set trimspool on - remove the spaces to the right. eliminating spaces until eol
set linesize 700 - line size should be the sum of the column width
coil spool_results.csv
SELECT *.
OF GUI_SITE_JOURNAL
WHERE GENDATE_ BETWEEN ' 2012-11-01 00:00:00:00000' AND ' 2012 - 11 - 02 00:00:00:00000'* ORDER BY GEN_DATE;
spool off;

The reason is to give the opportunity to the user so that he can enter any beach without changing the code of the script.

Can someone help me please.

Published by: user10903866 on February 18, 2013 19:44

Hello

user10903866 wrote:
For the next REEL, I want the GEN_DATE to be entered by the user at the time of execution of the SQL Script. Is this possible in the command of the COIL.

Do you want user input in the command of the COIL, or want you she in the query?

the colsep value,-separate the columns with a comma
set pagesize 1000 - get rid of disturbing - between pages
set position-the title of column Print
Set trimspool on - remove the spaces to the right. eliminating spaces until eol
set linesize 700 - line size should be the sum of the column width
coil spool_results.csv
SELECT *.
OF GUI_SITE_JOURNAL
WHERE GENDATE_ BETWEEN ' 2012-11-01 00:00:00:00000' AND ' 2012 - 11 - 02 00:00:00:00000'* ORDER BY GEN_DATE;

What are the data type gen_date of the oif?
If it is a string, it is a big mistake. Information about the dates in the DATE columns belongs.
If it's a DATE, so don't try to compare strings, such as "2012-11-01 00:00:00:00000'."

spool off;

The reason is to give the opportunity to the user so that he can enter any beach without changing the code of the script.

Can someone help me please.

One way to do that is with substitution variables:

...
SET     VERIFY  OFF

ACCEPT  start_gen_date     PROMPT "Starting date (e.g., 2013-02-18 23:00:00.00000): "
ACCEPT  end_gen_date     PROMPT "Ending date   (e.g., 2013-02-18 23:59:59.99999): "

SPOOL  spool_results.csv

SELECT    *
FROM        gui_site_journal
WHERE        gen_date  BETWEEN '&start_gen_date'
                AND     '&end_gen_date'
ORDER BY  gen_date;

SPOOL  OFF

There are security considerations. Variables substitution to the devious users the power to issue a SQL, such as DROP TABLE command. Users with SQL * Plus access already have this power, anyway.

Tags: Database

Similar Questions

  • How to use the product with laptop Portege R150 recovery CD?

    How to use the recovery CD product with laptop Portege R150 of Formate and reinstall the operating system?

    Mobile recovery procedure Asian does not for me but may not be very different as on mobile phones produced in Europe or the United States.

    Start your laptop and press F12 to display the boot options
    Place the recovery disc into the optical disc drive
    In the start menu, choose the CD/DVD drive and press ENTER
    The procedure of the facilities is expected to begin
    Follow the menu on the screen

    I do not know what will be shown at this stage, but it is not complicated to install the original recovery image. If you have any other questions please let me know what happens when upgraders begins. What options are displayed?

  • How to use the date with the report parameter format

    Hi all

    How to use the date format with this tag function,

    <? param@begin:P_FROM_DATE? > <? $P_FROM_DATE? >

    This date of form source of report and setting is coming as this 2012/11/01 00:00:00.

    So now I need this in MY-DD-YYYY marker. I tried like this..? param@begin:P_FROM_DATE? > <? $format - date: P_FROM_DATE; ' DD-MON-YYYY '? >

    but its giving error. Can someone pls how to convert to the format of date custom.

    Thanks and greetings
    Srikkanth.M

    Problem solved.

    REF this link

    Date Format of XML

  • Satellite A300 - how to use the recovery with external DVD drive disc?

    Hello

    I bought a toshiba Satellite A300 - 15 d

    FTM the tsscorp drive that is installed in the camera no longer works (does not detect any type of media what so ever). ) need to recover the laptop, so I used a USB DVD drive to boot from the restore disc, but after that the charges of recovery console it says waiting for media in the f: drive, which is the tsscorp drive although I used an external drive to load the disc.

    What files should I edit to make it to load from the drive externally and if this isn't the solution, what do I do?

    Thanks in advance

    Hey Buddy,

    Unfortunately I think that it of not possible to use the recovery with external CD/DVD drive disc. Therefore, place the internal for use the recovery disc.
    You can get a new drive to an authorized service provider.

    But if the original OS from Toshiba is installed, you can use the function of disk recovery HARD reinstall Windows as well. Go to the advanced boot menu (F8) and select Repair my computer :)

  • How to use the Clipboard with some sites

    I use the copy and paste function from the Clipboard frequently to allow access to certain pages. It worked fine until I updated Firefox to the latest version of 29,0. It doesn't work anymore! I followed the usual instructions to create a user.js file and place it in the profile directory. But the problem is still there. Need help with this problem.

    You can do this is through buttons using JavaScript to make the paste.

    You can only do this via the keyboard.

    Use keyboard shortcuts if the buttons on the web page or other methods do not work.

    • Copy: Ctrl + C or Ctrl + insert (Mac: command + C)
    • Paste: Ctrl + V or shift + insert (Mac: command + V)
    • Cut: Ctrl + X or shift + delete (Mac: command + X)

    See also:

  • How to use the microphone with a music player

    I did not use the microphone input with any music player for the internet radio show. can it be done with vista on a sony vaio labtop

    Hellotrendsetter,

    Thank you for visiting the Microsoft answers Site.

    Please provide the make and model of your PC. Also, to better help, please relay the program or music player you use.

    You can also view the link below for more information on how to connect a microphone, music player or other audio device to your computer:

    http://Windows.Microsoft.com/en-us/Windows-Vista/connect-a-microphone-music-player-or-other-audio-device-to-your-computer

    Thank you

    Mary
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to use the import with FDM with adapter ERPI script?

    Hello

    I use FDM and ERPI 11.1.2 to load data of EBS R12 to planning 11.1.2

    Loaded from eBS data for a YEAR.

    I realized I could use an import script to manually calculate the amount with the periodic_net_cr and periodic_net_dr fields.

    But how to use this import script? Because in my import in FDM format, I do not use a file but directly the adapter, if no field "Expression".

    Thanks in advance for your help

    Fanny

    You must use the ImportAction script.

  • How to use the String with an external dispatchEvent event.target.name?

    ... I hope that the question of the title makes sense...

    On my stage, I have an external SWF loaded with a button. When you click the button dispatches the main event scene.

    On the main stage a listener can load a SWF it in a magazine called Gallery.

    The charger of the Gallery is also shared by the buttons on the main stage, who use the event.target.name chain to appeal to sovereign wealth funds with corresponding names.

    I use tweens to fade and, in the content of the Gallery when a key is pressed.

    --

    Loading of the FSV worked until I tried to create a universal function for the dispatchEvent buttons...

    The problem I have is that I don't know how to set the string to indicate to the newSWFRequest where the SWF file when triggered by external buttons.

    (I maybe do this wrong... but thought that the best way to load a SWF on the main stage from an external SWF was using dispatchEvent?)

    My code raises the event and the charger of the Gallery Faints, but then it does not find the new SWF:

    Error #2044: Unmanaged by the IOErrorEvent:. Text = Error #2035: URL not found.

    Please can someone help me understand how to make the point in the chain in the right direction? (I think that the errors only are in bold below)

    Code:

    var myTweenIn2:Tween;

    var myTweenOut2:Tween;

    var nextLoadS2:String;

    Listening external inclinometer shipped external event

    addEventListener ("contactStage", btnClickExtrnl);

    function btnClickExtrnl(e:Event):void {}

    nextLoadS2 =?

    myTweenOut2 = new Tween(gallery,"alpha",None.easeOut,gallery.alpha,0,0.2,true);

    myTweenOut2.addEventListener (TweenEvent.MOTION_FINISH, tweenOutCompleteF2);

    }

    Function universal BTNS

    function tweenOutCompleteF2(e:TweenEvent) {}

    myTweenOut2.removeEventListener (TweenEvent.MOTION_FINISH, tweenOutCompleteF2);

    myTweenOut2 = null;

    var newSWFRequest:URLRequest = new URLRequest ("SWFs /" + nextLoadS2 + ".swf");

    myTweenIn2 = new Tween (Gallery, "alpha", None.easeOut, gallery.alpha, 1, 0.2, true);

    Gallery.Load (newSWFRequest);

    Gallery.x = Xpos;

    Gallery.y = Ypos;

    }

    Thank you.

    If this code is on the timeline of a child of the main timeline of your external swf add parent 3rd in two lines with parent.parent.

  • How to use the user with event loop event

    Hello

    I want to communicate between 2 VI, so I have a global variable (boolean) who gives the order to an event tool to run. The problem comes from the fact that event loop accepts no global variable, I found on the forum that I can use the user event. Of course, the second VI works normally when I push the button (boolean) in there to run the event loop. Please can someone explain me how to do this, I am a chemist.

    Thank you.

    You enter the receiver structure of event for the event you want to receive.

    To do this in two screws, you will have to share the user between them event reference.

  • How to use the nocopy with java stored procedures parameters

    
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    
    

    I'm a PL/SQL programmer, but not a Java programmer. I have the following java function that does what it's supposed to add a pdf at the end of another pdf document:

    import oracle.sql.BLOB;
    import org.apache.pdfbox.util.PDFMergerUtility;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.driver.OracleDriver;
    import java.io.OutputStream;
    
    public class PDFUtilities {
    public static BLOB appendPDF(BLOB pdfdoc1, BLOB pdfdoc2) throws Exception {
           
            //create a connection object to the current instance
              OracleConnection conn = (OracleConnection)new OracleDriver().defaultConnection();
            //create the output blob using the connection
              BLOB outPDF = BLOB.createTemporary(conn, true ,BLOB.DURATION_SESSION);
            //create an output stream to the output blob
              OutputStream os = outPDF.setBinaryStream(0);               
            //instantiate the pdf merger utility
              PDFMergerUtility mergerUtility = new PDFMergerUtility();       
            //connect the merger to the output stream
              mergerUtility.setDestinationStream(os);
            //stream from each input blob into the merger utility
              mergerUtility.addSource(pdfdoc1.getBinaryStream());
              mergerUtility.addSource(pdfdoc2.getBinaryStream());
            //merge the 2 input pdfs
              mergerUtility.mergeDocuments();             
            //do not close the output stream
            //return the blob
            return outPDF;
        }
    
    }
    

    CREATE OR REPLACE package PDFTOOLS.pkg_pdf_utilities
    as
    function f_get_merged_pdf (
              pi_pdf1       blob
            , pi_pdf2    blob
      )
      return blob;
    end pkg_pdf_utilities;
    /
    
    CREATE OR REPLACE package body PDFTOOLS.pkg_pdf_utilities
    as
    function f_get_merged_pdf (
              pi_pdf1       blob
            , pi_pdf2    blob
      )
      return blob
      as language java name 
      'com.mycode.pdftools.PDFUtilities.appendPDF(oracle.sql.BLOB, oracle.sql.BLOB) return oracle.sql.BLOB';
    end PDFTOOLS.pkg_pdf_utilities;
    /
    

    It's very basic, but doesn't seem to work. However, I want to my function from PL/SQL to a procedure that looks like this:

    CREATE OR REPLACE package PDFTOOLS.pkg_pdf_utilities
    as
    procedure sp_append_pdf (
              pio_pdf2append2   IN OUT NOCOPY blob
            , pio_pdf2append   IN OUT NOCOPY blob
      )
    end pkg_pdf_utilities;
    /
    

    What is important, what I'm trying to do is to NOCOPY the BLOBs. Otherwise, I have to read my PDF files into 2 BLOBs and create a 3rd blob as output. I prefer to be able to keep the pio_pdf2append2 as the final output. What I actually do call thing in a loop to gradually add a PDF file to a big. I'm not linking this in one operation because of concerns over the use of the system and because the pdfbox library java has would have been question after 850 in PDF format, which is not completely unrealistic in my approach.

    How could I achieve this?

    Post edited by: Pollocks01 only formatted code blocks because atlassian {code} tags didn't work.

    Passage of an argument as input/OUTPUT requires the mapping to a Java array.

    Simplified example that adds one FOR the other:

    create or replace and compile java source named blob_appender_src as
    import oracle.sql.BLOB;
    import java.sql.SQLException;
    import java.io.OutputStream;
    import java.io.InputStream;
    import java.io.IOException;
    
    public class BLOBAppender {
        public static void run (BLOB[] p1, BLOB p2) throws SQLException, IOException { 
    
            InputStream is = p2.getBinaryStream();
            OutputStream os = p1[0].setBinaryStream(p1[0].length()+1);                
    
            byte[] buffer = new byte[1024];
            int len;
            while ((len = is.read(buffer)) != -1) {
                os.write(buffer, 0, len);
            }
            os.close();
            is.close();
        }
    }
    
    create or replace procedure blob_append (
      p_lob1  in out nocopy blob
    , p_lob2  in            blob
    )
    as language java name 'BLOBAppender.run(oracle.sql.BLOB[], oracle.sql.BLOB)' ;
    /
    
    SQL> declare
      2    p_lob1  blob := utl_raw.cast_to_raw('ABC');
      3    p_lob2  blob := utl_raw.cast_to_raw('DEF');
      4  begin
      5    blob_append(p_lob1, p_lob2);
      6    dbms_output.put_line(utl_raw.cast_to_varchar2(p_lob1));
      7  end;
      8  /
    
    ABCDEF
    
    PL/SQL procedure successfully completed.
    
  • How to use the zone with the calendar events settings?

    After looking through the questions in the time zones, scheduling and synchronization, I still can't my Palm Centro to exploit the way I think it should.

    I have a Verizon Centro, use Windows XP with Outlook and Hotsync synchronization manager 7.02 via a USB cable.  I do not use Palm Desktop.

    I expect events to pass the time in the calendar when I change the time zone, but they did not.

    I am preparing for a trip.  I enter several events in MS Outlook placing events occur in a different time zone in my calendar at the same time the event happen in my timezone (NY).   For example, a meeting of 9-10 am in Los Angeles is put in my calendar to outlook MS as 12-1 PM on the day of the meeting.  Then I have synced with my Centro and Outlook for New York time zone.  The Centro is set automatically update Date, time, area of the network in New York. The event of the meeting appears as 12-1 PM the correct day.

    Then I turn off the Centro phone (IE unplug the Verizon network), change the update time to 'Nothing' - is to say fully manual, change the time zone in Los Angeles and set the time to the exact time in Los Angeles.   I expect the meeting to 9-10 AM in my Centro calendar, but it's not!  I have try other combinations - let the time on the Date and the automatic time update and change the time zone in Los Angeles, etc..  I think I've tried all combinations.  Overall, I leave the Centro phone out of the Verizon network.  I can not get the meeting to change his time in the new time zone.

    What's the trick? What did I miss?

    You might ask why I'm trying this with the phone turned off - it's because I'm really much further that THE and in a GSM network where I will simply use the Center as a PDA.

    All advice appreciated.

    thepoeta-

    Thanks for the reply.

    In fact my preference was not established "new events use time zones."

    Meanwhile, I had loaded all the applointments of Outlook, about 20 of them,

    thinking that I would just manually move along the way.

    I'll play with time zone preference, but,.

    is it possible to identify the existing appointments in the

    Palm as belonging to a time zone that is different, just by using the Palm Centro?

    Thank you

    Neal

  • How to use the aggregate with Date function

    Hi all

    I have a Group date is it possible of Max and Min to date.

    I tried like this but its out errored <? MIN (current - group () / CREATION_DATE)? >.

    I also tried this, but it does not work
    <? xdoxslt:minimum (CREATION_DATE)? >

    Is it possible to use the function of aggregation with date values.

    Thanks and greetings
    Srikkanth

    You can use
    Ensure that the "date" is in canonical format

  • How to use the AVMenuItemExecute() with an external window

    Hello

    I am using the AVMenuItemExecute() function in an external window. I mean I have a document open in another window (to aid

    AVDocOpenFromASFileWithParams or a feature like this).

    In fact, the problem is that the AVMenuItemExecute() is running on the windows of Acrobat that is emplty in my case, because I opened the PDF file in another window.

    Do you know if it's possible or not? Whethet it is possible how can I do?

    Thanks in advance,

    Joel

    Sorry, but you can't: (.)

    As you can imagine, MenuItemExecute() is on the menu... running items these does ARE menu items that in Acrobat/Reader and NOT in any application based on an external window.

    What menu item you try to run?  Perhaps there is another way to access this feature?

  • How to use the number as a variable?

    Hello

    I use SQL Developer 4.1.0.19.07... and every time I have use something like...

    variable myVar Number;
    execute :myVar := 10;
    

    A query as...

    select :myVar "myVar" from dual;
    

    Give me the output...

    myVar
    -----
          -- that is "null", as I don't have a null replacement ;-)
    

    What I am doing wrong? Any advice (in addition to using VarChar2)?

    Thanks in advance

    Peter

    This seems to be the same bug as noted in a discussion earlier: print in SQL Developer 4.1

  • How to find the query select bind variables

    How to extract the variable name to bind to AS suite of sql queries
    ' SELECT NAME IN: NAME OF THE DOUBLE '
    or
    "SELECT * FROM WHERE DOUBLE (: NAME = NAME)".
    or
    "SELECT * FROM WHERE DOUBLE: NAME IS NULL'."
    or
    "SELECT * FROM WHERE DOUBLE: NAME | NAME = LAST_NAME'
    or
    ' SELECT * FROM DUAL WHERE: a = 10'
    or
    "SELECT * from where DOUBLE: A > = 10'.
    or
    "SELECT * from where DOUBLE: A < = 10 '.

    Give a solution using SUBSTR, REGEXP_SUBSTR, please answer quickly
    best answer will be marked correct/good...

    Search: and then search for the following word breaker then have the substr for them: and the separator.
    You can build an own function to find the same.

Maybe you are looking for

  • Problems of bad video driver Y470P for Windows RDP

    Hello world I'm having a problem with the video driver ATI/Intel when remoting into my home computer. I use the windows remote RDP Protocol on my work computer and whenever I try to use java or flash, I get an error causing the my browser (this happe

  • Office jet 4620 paper jam

    When I try to print, I get the message "Paper jam clear Jam then press OK" what I'm doing.  Nothing seems to help. I tried all the cleaning rollers as shown in all of the presentations from YouTube, but the problem persists.

  • need to know how to change the password for access to the computer

    I'm changing my password on the computer so that my son can not use it

  • Wacom Intuos4 Tablet

    I've recently updated the driver for my Wacom Intuos4 tablet. But since I installed the version of the driver 6.1.2-5, all my shortcuts Windows pen and handwriting input features have been disabled! Is there an explanation / solution for this?

  • Windows 7 can not be updated

    I have change hd and now windows 7 can not get updates. Here is the output of MGADiag.exe: Diagnostic report (1.9.0027.0):-----------------------------------------Validation of Windows data--> Validation code: 0x8004FE21Code of Validation caching onl