running sql * more

Hello all;

I know this question has been asked several times but I'm still a little confused. I installed oracle database 10g express edition on my computer for the practice of the school. It works fine if I go to the homepage of database icon... However, there is another icon which evokes SQL * who I am trying to use to run sql on my computer but nothing happens when I type in a simple sql statement. I was just wondering how to make sql * more correctly installed on my pc so that I can use PL/SQL instructions for the code, packages, and triggers as well.

You must copy the entry in the tnsnames.ora file for the installation of xe, which is located in
C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
on Windows

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =host.xx.xxx.net)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

and edit the tnsnames.ora file from where you are running more than SQL.

For example, I have a client installed 10g, which has its own file tnsnames.ora but I also 11g XE installed.
This entry must exist in the customer 10g tnsnames.ora file if I want to connect with the version of windows
SQL Plus to Database 11g XE.

Moreover, why don't you upgrade to 11g xe?
http://www.Oracle.com/technetwork/database/Express-Edition/downloads/index.html

The final version was released earlier this month.

Tags: Database

Similar Questions

  • SQL * MORE

    Previously I had installed Oracle Database 10 g Client Release 2 (10.2.0.1.0) on Windows XP and sqlplus was ok.

    Now I have installed Oracle Database 10 g Release 2 (10.2.0.1.0) on Windows 7 Client, to run SQL more, after I entered the name of user and password @db, it comes automatically closes

    Kindly advice

    You can trigger a SR with the binary applicants Oracle for the same thing, if there is a reuirement of business.

    Kind regards

    Kundan Sinha

  • InstantClient SQL * more and glogin.sql

    SQL * more the default behavior is to
    (a) loading login.sql in the current directory
    (b) if there is no, put glogin.sql in the + $ORACLE_HOME/sqlplus/admin / + directory

    Note of support described the same behavior InstantClient (10g) in + Glogin.sql is not used with Instant Client [946528.1 ID] + too.

    The solution to InstantClient 10g is simple. Define + $ORACLE_HOME + variable, it points to your instantclient directory and create the path and the file "+... / sqlplus/admin/glogin.» SQL +'.

    However, this now seems to have changed with InstantClient 11 g. This is what the client:
    stat64("login.sql", 0xbf9f2c14)         = -1 ENOENT (No such file or directory)
    brk(0x856e000)                          = 0x856e000
    stat64("glogin.sql", 0xbf9f2c14)        = -1 ENOENT (No such file or directory)
    He seeks login.sql in the current directory - as expected. But now, it seems also to glogin.sql in the current directory - and not in a common/shared as directory + $ORACLE_HOME/sqlplus/admin / +.

    Which is just silly IMO - like why do glogin.sql now behave like login.sql ? Wait until it is in the current working directory? What is 'global' subject and forced to have a glogin.sql in every single directory you have on your client, where you run SQL * more?

    The correct behavior should be to determine the directory of the module (i.e. instantclient dir where sqlplus was executed) and then look for the glogin.sql in there.

    Am I missing something here? The old behavior can be executed somehow? Or is there a workaround that can be used?

    Hi, for me

    [http://docs.oracle.com/cd/B19306_01/server.102/b14357/ape.htm]

    especialy:

    The directory containing glogin.sql SQLPATH value. For example:

    +SQLPath=/usr/lib/Oracle/10.2.0.1/client/lib:${SQLPath}+
    Export SQLPATH

    works great!

  • Can I connect to SQL * more as SYS after connecting as a user and then run a GRANT?

    Oracle 11 g 2

    Linux RHEL 6.3

    SQL * Plus 11.2.0.2 on Windows 7

    ------------------------------------------------

    I am running a script SQL through SQL * more connected as "DOE, JOHN".

    In the SQL script, I need to connect as SYS to make a GRANT EXECUTE on a SYS package (e.g. GRANT EXECUTE ON DBMS_CRYPTO to JOHN;).

    But it fails with the following error:


    GRANT EXECUTE ON TO JOHN DBMS_CRYPTO
    *
    ERROR on line 1:
    ORA-01917: user or role 'JOHN' does not exist

    But of course, 'JOHN' are.  The rest of the SQL script is running "DOE, JOHN" without any problem.

    The code segment of SQL script in question is:

    connect sys/password as sysdba
    GRANT EXECUTE ON DBMS_CRYPTO TO ROYSECITYDATA;  <-fails here
    to connect/DOE

    Please advise on what my being the issue.

    tx103108 wrote:

    I connect to a remote database.  All dbs distance have the same instance name as they are all images.  I see where you're going (I think).  Should I try

    I'll try to connect sys/password@MYDB

    Sounds like a plan... (the instance_name returned with what you expected? or something else?)

  • Same code running in SQL * more edit the sql buffer vs = different results file

    Hello

    For the last few minutes I was scratching my head trying to understand why my little piece of code was not working.
    As a result, a sample:
    create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
    /
    declare
      booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');  
    begin
      for i in booklist.FIRST .. booklist.LAST LOOP
        dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      end loop;
    end;
    /
    When run interactively, I get the following results:
      1  create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  /
      3  declare
      4    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      5  begin
      6    for i in booklist.FIRST .. booklist.LAST LOOP
      7      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      8    end loop;
      9* end;
    SCOTT@ORCL> /
    
    Warning: Type created with compilation errors.
    
    SCOTT@ORCL> show errors
    Errors for TYPE BOOKTITLES_NT:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    2/1      PLS-00103: Encountered the symbol "/"
    So I try without the slash and get nowhere:
      1  create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  declare
      3    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      4  begin
      5    for i in booklist.FIRST .. booklist.LAST LOOP
      6      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      7    end loop;
      8* end;
      9  /
    
    Warning: Type created with compilation errors.
    
    SCOTT@ORCL> show errors
    Errors for TYPE BOOKTITLES_NT:
    
    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    2/1      PLS-00103: Encountered the symbol "DECLARE"
    8/4      PLS-00103: Encountered the symbol "end-of-file" when expecting
             one of the following:
             ( begin case declare end exception exit for goto if loop mod
             null pragma raise return select update while with
             <an identifier> <a double-quoted delimited-identifier>
             <a bind variable> << continue close current delete fetch lock
             insert open rollback savepoint set sql execute commit forall
             merge pipe purge
    So I think, maybe I'll try it in a .sql file. So I put the first fragment of code in a file, test4.sql:
    SCOTT@ORCL> get C:\Users\J\Documents\SQL\test4.sql
      1  create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  /
      3  declare
      4    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      5  begin
      6    for i in booklist.FIRST .. booklist.LAST LOOP
      7      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      8    end loop;
      9* end;
    SCOTT@ORCL>
    and run it, and it works:
    SCOTT@ORCL> @C:\Users\J\Documents\SQL\test4.sql
    
    Type created.
    
    Book number 1:Great Expectations
    Book number 2:Ulysses
    Book number 3:1984
    
    PL/SQL procedure successfully completed.
    Can someone tell me why the behavior is different when it is run from a file when it is run, well, interactive? There seems to be some limits on what you can interactively run vs. what you can run from a script.

    Thank you very much
    Jason

    SQL * more buffer cannot contain more than one return, even if you have two - create type and anonymous PL/SQL block. Thus it-error:

    Wrote file afiedt.buf
    
      1  create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  /
      3  declare
      4    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      5  begin
      6    for i in booklist.FIRST .. booklist.LAST LOOP
      7      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      8    end loop;
      9* end;
    SQL> /
    
    Warning: Type created with compilation errors.
    
    SQL> create or replace type booktitles_nt is TABLE OF VARCHAR2(100);
      2  /
    
    Type created.
    
    SQL> declare
      2    booklist booktitles_nt := booktitles_nt('Great Expectations','Ulysses','1984');
      3  begin
      4    for i in booklist.FIRST .. booklist.LAST LOOP
      5      dbms_output.put_line('Book number ' || i || ':' || booklist(i));
      6    end loop;
      7  end;
      8  /
    Book number 1:Great Expectations
    Book number 2:Ulysses
    Book number 3:1984
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    SY.

  • Problem with the new line when you manually run a procedure in SQL * more

    The procedure below works fine in SQL * more when all EXEC < procedure_name > (parameter1, parameter 2,...); is placed on a single line
    SQL > exec cust_admin_util.create_schema (P_SCHEMA_NAME => 'SCOTT_01', P_SCHEMA_PWD => 'scott123', P_TBS_NAME => 'TRAG_TBS', p_temptbs_name => 'TEMP' );
    
    PL/SQL procedure successfully completed.
    I wanted to perform the same procedure with readability. So, I put each parameter on a separate line and try to run. But it's the slightest mistake out.
    SQL > exec cust_admin_util.create_schema
    (
    P_SCHEMA_NAME => 'TESTUSR_01',
    P_SCHEMA_PWD => 'scott123',
    P_TBS_NAME => 'TRAG_TBS',
    p_temptbs_name => 'TEMP'
    );BEGIN cust_admin_util.create_schema; END;
    
          *
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'CREATE_SCHEMA'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    
    
    SQL >   2    3    4    5    6    7
    P_SCHEMA_NAME => 'TESTUSR_01',
    *
    ERROR at line 2:
    ORA-00928: missing SELECT keyword
    No work around for this?

    Tom wrote:

    No work around for this?

    BEGIN
    cust_admin_util.create_schema
    (
    P_SCHEMA_NAME => 'TESTUSR_01',
    P_SCHEMA_PWD => 'scott123',
    P_TBS_NAME => 'TRAG_TBS',
    p_temptbs_name => 'TEMP'
    );
    END;
    /
    

    SY.

  • trying to get used to sql * more running and creating a simple procedure

    Hello all;

    I'm getting used to sql * more after using for a while using pl/sql developer.

    I am trying to create a simple procedure and run it. See my procedure below
    create or replace procedure test(t in varchar2(200), limit in number(30))
    begin
    select tbl_report.id from tbl_report where tbl_report.id like '|| t ||%' and rownum <= limit;
    end test;
    and then I type in run hr.test ("J", 10); to run this and then press ENTER, and it does nothing. How can I run and create a simple procedure in sql * more

    Hello

    In addition to all the good points, others have done:

    When you issue a SELECT statement in SQL * Plus (or any other front end) two things happen:
    (1) a result set, containing the results of your query, is produced, and
    (2) this result set is displayed.
    Given that these two things are always done together, it is easy to forget that they are two different things.
    In PL/SQL, you must explicitly do something to catch the result set, and you must explicitly do something else to view it (if you want to display it).

    A simple way to get the result set is to use a cursor FOR loop, to extract a line at a time and run code with this line in a record variable (called the country in the example below).
    View the results is to call dbms_output.put_line.

    Here is an example:

    CREATE OR REPLACE PROCEDURE     test
    (       t       IN      VARCHAR2
    ,     lmt      IN     NUMBER          -- LIMIT is an Oracle keyword; best not to use it as a variable name
    )
    IS
    BEGIN
        FOR  country  IN ( SELECT  country_name
                          FROM    hr.countries
                     WHERE   country_name     LIKE t || '%'
                     AND     ROWNUM          <= lmt
                   )
        LOOP
            dbms_output.put_line (  country.country_name
                        || ' = country_name'
                        );
        END LOOP;
    END test;
    /
    SHOW ERRORS
    

    You can use variables, such as t and lmt, in the query without using dynamic SQL, as long as the variables do not have the same names as the columns in the table. In this case, t and lmt are good names; country_name or region_id wouldn't. (In fact, t is a reputable insofar as it cannot be confused with a column in the table of the country. T is not a good reputation in the sense that it does not give much information about what contains the variable, or how it is used. Why not call the variable target_name or name_a_trouver?

    You can run the SQL procedure * more like this:

    SET     SERVEROUTPUT     ON
    
    EXEC  test ('I', 2);
    

    If you issue the SET SERVEROUTPUT ON command, then you will not see the output of dbms_output. You must only issue the command SET SERVEROUTPUT ON once per session, but nothing bad happens if you do it more than once.

    When I ran the procedure as stated above, I got this output:

    Israel = country_name
    India = country_name
    

    Notice that "The Italy" does not appear, because lmt has 2.

    Do not create your own procedures, tables or other objects in the HR schema, or among all the other patterns created by Oracle. Create your own schema and create procedures and other objects in it.

  • SQL comment in "sql * more ' runs inside.

    See code below. Why I get after release:
    SQL>  /*select sysdate from dual*/
    
    SYSDATE
    ----------
    16.08.2010
    I have enterd only a comment why it comes out as a command? Is there a solution for Sql * more so that he would interpret "/ * aa * /"-style comment as true comment? ".
    SQL*Plus: Release 10.2.0.3.0 - Production on E Aug 16 14:17
    
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    
    
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 -
    With the Partitioning, OLAP and Data Mining options
    
    SQL>  /*select sysdate from dual*/
    SP2-0103: Nothing in SQL buffer to run.
    SQL> select sysdate from dual;
    
    SYSDATE
    ----------
    16.08.2010
    
    SQL>  /*select sysdate from dual*/
    
    SYSDATE
    ----------
    16.08.2010
    
    SQL> /* select sysdate from dual */
    SQL> select sysdate from dual;
    
    SYSDATE
    ----------
    16.08.2010
    
    SQL> /* select sysdate from dual; */
    SQL> select sysdate from dual;
    
    SYSDATE
    ----------
    16.08.2010
    
    SQL> 

    I don't know, but it's because
    entry has / SQL more will take place the last executed query.
    So in / * select sysdate from double * /.
    Maybe sqlplus takes just the first and therefore the executed query previously running

  • Cannot run PL/SQL using SQL * more

    Hello

    I am very new in the SQL environment. I want to run the following PL/SQL code, which should allow me to send an e-mail, using sql * more:

    DECLARE
    l_mailhost VARCHAR2 (64): = "qiudubcorrel001.qa.local";
    l_from VARCHAR2 (64): = "[email protected]";
    l_to VARCHAR2 (64): = "[email protected]";
    l_mail_conn UTL_SMTP.connection;
    BEGIN
    l_mail_conn: = UTL_SMTP.open_connection (('10.253.14.240'), 25);
    UTL_SMTP. HELO (l_mail_conn, '10.253.14.240');
    UTL_SMTP.mail (l_mail_conn, l_from);
    UTL_SMTP. RCPT (l_mail_conn, l_to);
    UTL_SMTP. Data (l_mail_conn, 'single string message.' |) Chr (13));
    UTL_SMTP. Quit (l_mail_conn);
    END;

    When I type the code above in sql * Plus, it does nothing but waiting just as if the code is incomplete and he expects something more! Could someone tell me what is the problem here?

    Thank you
    Kamal

    Hello

    Try to put a / on a new line after END;

    Concerning
    Peter

  • Run (or re-run) orders in the SQL * more buffer

    I'm confused about sql / command. by defination, it run (or re-run) orders in the SQL * more buffer. How do I know if it execete or re - run a command?
    for example, I run a select statement, seems that I have to type / for the result. When I run a create table statement, it seems to run twice with / and table I is error.

    Someone could clearify when must - be used and when not to use it.

    As suggested Aman, that's the difference between a pl/sql block and a SQL statement (DDL or DML).

    The semicolon is therefore not a part of SQL when you enter a statement SQL, SQL * Plus knows and will execute the statement as soon as she sees a point comma (which ends with the statement), or slash (run the buffer).

    But a semicolon is a pl/sql statement terminator. So when you enter a pl/sql block, SQL * Plus keeps accepting lines of code until you have finished and then send the entire block to the database when you type a slash. This is also true when you enter CREATE PROCEDURE etc.

  • SQL * more the 'timing' in SQL Developer command

    I installed SQL Developer version 4.1.1.19. In the sql worksheet, how can I use SQL * more order 'timing' in a script to see a time elapsed SQL? The "Timing" on 'set' did not return any info after running SQL, and 'calendar beginning mon_timer' back 'command Timing is obsolete. Help, please.

    Thank you

    • As you can see, there is no calendar information in the script output log.
    • Then I tried on the discussion forum, found it can be enabled in "tool > preference > Database > startup script" and set as startup script:

    Set serveroutput on

    set timing on

    • However, 2 questions are:
    1. the calendar that he returned is NOT the elapsed time of my stored procedure to run. He simply choose the 2 time points its time, before and not after MS point run. Set timing on is therefore not a solution for me.
    2. He did not follow the instructions in the startup script. After that I put the calendar in the startup script, stop & restart SQL Developer, same laptop charging, timing still on. The only way to turn off now is to configure it to NOT use

    any startup script.

    • Then I developed my own coding as a solution:

    3. control of the COIL

    VAR bv_start_ts VARCHAR2 (30)

    VAR bv_end_ts VARCHAR2 (30)

    VAR bv_elps_ts VARCHAR2 (30)

    DECLARE

    v_start_ts VARCHAR2 (30);

    BEGIN

    SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_start_ts FROM DUAL;

    : bv_start_ts: = v_start_ts;

    END;

    /

    IMPRESSION bv_start_ts

    EXEC pmsmmi.rpt.rpt_ethncty_race_smry (15);

    DECLARE

    v_end_ts VARCHAR2 (30);

    BEGIN

    SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_end_ts FROM DUAL;

    : bv_end_ts: = v_end_ts;

    END;

    /

    IMPRESSION bv_end_ts

    EXEC: bv_elps_ts: = TO_CHAR (TO_TIMESTAMP (: bv_end_ts, 'yyyymmddfxDyhh24miss.ff6')-TO_TIMESTAMP (: bv_start_ts, 'yyyymmddfxDyhh24miss.ff6'), 'hh:mi:ss.ff6');

    IMPRESSION bv_elps_ts

    SPOOL OFF

    • Then I got what I want, the answer is in the 'PRINT ': bv_elps_ts

    SQL > VAR bv_start_ts VARCHAR2 (30)

    SQL > VAR bv_end_ts VARCHAR2 (30)

    SQL > VAR bv_elps_ts VARCHAR2 (30)

    SQL > DECLARE

    v_start_ts VARCHAR2 (30);

    BEGIN

    SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_start_ts FROM DUAL;

    : bv_start_ts: = v_start_ts;

    END;

    /

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:00.031

    SQL > PRINT bv_start_ts

    BV_START_TS

    -----------

    20150702Thu112617.775545

    SQL > EXEC pmsmmi.rpt.rpt_ethncty_race_smry (15)

    PL/SQL procedure successfully completed.

    SQL > DECLARE

    v_end_ts VARCHAR2 (30);

    BEGIN

    SELECT TO_CHAR (SYSTIMESTAMP, 'yyyymmddfxDyhh24miss.ff6') INTO v_end_ts FROM DUAL;

    : bv_end_ts: = v_end_ts;

    END;

    /

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:00.062

    SQL > PRINT bv_end_ts

    BV_END_TS

    ---------

    20150702Thu112630.805786

    SQL > EXEC: bv_elps_ts: = TO_CHAR (TO_TIMESTAMP (: bv_end_ts, 'yyyymmddfxDyhh24miss.ff6')-TO_TIMESTAMP (: bv_start_ts, 'yyyymmddfxDyhh24miss.ff6'), 'hh:mi:ss.ff6')

    PL/SQL procedure successfully completed.

    SQL > PRINT bv_elps_ts

    BV_ELPS_TS

    ----------

    + 00:00:13.030241000 000000

    SQL > SPOOL OFF

  • SQL * more substitution vs bind variable question

    Hi all, I am trying to automate some SQL within SQL codes * more script that is triggered by a script .bat, the only parts that change are Dates...

    example:

    create table blah as

    Select * from table

    WHERE DATE between start_date and END_DAY;

    the DATE is a numeric field, YYYYMMDD

    The script runs always at the beginning of a new week, so a Monday, unless a public holiday, then a Tuesday.

    The END_DAY is * always * last Friday and I realized that:

    variable L_FRIDAY char (15);

    Start

    Select to_char (next_day(sysdate-7,'FRIDAY'), 'YYYYMMDD') as Last_Friday in: double L_FRIDAY;

    end;

    /

    The thing is that I get an error when I try to use the binding variable?

    create table blah as

    Select * from table

    WHERE DATE between start_date and: L_FRIDAY;

    Then once I found the end date, I was going to use add_months(L_FRIDAY,-12) for previous 12 months for the start_date...

    When I tried to use a variable Substitution I could just hard code the date, but I can not or do not know how to set the value of this exec to the variable?

    Help!

    :-)

    Basically my research reveals that - Bind variables are not allowed for operations of data definition, use substutions instead of bind variables

    I need an automated way to find the END_DAY which is last Friday and START_DATE that is 12 months before Friday and refer to those in the SQL without errors.

    Hello

    Kodiak_Seattle wrote:

    Hi all, I am trying to automate some SQL within SQL codes * more script that is triggered by a script .bat, the only parts that change are Dates...

    example:

    create table blah as

    Select * from table

    WHERE DATE between start_date and END_DAY;

    the DATE is a numeric field, YYYYMMDD

    The script runs always at the beginning of a new week, so a Monday, unless a public holiday, then a Tuesday.

    The END_DAY is * always * last Friday and I realized that:

    variable L_FRIDAY char (15);

    Start

    Select to_char (next_day(sysdate-7,'FRIDAY'), 'YYYYMMDD') as Last_Friday in: double L_FRIDAY;

    end;

    /

    The thing is that I get an error when I try to use the binding variable?

    create table blah as

    Select * from table

    WHERE DATE between start_date and: L_FRIDAY;

    Then once I found the end date, I was going to use add_months(L_FRIDAY,-12) for previous 12 months for the start_date...

    When I tried to use a variable Substitution I could just hard code the date, but I can not or do not know how to set the value of this exec to the variable?

    Help!

    :-)

    Basically my research reveals that - Bind variables are not allowed for operations of data definition, use substutions instead of bind variables

    I need an automated way to find the END_DAY which is last Friday and START_DATE that is 12 months before Friday and refer to those in the SQL without errors.

    Or SQL * more bind variable or variable substitution can be DATEs.  The best you can do is set a different type, as a string, representing a date.  A string as June 19, 2015"represents a date, but so strings like 'SYSDATE' and ' SYSDATE - 7', so you can do something like this:

    SET l_friday = ' NEXT_DAY ((SYSDATE-7), 'FRIDAY').

    DEFINE start_date = "ADD_MONTHS (& l_friday, - 12)"

    SELECT & start_date AS t_n

    , & l_friday AS l_f

    OF the double

    ;

    Output (when executed on 25 June 2015):

    L_F T_N

    ----------- -----------

    June 19, 2014 19 June 2015

  • can the run/run .sql script in another application?

    Hello..

    I have a problem to run my .sql script (for example: @c:\Users\test.sql) in my netbeans application. There is no problem when I want to run/run my sql query (for example: "select * from...").

    But when I want to run my script, no presentation of the result. my script content my query to export to the csv file.

    script: @c:\Users\test.sql

    in the script:

    coil c:\Users\test.csv;

    ' Select ' ' ' | LOT_NUMBER | « «, » » || DEVICENUMBER | « «, » » || DEVICENAME | « «, » » || STEP_NAME | « «, » » || INSERT_DATE | « «, » » || STATUS | « «, » » || DISPOSEDBY | « «, » » || ACCEPTBY | « «, » » || AVAILABLE | « «, » » || GENDISPOSITION | » » »

    of RF_LOT_ON_HOLD_LIST;

    spool off;

    Thank you.

    bunch

    Yes, we know what talking about your question.

    a .sql script is just a plain text file containing everything you want.  The code in it can be a pure SQL statements, it may contain of the PL/SQL code, and it can also include SQL * more specific orders (keep in mind SQL * more is a tool, not a language, so that these commands are specific to this tool and other tools which can also interpret the same commands).

    Not quite sure how your question relates to this blog, as this blog is showing the code that gets the data in JSON format in a jqGrid (jQuery grid?) and then exports the data in an Excel file.

    What you're trying to do is to take a series of SQL * Plus and SQL statements in a text file and generate a CSV file from them.

    As already mentioned, SPOOL is a SQL * more order, specific to SQL * more command line tool.  The database itself has no idea what "spool" means, while passing to the database somehow does not work.  I also doubt that netbeans knows what that means, either.

    So, in short, how you try to do, not you cannot.

  • Special characters could not load DB via SQL * MORE

    Hi, I have a pl as .accidentally sets sql script which will insert data in database. The question is there are some records are missing and these missing records contains a special character: Sansao and Strasse. The strange was if I run the script via F5 (Toad), all data can be inserted successfully but run through SQL * MORE (Toad), all records that contain special characters are not inserted.

    Anyone here know why it didn't load these special characters via SQL * MORE?

    Probably because you have given unicode (multi byte charsets) you read with a customer of standard single-byte character set.

    It's SILLY to loading data using SQL * more. It's the wrong tool used for loading the data. It does not support the bind variable. It doesn't support liaison in bulk. It does not support direct path inserts. It is not SQL * Loader.

  • SQL * more wild returned data String - spaces (required) are abandoned in character data

    Does anyone know how to preserve the credibility of a string returned by using SQL * more variable substitution for use in a title column.

    I am under SQL * more script and the output of the securities. I need to find out the name of the company (in the text name of the legal entity). However, the substitution variable returns / outputs the data to the correct record, but corrupts the content of the returned string by spaces dropping (necessary)?

    In the script below, I tried several combinations to include using a technique of faking the output as a formula in Excel. It is very effective with the attack anywhere to Oracle/Microsoft problem at the output to Excel. For some varieties in solution, there are two methods to fill the Legal_Entity_Name which each produce the same corrupt result. I use method 2 because it's a little more friendly.

    The output is directed to a local directory C:... If you try to run this script... note the output in the script path is c:\Ora_scripts\Corrupt_Example.xls coil;

    In the database, EBS R12, the correct output should be: Industrias Selkirk of Mexico S de RL de CV . (IN THE SCRIPT, THE SAME SELECT STATEMENT IS USED AS THE MAIN QUERY - IT PRODUCES A CORRECT RESULT).

    However, data is corrupted to: IndustriasSelkirkdeMexico.

    Here's a testable script:

    --@C:\Ora_Scripts\Corrupt_String_Script.SQL

    trigger the echo

    went to CHECK

    moved the markup html off the coast of the coil

    Leave your COMMENTS

    Set trimspool on

    delete columns

    clear breaks

    clear the buffer

    Disable CALCULATED

    TOPIC on the value

    set PAGESIZE 50000

    Set LINESIZE 500

    NewPage 0 value

    set TERMOUT off

    -The variable definitions Section.

    Undefine g_Registration_Id

    Set g_Registration_Id = 12033;

    Cancel the Instance definition;

    Set the Instance = "XXXXXX";

    Undefine Time_Stamp;

    Define Time_Stamp = "DD-Mon-YYYY hh ';

    Undefine sv_Legal_Entity_Name

    Bnd_Legal_Entity_Name variable Char (75)

    Variable bnd_Registration_Id number

    --

    -Fill in the title and the title of the data items.

    -Company name get - method 1

    / * Start

    Select xrg. Alternate_Registered_Name in: bnd_Legal_Entity_Name

    of apps.xle_registrations xrg

    where xrg. Source_Table = "XLE_ENTITY_PROFILES."

    and xrg. Registration_Id = & g_Registration_Id;

    End;

    /

    -Transfer the value of the variable binding to the variable substitution

    Column sv_Var_1 sv_Legal_Entity_Name noprint new_value

    Select: bnd_Legal_Entity_Name double sv_Var_1;

    */

    --

    -Company name method retrieves 2

    Run: bnd_Registration_Id: = & g_Registration_Id;

    Column sv_Legal_Entity_Name sv_Legal_Entity_Name FORMAT A75 noprint new_value

    -Try in the form of Excel formula - no luck!

    -Select ' = ' ' | xRG. Alternate_Registered_Name | «"«as sv_Legal_Entity_Name»»»

    Select xrg. Alternate_Registered_Name as sv_Legal_Entity_Name

    of apps.xle_registrations xrg

    where xrg. Source_Table = "XLE_ENTITY_PROFILES."

    and xrg. Registration_Id =: bnd_Registration_Id;

    --

    Column Instance_Col by Instance NOPRINT new_value

    Select the name as Instance_COL in apps. Fnd_Apps_System;

    --

    Column Time_Stamp_Col new_value Time_Stamp NOPRINT

    Select to_char (sysdate, "Mon-DD-YYYY HH24:MI:SS) as Time_Stamp_Col

    From Dual;

    --

    the forage value off markup html on spool

    coil c:\Ora_scripts\Corrupt_Example.xls;

    TTITLE-

    Skip - 0

    'Arguments' left... »-

    Jump - 1

    Center & sv_Legal_Entity_Name-

    Jump - 1

    Right ' run: ' Time_Stamp-

    Center "it is a centered string constant;

    Jump - 2

    -Various declaration of Variables.

    the forage value off markup html on spool.

    HEAD ' < title > example string of corrupt < /title >.

    < style type = "text/css" >-

    table {background: white; do-size: 80% ;}} -

    Th {background: #ccc ;}} -

    TD {padding: 0px ;}} -

    < / style > '

    --                        Mainline query                                      --

    -REPLICATE THE SELECT USED TO DERIVE THE LEGAL_ENTITY_NAME TO THE TITLE

    Select xrg. Alternate_Registered_Name

    of apps.xle_registrations xrg

    where xrg. Source_Table = "XLE_ENTITY_PROFILES."

    and xrg. Registration_Id = & g_Registration_Id;

    -Liquidation of script.

    spool off;

    moved the html markup;

    Here is output (open in Excel):

    Arguments...
    IndustriasSelkirkdeMexico
    It is a centered string
    constant
    Run: 14 October 2014 10:10:45
    ALTERNATE_REGISTERED_NAME
    Industrias Selkirk of Mexico S of CV RL

    Hello

    Just use double quotes... First test: with x.sql container

    trigger the echo

    delete columns

    TOPIC on the value

    set PAGESIZE 50000

    Set LINESIZE 500

    NewPage 0 value

    set TERMOUT off

    -The variable definitions Section.

    Undefine sv_Legal_Entity_Name

    Column sv_Legal_Entity_Name sv_Legal_Entity_Name FORMAT A75 noprint new_value

    TTITLE-

    Skip - 0

    'Arguments' left... »-

    Jump - 1

    Centre '& sv_Legal_Entity_Name ' -.

    Skip 1

    SELECT 'test ttitle' FROM dual;

    running the script, providing a ttitle (slightly different from yours ;-), I have):

                                                                                                       Industrias Belgica ;-) Selkirk

    ' TESTINGTTITLE

    --------------

    test ttitle

    Best regards

    Bruno Vroman.

Maybe you are looking for

  • IMessage will use the telephone number; use a colurriel instead

    I had no service iphone since February, so I only use imessage on wifi. Today, however, he ceased to imessages send my phone number, and I don't know what to do. I tried to turn on and off imessage but it said activation pending and send & receive th

  • How to customize the cursor

    Hello I'm simulating a mobile box on a straight path. So, basically, I want to show where the box when time passes. I think that I can use "horizontal slide" but I need to customize the cursor so that it displays the size of my mailbox. How can I do?

  • Impossible to multi monitor in windows xp

    I got a PC by a family member and wish to multi monitor. Indicates the PC have windows XP. When I access the control/display panel etc. There is no available in multi monitor option. I've never experienced this before. Can someone give me advice plea

  • BlackBerry Q10 "no entry in this point of view".

    Q10 Auto upload new version OS 10.2.1.2102. The lonely No. screen text message anything. "not entrΘes in this view. Someone has seen this and is there a solution? Thank you.

  • Internal and external links do not work in this page

    It's so simple, but does not work.  I have my text for the internal link highlight and drag the Point to the icon of the file to my folder.  Everything seems good.  I save the file and upload it to my host server.  I loaded the page and refresh to ma