SQL*PLUS and PL/SQL

HI !
There is any way to run a command SQL*PLUS through a block pl/sql. For example to run the "copy from" command in a block pl/sql.
Thanks for you time.

APC wrote:
No.
SQL*Plus is an interactive, client-side tool. PL/SQL is a batch-oriented server side tool.I would make more distinction ...
SQL*Plus is an interactive, client-side tool - a specialized command processor. PL/SQL is a batch-oriented server side programming language.
>
There are ways of doing the same sort of things in both languages, but they are different commands.
Cheers, APC

Similar Messages

  • SQL*Plus and NLS_DATE_FORMAT

    So, I haven't visited this topic in a long time, so I'm trying to refresh my memory on how everything works ...
    We set our NLS_DATE_FORMAT at the system level ... what ... 4 years ago to 'MM/DD/RR'. Despite the fact that I set this to something more commonly-used than the default of 'DD-Mon-RR', we've adopted the standard of always using TO_DATE() with an explicit format, just in case it's ever changed.
    There were some applications that missed the standard, and now that a driver (for ColdFusion) has been updated, these SQL statements are now failing.
    When I started looking into it, I realized that the system-level default of 'MM/DD/RR' should work fine. But, after experimenting in SQL*Plus and TOAD, I am thinking that either:
    1) the system-level format is not being used
    2) and/or there are login scripts which are setting these to something else
    Coincidentally, both SQL*Plus and TOAD return the exact same query results:
    SQL> select *
         from NLS_INSTANCE_PARAMETERS
         where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE
    NLS_DATE_FORMAT                MM/DD/RR
    SQL> select *
         from NLS_SESSION_PARAMETERS
         where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE
    NLS_DATE_FORMAT                DD-MON-RRSo I looked into the glogin.sql script (which both tools share), and there's nothing mentioned about the NLS_DATE_FORMAT
    -- Copyright (c) 1988, 2003, Oracle Corporation. 
    -- All Rights Reserved.
    -- NAME
    --   glogin.sql
    -- DESCRIPTION
    --   SQL*Plus global login "site profile" file
    --   Add any SQL*Plus commands here that are to
    --   be executed when a user starts SQL*Plus, or
    --   uses the SQL*Plus CONNECT command
    -- USAGE
    --   This script is automatically run
    -- Used by Trusted Oracle
    COLUMN ROWLABEL FORMAT A15
    -- Used for the SHOW ERRORS command
    COLUMN LINE/COL FORMAT A8
    COLUMN ERROR    FORMAT A65  WORD_WRAPPED
    -- Used for the SHOW SGA command
    COLUMN name_col_plus_show_sga FORMAT a24
    COLUMN units_col_plus_show_sga FORMAT a15
    -- Defaults for SHOW PARAMETERS
    COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
    COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE
    -- Defaults for SHOW RECYCLEBIN
    COLUMN origname_plus_show_recyc   FORMAT a16 HEADING 'ORIGINAL NAME'
    COLUMN objectname_plus_show_recyc FORMAT a30 HEADING 'RECYCLEBIN NAME'
    COLUMN objtype_plus_show_recyc    FORMAT a12 HEADING 'OBJECT TYPE'
    COLUMN droptime_plus_show_recyc   FORMAT a19 HEADING 'DROP TIME'
    -- Defaults for SET AUTOTRACE EXPLAIN report
    COLUMN id_plus_exp FORMAT 990 HEADING i
    COLUMN parent_id_plus_exp FORMAT 990 HEADING p
    COLUMN plan_plus_exp FORMAT a60
    COLUMN object_node_plus_exp FORMAT a8
    COLUMN other_tag_plus_exp FORMAT a29
    COLUMN other_plus_exp FORMAT a44
    -- Used to alter the TOAD environment so that users do not have to
    -- use the SET DEFINE OFF command prior to compiling code
    -- Charles Forbes 10.17.2005
    SET scan offIf I expressly go into either tool and execute, the following, setting the format to that already delcared at the system-level:
    alter session set nls_date_format = 'MM/DD/RR'Then these SQL statements start running just fine again.
    There's something that I'm missing in my basic understanding of how this works. I assumed that the driver update for ColdFusion perhaps enabled a different "glogin.sql"-type script equivalent for that tool ... until ... I started checking into how the NLS_DATE_FORMAT is supposed to work ... but isn't. Could someone help me clarify where the hole is in my understanding?
    Thanks,
    Chuck

    chuckers wrote:
    What's the difference, then, between NLS_SESSION_PARAMETERS and NLS_INSTANCE_PARAMETERS in my initial post? The glogin.sql script isn't altering the NLS_DATE_FORMAT for the desktop version of SQL*Plus, so I'm perplexed that the SESSION format differs from the INSTANCE format.NLS_SESSION_PARAMETERS are the NLS parameters that are in force for your particular session (i.e. the particular connection you have). Most client applications cause things like NLS_DATE_FORMAT to be set, overriding the NLS_INSTANCE_PARAMETERS. Instance-level NLS settings are most commonly used only for purely back-end processing (i.e. background jobs scheduled via DBMS_JOB or DBMS_SCHEDULER, etc.) 9 times out of 10, the client application is going to override the instance-level paramters.
    I even opened SQL Developer, and got
    select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE                                   
    NLS_DATE_FORMAT                DD-MON-RR                               
    1 rows selected
    select * from nls_instance_parameters where parameter = 'NLS_DATE_FORMAT'
    PARAMETER                      VALUE                                   
    NLS_DATE_FORMAT                MM/DD/RR                                
    1 rows selected
    That's not unexpected. Java applications are going to use the Java regional properties at least to specify a date format. SQL Developer has a config option for the date format, so it may well be specifying a different format.
    They're all 3 (Toad, SQL*Plus, TOAD) so suspiciously consistent, that I'm questioning some of the fundamentals of the NLS setup.
    I went ahead and looked via SQL*Plus from the server-side, & things are looking more consistently in-line with my expectations:
    [oracle@dvsrvr13 ~]$ sqlplus forbesc@d13
    SQL*Plus: Release 10.1.0.4.0 - Production on Thu Mar 19 12:44:57 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE
    NLS_DATE_FORMAT                MM/DD/RR
    SQL> select * from nls_instance_parameters where parameter = 'NLS_DATE_FORMAT';
    PARAMETER                      VALUE
    NLS_DATE_FORMAT                MM/DD/RR
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    [oracle@dvsrvr13 ~]$ locate glogin.sql
    /u01/app/oracle/product/10.1.0/db_1/sqlplus/admin/glogin.sql
    [oracle@dvsrvr13 ~]$ more /u01/app/oracle/product/10.1.0/db_1/sqlplus/admin/glogin.sql
    -- Copyright (c) 1988, 2003, Oracle Corporation.  All Rights Reserved.
    -- NAME
    --   glogin.sql
    -- DESCRIPTION
    --   SQL*Plus global login "site profile" file
    --   Add any SQL*Plus commands here that are to be executed when a
    --   user starts SQL*Plus, or uses the SQL*Plus CONNECT command
    -- USAGE
    --   This script is automatically run
    -- Used by Trusted Oracle
    COLUMN ROWLABEL FORMAT A15
    -- Used for the SHOW ERRORS command
    COLUMN LINE/COL FORMAT A8
    COLUMN ERROR    FORMAT A65  WORD_WRAPPED
    -- Used for the SHOW SGA command
    COLUMN name_col_plus_show_sga FORMAT a24
    COLUMN units_col_plus_show_sga FORMAT a15
    -- Defaults for SHOW PARAMETERS
    COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
    COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE
    -- Defaults for SHOW RECYCLEBIN
    COLUMN origname_plus_show_recyc   FORMAT a16 HEADING 'ORIGINAL NAME'
    COLUMN objectname_plus_show_recyc FORMAT a30 HEADING 'RECYCLEBIN NAME'
    COLUMN objtype_plus_show_recyc    FORMAT a12 HEADING 'OBJECT TYPE'
    COLUMN droptime_plus_show_recyc   FORMAT a19 HEADING 'DROP TIME'
    -- Defaults for SET AUTOTRACE EXPLAIN report
    COLUMN id_plus_exp FORMAT 990 HEADING i
    COLUMN parent_id_plus_exp FORMAT 990 HEADING p
    COLUMN plan_plus_exp FORMAT a60
    COLUMN object_node_plus_exp FORMAT a8
    COLUMN other_tag_plus_exp FORMAT a29
    COLUMN other_plus_exp FORMAT a44
    [oracle@dvsrvr13 ~]$ So in all, I'm just perplexed by the differences.
    --=cfI'm not surprised that SQL*Plus from the Unix database server is going to have session-level settings that match the instance-level settings because there is probably nothing set in the Unix environment that would override the instance-level settings. There is probably no NLS_LANG or NLS_DATE_FORMAT set as environment variables and probably no central place to look for regional settings. Most applications, particularly Windows and Java apps, are going to have multiple places to look for that sort of information.
    Justin

  • How to connect to SQL*Plus and issue a query all in one command?

    Hi everyone,
    Does anyone know of a way to connect to a db with SQL*Plus, and issue a simple query, all with one command?
    I know that I can save a .sql script with a query, then do this:
    sqlplus user/pwd@db @myscript.sql
    But I'm wondering if there's any way to put the actual query right into the connect command, something like:
    sqlplus user/pwd@db "select count(*) from dba_tables;"
    Does anyone know of a way to do this?

    you didn't mention windows or unix. so, here's a link with both
    Re: windows sql script
    it also has a link to another thread on how to deal with the parens when using ehco in dos.

  • SQL Plus and ODBC w/different database types

    In order to connect to Oracle lite, we go through ODBC in SQL Plus (ex:login/pw@ODBC:polite)
    Can I utilize this method to connect SQL Plus to a SQL Server 7 database and from there run the COPY TO command to copy data into my Oracle database? If so, what do I need to install to make this work? Is there a specific version of SQL Plus that this works with?

    examples:
    - optimizer_mode is 'RULE' when I select using SQL*Plus and 'CHOOSE' when I use SQL*Plus Worksheet.
    - large_pool_size is 32Mb when I select using SQL*Plus and 108Mb when I use SQL*Plus Worksheet.
    etc.

  • Sql Plus and Unicode (or utf-8) characters.

    Hello,
    i have problem with Sql Plus and unicode files. I want to execute Start {filename}, where {filename} is file in unicode format (this file have to contains german and polish characters). But i receive error message. It is possible to read from unicode (or utf-8) file and execute commands from this file)?
    Thanks in advance.
    Pawel Przybyla

    What is your client operating system characterset?

  • Disco Plus and Sub-queries in conditions

    Hi,
    I have a strange behaviour for a report using a sub-query in the condition:
    in Desktop Edition and Viewer it works just fine, in Plus no data is returned.
    I am using Discoverer 9.0.2.
    The condition was created from the Desktop using an existing datasheet, both data sheets using the same parameter.
    I examined the SQL code from Plus and the statement returns data and the sheet with the sub-query also returns data - nevertheless the report doesn't return any data.
    As far as I know you cannot create or modify sub-queries in conditions with PLus - but at least the report should work?! Does anyone know where the problem could be?
    Thank you very much in advance!
    Alex

    Trying to create a sub-query in discoverer...
    Using Desktop (9.04 and 10.1.2), the option "Create Sub-Query" is not available in the condition values. Feel like I'm missing something - has anyone come across this before?
    I assume sub-queries should be possible/supported in Plus 10.1.2 (although it's not in the user guide). If so, the Create Sub-Query option is not available like in Desktop. If not, why not - seeing as it's basic sql commonly used in reporting?
    Thanks!

  • Help to start iSQL*PLUS and OEM services

    Here is what I did in trying upgrade 10.1 to 10.2 on Windows:
    1. use Oracle Universal Installer installed 10.2 in a separated ORACLE_HOME;
    2. run pre-upgrade assistant (utlu102i.sql)
    3. run Net Configuration Assistant to congired listner
    4. run DBUA ( however message shows that database already upgraded)
    At this point, new instance is up. new listner is working, but iSQL*PLUS and oem services didn't even be recognized by OS.
    From Universal Installer, I saw iSQL*PLUS and OEM were installed. What I am missing here in order to start services of iSQL*PLUS and OEM?

    Well, the instance is running properly. sqlplus also works fine. Because there is no new OEM service available if you look at Services list, how it could be meaningful to connect to OEM through a browser? As fact, browser can not connect to OEM.
    Do I need to reinstall 10.2?

  • Plus and minus keys on wireless keyboard?

    hi there everyone. i've got a new aluminum wireless keyboard and i love it to bits. gorgeous bit of design and elegance. on the previous apple keyboard however there was a couple of handy keys next to the numeric pad for 'plus' and 'minus'. Does anyone know how i can find these on the wireless keyboard? these were particularly handy when hit with the 'command' key to increase or decrease the size of text in safari.

    excellent, thank you, i'd obviously not looked at my keyboard closely enough! cheers...

  • Printhead cleaning every time I turn on Officejet Pro 8500A Plus and lasts for 20 minutes or more

    Today I installed the printer for the first time, although I had it since two years ago. Just today I took it out from the box and installed it.
    After the installation the alignment failed, but it was not such a big problem. I connected the printer to the internet for the first time and it downloaded and installed an update. After the update the printer started cleaning the printheads and never stopped. I cancelled that by opening the cover and closing it againg. After that it retried the allignment and this time was successful. After that I was able to print normally. Then I turned of the printer. After some hours I turned it on again and it started with the long printhead cleaning again until it said the yellow ink cartridge is almost empty.  It's an absurd situation as if it was a Jacques Tati movie. Any tips on how to solve it will be much appreciated, or at least I'd like to know if there is a not so aggressive way to cancel this process. I repeat, the printer is new, it had never been used, and the printheads and ink cartridges are new too and I have only printed two pages just for checking and three allignment pages, and it already says the yellow cartridge is almost empty.
    The model is HP OFFICEJET PRO 8500 PLUS and my OS is Windows 98 (64 bits).

    The ink cartridge may have dried up while sitting that long. What do the ink levels report? If empty, I would replace the cartridges
    I was an HP employee
    Reminder: Please select the "Accept as Solution" button on the post that best answers your question. Also, you may select the "Kudos" button on any helpful post to give that person a quick thanks.

  • I have a new iPhone 6 plus and all is OK. But the mail shows more than 400 'unread' messages whereas there are none in the mailbox or trash or anywhere else I have looked. I can send and receive with no problem. I'm sure I have no unread messages.

    I have a new iPhone 6 plus and all is OK. But the mail shows more than 400 'unread' messages whereas there are none in the mailbox or trash or anywhere else I have looked. I can send and receive with no problem. I'm sure I have no unread messages.

        jsavage9621,
    It pains me to hear about your experience with the Home Phone Connect.  This device usually works seamlessly and is a great alternative to a landline phone.  It sounds like we've done our fair share of work on your account here.  I'm going to go ahead and send you a Private Message so that we can access your account and review any open tickets for you.  I look forward to speaking with you.
    TrevorC_VZW
    Follow us on Twitter @VZWSupport

  • I had the iPhone 5 for a while and my Macbook Air was sending me the incoming messages from that phone, however I just upgraded to the 6 Plus and was wondering how I can get my laptop to recognize the messages from this phone now on iMessages.

    Okay so my Macbook Air has always allowed me to receive iMessages from my iPhone 5 to my computer. So basically I could use both to text.. However I just upgraded to the iPhone 6 Plus and I would like the same to happen again with my new phone, but I don't know how. How can my incoming iMessages from my new iPhone 6 plus show up on my laptop?
    -I see all the messages from my old iPhone there, but I would like to know how to set it up so that i can view the messages from my new phone.

    Hi,
    If you are signed onto the same iCloud/Apple ID for Messages, then the second number should have been registered with your Messages on the Mac at the time it was verified.
    To check this, open Messages on the Mac, click on Accounts, and see if the number is displaying and checked. If it is not, Sign out of Messages on your new device and then sign on again.
    Again, phones need to be signed onto the same Messages account that you have set up in Messages.
    Cheers,
    GB

  • I pre-ordered an iPhone 6 Plus and the delivery date now says October 14th. The point of the pre-order is to get it on release day (or shortly thereafter). Can I go to a Verizon store to pick up my new phone on release day?

    I pre-ordered an iPhone 6 Plus and the delivery date now says October 14th. The point of the pre-order is to get it on release day (or shortly thereafter). Can I go to a Verizon store to pick up my new phone on release day?

    I'm not sure that answers the question Candice.
    I'm in the same situation.  I was up trying to get on the Verizon page at 11:55, kept getting the ECPD error.  When finally got through, the Silver Iphone Plus 64 showed arrival of 9-19.  At every step of the process, it seemed that I was ordering a phone that would arrive on day1.  At no point did it say this was an estimate.  At no point did it say it might change.  In a big yellow box, it said "9-19".  Ordered it, then got confirmation email stating it should arrive at 9-19.   Seems like all should be good, right?  Order site said 9-19, I've got a confirmation email saying 9-19, done and done.
    Then I check the website, and suddenly it changed to 10-14?!?!?!?  I feel like this was a bait and switch.  I was able to pickup an iphone5 in a local store on launch day, and would not have locked myself into a preorder through Verizon if I had known this would happen!
    So, that leads back to the original questions.  Lets assume I walk into a Verizon store on 9-19, and there is an available iphone6 plus just sitting there, can I either get that phone as fulfillment of my pre-order.  Or, cancel my pre-order and buy that phone right then and there?
    JJK
    PS:  It seems there are many people you misled this way.  For every person who takes the time to post on this site, there are going to be many many more who are silently ****** off.

  • HP Officejet Pro 8500A Plus and I am unable to find drivers for MacOSX 10.4 Tiger

    I bought the new Office Jet Pro 8500A plus and now I cannot install it to work with my old Imac 10.4.11???
    HP only supports 10.5 onwards???
    This is unacceptable.
    Please advise how I can make this work.
    Thank you.
    Sincerely,
    JonPaul

    Hi bhappie,
    Welcome to the HP Support forums.  I gather that you are unable to connect your Officejet 8500A plus printer to your wireless network.
    This printer can be connected by an ethernet cable or connected to your wireless network but cannot support both simultaneously as referenced in the document The Printer Does Not Support Ethernet (Wired) and Wireless Network Connections at the Same Time.  To setup the wireless feature you will need to unplug the ethernet cable.  
    Your wireless printer can be easily connected to your wireless network from the front panel of your printer.  If you are unsure how to do this the instructions can be found in your User Guide on page 219 in the section titled “To set up a wireless communication using the Wireless Setup Wizard”.  
    Now that the printer has a wireless connection, any computer that uses the printer, will need to have the connection method updated.  The instructions on how to do this can also be found in your User Guide on page 221 in the section titled “Change the connection method”.  There is a sub-section dedicated to Windows operating systems and one dedicated to Mac operating systems.
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • HP Officejet Pro 8600 Plus and HP Pavilion dv7-7073ca

    1. HP Officejet Pro 8600 Plus and HP Pavilion dv7-7073ca
    2. Operating System
    Windows 7 64-bit
    3. Error messsage: Blue Screen and Crash. Can't PRINT Wirelessly or Wired + Blue Screen Of Death when printing a document with Microsoft Office. It then restarted the entire computer.
    It might have said something about BIOS
    4. Any changes made to your system before the issue occurred
    No, all I did was install the software that came on the Officejet disc
    I don't know what to do. I tried to create an adhoc network, and that didn't work. I tried to connect it via usb cable and the whole computer crashed. I tried to set up a router and then it would not connect to the internet.
    Why is this design so flawed? Every wireless printer I have had does this and will not work easily or permanently. You should just be able to connect instantly to your computer and voila, you can print. But nothing seems to work. Mind you, the constant variable here is me, and I have little patience for spending days trying to get this to work. But I am a student, and this is holding back valuable study time.
    What do I do???
    Any advice appreciated...can someone tell me step by step how to do this? I followed the instructions in the books, but ended up well...you know, so that's why I'm here.

    I had the same issue, officejet pro 8600 plus causing blue screen of death on my new computer. After several frustrating months trying everything, I fould that my new computer has 3.1 USB ports, this printer doesnt like them, they need a 2.1 USB port.
    For whatever reason USB ports are not backwards compatible, so I plugged the USB cable into the 2.1 port and no more crashes.
    3.1 ports are blue, 2.1 ports are black ( the plastic inside)
    Hope this helps

  • Plus and minus DVD format on new g5's..... Can I upgrade?

    I see on the new g5's that they list plus and minus format dvd burning cabability. Can I upgrade to that ability? The current drive is very picky about media. Memorex 8x won't work. Tdk 8x will. Tdk 16x won't . I find it very annoying. It looks like there is a multiformat drive already in my g5's. How can I make them burn both plus and minus? I am running 0s 10.4.6 Is there a better drive that is not so picky? Thanks

    What software are you using to burn with?
    If you're using software that allows you to select the burn speed (e.g. Toast), what speed are you burning at?
    Can you describe what happens when the burns don't work? Do you get an error message, does the burn just stop partway through, etc.?
    From my experience, the Pioneer is less finicky, but this is just from anecdotal evidence as I've only used Pioneer drives, with the exception of the burner in my PowerBook which is a Matsushita.
    I'm reluctant to suggest buying a new drive. Is there any particular reason that +R burning is necessary? If the students bought them and the drive doesn't like them, maybe they can exchange the unused discs. Or, it might be helpful to try several different brands (I know you've already tried Memorex and TDK). Maybe try some Maxell and Verbatim.
    The Pioneer drives can be found for between $40 and $50. One of the best things about the Pioneers is that they periodically release firmware updates to the drives to enable new media to be used and to improve burn reliability. I believe OSX 10.4.6 is the first to provide native support for a non-OEM DVR-110.

  • The plus and minus button on my headphones aren't working

    The plus and minus button on my i phone 5 headphones aren't working

    I think there are a lot of us having the same problem. Siri also doesn't work. The only thing I can use the earbuds for is turning the iPod off and on.....

Maybe you are looking for

  • Firefox won't open in normal or safe mode.

    I get a crash report each time when I try to open it normally, nothing happens when I type in the extension for safe mode. Because I can't open safe mode, the Mozilla troubleshooting guideliens cannot help me. I'm working from Windows vista, have all

  • How can I remove the Mac protector icons? I finally deleted that program but I cannot throw away the icons?

    Hi, I have a little problem. I downloaded a malware called Mac Protector, for my fault, and now I finally have deleted that program but I cannot throw away the relative icons (in my display). How can I do?

  • Bulk import error - Missing required attribute ‘fullname’

    Folks, I am having trouble trying to bulk import some users. I have the following file for import (cut down from what I really want to import): command,user,waveset.resources,password.password,password.confirmpassword,global.firstname,global.lastname

  • Is there a utility that cleans up itunes?

    Is there a utility program available that automatically cleans up things like band names... The Hollies to Hollies... makes all the genre uniform for a group/performer, corrects spelling... etc??? Thanks

  • Page menubar with/without javascript

    Hello All, I have a basic question.  I am designing a website, where the same spry menubar will be at the top of every page.  And each page of the site will have that same menu.  Now, as time goes, that menubar will change here, and there.  I wanted