Very new to sql plus

I am using sql plus by the command line, I am using the ed mode. My problem is, I have two inserts one right after another. in note pad:
insert into table values
insert into table values
('d')
The problem is only one insert gets done.
What is the correct way to write this ?
Eric

If it is the same table, you could do something like:
SQL> create table mytable(col1 varchar2(10));
Table created.
SQL> insert into mytable(col1) values(&value);
Enter value for value: ' '
old   1: insert into mytable(col1) values(&value)
new   1: insert into mytable(col1) values(' ')
1 row created.
SQL> r
  1* insert into mytable(col1) values(&value)
Enter value for value: 'd'
old   1: insert into mytable(col1) values(&value)
new   1: insert into mytable(col1) values('d')
1 row created.
SQL> select * from mytable;
COL1
d
SQL> set feedback on
SQL> /
COL1
d
2 rows selected.

Similar Messages

  • NEW FEATURE:AUTOTRACE IN SQL*PLUS 3.3(EXECUTION PLAN)

    제품 : SQL*PLUS
    작성날짜 : 2003-10-07
    NEW FEATURE:AUTOTRACE IN SQL*PLUS 3.3
    ======================================
    Autotrace는 SQL*Plus 3.3부터 지원하는 New feature로서 기존에는 init.ora에
    SQL_TRACE=TRUE를 setting 후 얻어진 trace file을 TKPROF란 utility를
    이용하여 SQL 문의 수행 경로, 각종 통계 정보를 얻었다.
    그러나, SQL*Plus 3.3부터는 이것을 간단히 처리할 수 있는 방법을 제공한다.
    1. SQL*Plus를 실행하여 scott user로 접속한 후, plan table을 생성한다.
    #sqlplus scott/tiger
    SQL>@$ORACLE_HOME/rdbms/admin/utlxplan
    2. 다음에 sys user에서 PLUSTRACE란 ROLE을 만든다.
    SVRMGR>connect internal;
    SVRMGR>create role plustrace;
    SVRMGR>grant select on v_$sesstat to plustrace;
    SVRMGR>grant select on v_$statname to plustrace;
    SVRMGR>grant select on v_$session to plustrace;
    SVRMGR>grant plustrace to dba with admin option;
    SVRMGR>grant plustrace to scott;
    비고) 위의 grant 문은 client에 SQL*Plus 3.3이 install되어 있는 경우
    C:ORAWIN95\PLUS33\PLUSTRCE.SQL이라는 script에 기록되어 있다.
    다음과 같이 실행해 주면 된다.
    1> connect sys/manager
    2> @$ORACLE_HOME/sqlplus/admin/plustrce.sql
    3> grant plustrace to scott;
    3. 다음에는 scott user로 connect하여 작업한다.
    #sqlplus scott/tiger
    SQL>set autotrace on
    SQL>select * from emp;
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 TABLE ACCESS (FULL) OF 'EMP'
    Statistics
    389 recursive calls
    5 db block gets
    53 consistent gets
    12 physical reads
    0 redo size
    1049 bytes sent via SQL*Net to client
    239 bytes received via SQL*Net from client
    4 SQL*Net round-trips to/from client
    0 sorts (memory)
    0 sorts (disk)
    13 rows processed
    4. 참고로 set autotrace에는 여러가지 option을 부여해 작업할 수도 있다.
    예)set autotrace on => Explain plan and statistics.
    set autotrace on explain => Explain plan only.
    set autotrace traceonly => select된 결과는 빼고 trace만 display
    시킴.
    set autotrace on statistics=> sql statement execution statistics.
    5. 서버 버젼과 상관없다.
    Server가 7.2 version 이하일지라도 clinet에 SQL*Plus 3.3이 install되어
    있으면 client에서 sqlplus 3.3을 구동시켜 server에 접속하여 위와 같이
    작업하면 무리없이 작업이 가능하다.
    Reference Documents
    <Note:43214.1>

    Hi Roman,
    I don't have an Oracle 9.2 database readily available, but it works fine on 10g XE. Please note 3.1 is not certified with 9i:
    http://www.oracle.com/technetwork/developer-tools/sql-developer/certification-096745.html
    Regards,
    Gary
    SQL Developer Team

  • Hide new/old value of bind variable in SQL*Plus

    Hi,
    I have a SQL*Plus script to create a new user. It asks for username & password and then passes these values to a SP to do some checks and finally create the user.
    The output is currently the following :
    New user will be created in ORCL LAB
    Enter the requested username : fleet2
    Enter the password for fleet2 : *****
    Re-enter the password for fleet2 : *****
    old 2: labadmin_cr_user('&username', '&pswd', '&pswd2');
    new 2: labadmin_cr_user('fleet2', 'fleet', 'fleet');
    The requested username is already in use in the database. Please choose another username.
    As you can see the passwords are now exposed when the procedure is called. This is not what I want off course. I cannot do termout off as the serveroutput is not shown as well in that case. I use dbms_output to show error messages to users. (see example above in case of an existing user).
    Can anybody tell me how to hide these 2 lines (old 2, new 2) without hiding my dbms_output.
    Thanks!
    Kris

    set verify offhttp://download-uk.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1013382

  • New line in SQL plus

    Hi all,
    I would like to include content with a new line into an column of a table. I would like to run the script through SQL plus but because I want a new line in this content, SQL plus determines it as the end of the query.
    e.g. update <tablename>
    set <columnname> = ' bla bla
    bla bla'
    Is there a way I can get around this?

    Joyce,
    Try:
    SET SQLBL[ANKLINES] ON
    http://download-west.oracle.com/docs/cd/B13789_01/server.101/b12170/ch13.htm#sthref2829
    Alison

  • Newer version of SQL*Plus for Linux

    Is there a newer, more featured version of SQL*Plus for Linux than 8.1.6.0.0? Where would I get it?
    Thanks.

    I have problems installing the oracle 8i client.
    i ordered the oracle servers 8i CD kit for linux .am using the standard edition to install the client.
    but am facing problems.
    the net8 configuration fails.
    what can i do?
    which CD should i look at?
    what do i need to install a client.?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Boris Mironov ([email protected]):
    Hello,
    I had some problem (mixed OS environment). I solved it by ordering Linux version from Oracle. Oracle send me Linux CD Pack (All software for Linux) with free license for SQL-client only. It means that I have no licenses for products (eg. Oracle8i EE, Oracle8i SE, WebDB, ...). Anyway, I have access to my DB-server from my Linux box and I do not need to pay extra money for licensing because we have enough user licenses for our server.
    Good luck,
    Boris<HR></BLOCKQUOTE>
    null

  • SQL*PLUS Verus using new Oracle10 xe   SQL commands window

    Can I run all manor of queries in SQL COMMAND as in sql*plus .Put another way
    does the new orcale 10 xe (SQL command window) have any restrictions at all in terms
    of code ?
    P.S. Up to now I think this DATABASE program is great.( still testing large files)
    Thanks
    Bob

    Great that's exactly the answer I was hoping to get, I am new to Oracle products
    but not new to SQL and find the new Oracle interface to be top notch compared to any
    "FREE" programs out there right now! I tried the free microsoft SQL server program
    and found almost no help or free tutorials like Oracle 10 xe has ( Way to go Oracle !)
    Thanks
    Bob

  • Issue with new line when manually executing a procedure in SQL*Plus

    The below procedure works fine in SQL*Plus when the entire EXEC <procedure_name> (parameter1, parameter2, ..); is put in 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 execute the same procedure with more readability. So, I put each parameters on a separate line and try to execute. But it is erroring 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 keywordAny workaround for this ?

    Hi Tom,
    At SQL Plus,
    You have to use the -(Hyphen) as the concatenation Operator.
    For Instance,
    SQL>  exec host_command( -
    p_command => 'dir');
    PL/SQL procedure successfully completed.
    Thanks,
    Shankar                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • VO Query runs very slow in jdev, quickly in Toad/SQL Plus

    Hi,
    I am trying to create a search application using JSF with ADF BC. I have a VO based on a SQL query, which joins two tables. The search criteria is referenced using bind parameters in the VO.
    In Toad, SQL Plus, and SQL Developer, I can run my VO query and the results return quickly, within a couple of seconds. An Explain Plan indicates that all indexes are being correctly used. However, when I try to run my search form (exact same query) in jdev, it executes extremely slowly - almost 5 minutes before a result set is returned. My VO query is below.
    select oea.order_yr,
    oea.order_type,
    oea.order_key,
    oea.max_rev,
    oeo.profit_center_id,
    oeo.contract_total_price,
    oeo.complexity
    from oe_admin oea,
    oe_order oeo
    where oea.admin_id = oeo.admin_id
    and oeo.profit_center_id = :ProfitCenter
    and oea.order_yr = nvl(:OYear, oea.order_yr)
    and oea.order_type = nvl(:OType, oea.order_type)
    I've been messing with this for several days and I'm out of ideas. Does anyone have any suggestions?

    The question is not whether the query uses a viewLink but rather do you have any other views that are linked to this view - if you do have such views you might want to check the setting for whether children are retrieved as well.
    Also run ADF BC in debug mode to see the exact query that is being sent to the server and check out the explain plan for that one.

  • Connect via SQL*Plus taking more time in Oracle 11 than in 10

    Oracle Version
    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 IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Productioncurrently migrating from
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
    NLSRTL Version 10.2.0.4.0 - ProductionOS is AIX 5.3 for Oracle 10 and AIX 6.1 for Oracle 11.
    We are currently in the process of migrating some applications from Oracle 10 to 11. Our admins have setup a new development system for us with an Oracle 11 instance. Regarding performance the new system behaves more or less the same than our old, e.g. when executing SQLs we notice hardly any performance differences and those we find are slightly in favour of the new system.
    But now we discovered that the time it takes to establish a database connection via SQL*Plus is longer on the Oracle 11 system. Running the following code
    sqlplus -s user/pw@database <<END
    quit
    ENDa thousand times takes ~60s under Oracle 10 but ~140s under Oracle 11. This may not seem much but we are running a test framework consisting of a bunch of shell scripts where several thousand connections are openend via SQL*Plus to execute some SQLs, so that even this small time difference results in rather huge difference in total runtime. The SQLs themself require roughly the same time in both databases, as already mentioned above they are in fact slightly faster in Oracle 11.
    To analyze the time difference I ran a trace for the connect with the following parameters in sqlnet.ora
    TRACE_LEVEL_CLIENT=4
    TRACE_UNIQUE_CLIENT=ONand found out that there is a time difference of about 70ms during the connect handshake:
    Oracle 10
    [22-MAR-2013 12:13:09:595] nscon: doing connect handshake...
    [22-MAR-2013 12:13:09:595] nscon: sending NSPTCN packet
    [22-MAR-2013 12:13:09:621] nscon: got NSPTRS packet
    [22-MAR-2013 12:13:09:621] nscon: sending NSPTCN packetOracle 11
    (1) [22-MAR-2013 12:15:26:812] nscon: doing connect handshake...
    (1) [22-MAR-2013 12:15:26:812] nscon: sending NSPTCN packet
    (1) [22-MAR-2013 12:15:26:906] nscon: got NSPTRS packet
    (1) [22-MAR-2013 12:15:26:906] nscon: sending NSPTCN packetUnder Oracle 10 there are 26ms between sending the NSPTCN packet and getting the NSPTRS packet, whereas under Oracle 11 this takes 94ms. I ran the trace again, this time with
    TRACE_LEVEL_CLIENT=16and got the following results for the critical interval:
    Oracle 10:
    [22-MAR-2013 13:17:37:638] nscon: sending NSPTCN packet
    [22-MAR-2013 13:17:37:638] nspsend: entry
    [22-MAR-2013 13:17:37:638] nspsend: plen=218, type=1
    [22-MAR-2013 13:17:37:638] nttwr: entry
    [22-MAR-2013 13:17:37:638] nttwr: socket 9 had bytes written=218
    [22-MAR-2013 13:17:37:638] nttwr: exit
    [22-MAR-2013 13:17:37:638] nspsend: packet dump
    <<packet dump removed>>
    [22-MAR-2013 13:17:37:638] nspsend: 218 bytes to transport
    [22-MAR-2013 13:17:37:638] nspsend: normal exit
    [22-MAR-2013 13:17:37:638] nscon: exit (0)
    [22-MAR-2013 13:17:37:638] nsdo: nsctxrnk=0
    [22-MAR-2013 13:17:37:638] nsdo: normal exit
    [22-MAR-2013 13:17:37:638] nsdo: entry
    [22-MAR-2013 13:17:37:638] nsdo: cid=0, opcode=68, *bl=512, *what=9, uflgs=0x0, cflgs=0x3
    [22-MAR-2013 13:17:37:638] nsdo: rank=64, nsctxrnk=0
    [22-MAR-2013 13:17:37:638] nsdo: nsctx: state=2, flg=0x4005, mvd=0
    [22-MAR-2013 13:17:37:638] nsdo: gtn=10, gtc=10, ptn=10, ptc=2011
    [22-MAR-2013 13:17:37:638] nscon: entry
    [22-MAR-2013 13:17:37:638] nscon: recving a packet
    [22-MAR-2013 13:17:37:638] nsprecv: entry
    [22-MAR-2013 13:17:37:638] nsprecv: reading from transport...
    [22-MAR-2013 13:17:37:638] nttrd: entry
    [22-MAR-2013 13:17:37:665] nttrd: socket 9 had bytes read=8
    [22-MAR-2013 13:17:37:665] nttrd: exit
    [22-MAR-2013 13:17:37:665] nsprecv: 8 bytes from transport
    [22-MAR-2013 13:17:37:665] nsprecv: tlen=8, plen=8, type=11
    [22-MAR-2013 13:17:37:665] nsprecv: packet dump
    [22-MAR-2013 13:17:37:665] nsprecv: 00 08 00 00 0B 00 00 00  |........|
    [22-MAR-2013 13:17:37:665] nsprecv: normal exit
    [22-MAR-2013 13:17:37:665] nscon: got NSPTRS packetOracle 11
    (1) [22-MAR-2013 13:33:40:504] nscon: sending NSPTCN packet
    (1) [22-MAR-2013 13:33:40:504] nspsend: entry
    (1) [22-MAR-2013 13:33:40:504] nspsend: plen=205, type=1
    (1) [22-MAR-2013 13:33:40:504] nttwr: entry
    (1) [22-MAR-2013 13:33:40:504] nttwr: socket 8 had bytes written=205
    (1) [22-MAR-2013 13:33:40:504] nttwr: exit
    (1) [22-MAR-2013 13:33:40:504] nspsend: packet dump
    <<packet dump removed>>
    (1) [22-MAR-2013 13:33:40:505] nspsend: 205 bytes to transport
    (1) [22-MAR-2013 13:33:40:505] nspsend: normal exit
    (1) [22-MAR-2013 13:33:40:505] nscon: exit (0)
    (1) [22-MAR-2013 13:33:40:505] snsbitts_ts: entry
    (1) [22-MAR-2013 13:33:40:505] snsbitts_ts: acquired the bit
    (1) [22-MAR-2013 13:33:40:505] snsbitts_ts: normal exit
    (1) [22-MAR-2013 13:33:40:505] nsdo: nsctxrnk=0
    (1) [22-MAR-2013 13:33:40:505] snsbitcl_ts: entry
    (1) [22-MAR-2013 13:33:40:505] snsbitcl_ts: normal exit
    (1) [22-MAR-2013 13:33:40:505] nsdo: normal exit
    (1) [22-MAR-2013 13:33:40:505] nsdo: entry
    (1) [22-MAR-2013 13:33:40:505] nsdo: cid=0, opcode=68, *bl=2048, *what=9, uflgs=0x0, cflgs=0x3
    (1) [22-MAR-2013 13:33:40:505] snsbitts_ts: entry
    (1) [22-MAR-2013 13:33:40:505] snsbitts_ts: acquired the bit
    (1) [22-MAR-2013 13:33:40:505] snsbitts_ts: normal exit
    (1) [22-MAR-2013 13:33:40:505] nsdo: rank=64, nsctxrnk=0
    (1) [22-MAR-2013 13:33:40:505] snsbitcl_ts: entry
    (1) [22-MAR-2013 13:33:40:505] snsbitcl_ts: normal exit
    (1) [22-MAR-2013 13:33:40:505] nsdo: nsctx: state=2, flg=0x4005, mvd=0
    (1) [22-MAR-2013 13:33:40:505] nsdo: gtn=10, gtc=10, ptn=10, ptc=8155
    (1) [22-MAR-2013 13:33:40:505] nscon: entry
    (1) [22-MAR-2013 13:33:40:505] nscon: recving a packet
    (1) [22-MAR-2013 13:33:40:505] nsprecv: entry
    (1) [22-MAR-2013 13:33:40:505] nsprecv: reading from transport...
    (1) [22-MAR-2013 13:33:40:505] nttrd: entry
    (1) [22-MAR-2013 13:33:40:618] nttrd: socket 8 had bytes read=8
    (1) [22-MAR-2013 13:33:40:618] nttrd: exit
    (1) [22-MAR-2013 13:33:40:618] nsprecv: 8 bytes from transport
    (1) [22-MAR-2013 13:33:40:618] nsprecv: tlen=8, plen=8, type=11
    (1) [22-MAR-2013 13:33:40:618] nsprecv: packet dump
    (1) [22-MAR-2013 13:33:40:618] nsprecv: 00 08 00 00 0B 00 00 00  |........|
    (1) [22-MAR-2013 13:33:40:618] nsprecv: normal exit
    (1) [22-MAR-2013 13:33:40:618] nscon: got NSPTRS packetAny ideas what could be the reason for this time difference? Something in our network configuration or something else?

    With local connections - I do not think a TCP packet send from an IP to the same IP, leaves the interface as an actual wire protocol/signal. If I'm correct, then running local connection tests will be mostly useless in checking the actual network infrastructure.
    Tests 3 and 4 should be showing the same connection times as the same physical network infrastructure is used - only the direction is reversed in the tests.
    I would assume that port settings on the switches and interface settings on the routers treat packets equally in both directions between 2 servers. But this could in part explain the problem if this is not the case. In a case of a router for example, the 1st test's ingress interface is the egress interface of the 2nd test (and vice versa). Configurations can differ substantially between interfaces on the same router. Likewise if there is a firewall - as different rule sets are applied in each test and these rule sets could differ.
    So I would not be too quick to state that this is definitely not a network problem. But I agree that based on the small percentage difference (assuming comparable tests), it does not look like a network issue.
    The next step is to determine what the delay is between the listener accepting the client connection, and the connection being serviced by a dedicated server process.
    This will require listener tracing - tracing the time from when the listener accepted the connection (and parsed the TNS connection string), to handing off the connection to the dedicated server process.
    As a comparison test, you can also test shared server connections. Dispatcher processes (of the db instance) register themselves with the listener. The shared server client hand off is thus done to an existing server process - no need for the Listener to make a kernel call to load and initialise an executable image.
    Shared connections are typically faster than dedicated connections in this respect.
    If there is a major time difference, then it means some kind of issue with the listener dealing with dedicated servers as oppose to dispatcher hand off's. As both connections would have had very similar network transit time - which means the connection time difference is related directly to dealing with a dedicated server connection request and hand off.
    You can also substitute the oracle executable with a wrapper - and troubleshoot the actual dedicated server startup. I've only done this with Oracle XE 10.2 though and with local IPC connections. Unsure how robust this will be for testing purposes via TCP using 11g.

  • SQL*PLUS

    I am new to oracle and I think this is a fairly simple question.
    When I log into sql*plus using the userid 'SCOTT/TIGER' it connects me to SCOTT schema
    by default.
    I have created a new schema and new users in the database with access to this new schema.
    Whenever I try to login using these new userids it always requires me to enter the new schema name in the 'Host String'. How do I set up these users to connect the new schema without entering the host string.
    I have similar problem in a pro*c program. Currently I connect to the database using following:
    strncpy((char *) db_name.arr, "sprllc", DBNAME_LEN);
    EXEC SQL DECLARE DB_NAME DATABASE;
    EXEC SQL CONNECT :username IDENTIFIED BY :password AT DB_NAME USING :db_name;
    while the examples use the 'SCOTT' user id to
    connect to 'SCOTT' schema without needing to declare DB_NAME.
    Any help is appreciated.
    Thanks
    null

    Thank you very much for your reply.
    I am running the datbase server, SQL*plus and Pro*C program on the same machine
    (Windows NT ) and I am still unable to connect without specifying the host string.
    The entry in the tnsnames.ora file for the database I am working with is as follows:
    SPRLLC =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SPRLLC)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = SPRLLC)
    What I am confused about is the I am able to connect to same database with using user ids SYSTEM and SCOTT without specifying the host string.
    Thanks again for your help.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by SHAHANI():
    Hi, lakshmi
    I think U are littlte bit confusing the term schema and User in ORACLE user and Schema are the equivalant and Host string identifies the database string which is generally ORC. If u are on the same machine having Oracle server then u are not required to give Host string. The Host String is used to access remote server.
    Let if U created the new user
    user name/schema name :- lakshmi
    P.W lak
    then to connect on local machine just say
    connect lakshmi/lak; do not give Host string.
    If U are accessing remote server then give
    connect lakshmi/lak@ORCL
    where ORCL is Host string for the remote server. It may be any valid string having entry in the home\orant\net80\admin\tnsnames.orl file
    to locate the remote server.
    <HR></BLOCKQUOTE>
    null

  • SQL *PLUS issue

    I have an unusual problem in SQL PLUS. When the SQL statement is a DML things go fine - no problem, BUT when the SQL statement is a DDL (like creating a database object )the process hangs. Things get more interesting ... if I open another SQL PLUS session and check out, I find that the DDL has done its task. But the first SQL session (where I issued the DDL) is still hanging. If anyone has any idea please do let me know. Any help would be very useful
    Thanks
    Mustafa

    The dot is used as like concatenation operator in sqlplus. If you need to add characters to the end of the variabel, you use a dot. If you need to add .chars then you need two dots.
    With a dot
    SQL> SELECT 'Say &something.not' FROM dual;
    Enter value for something: something
    old   1: SELECT 'Say &something.not' FROM dual
    new   1: SELECT 'Say somethingnot' FROM dual
    'SAYSOMETHINGNOT
    Say somethingnotand without
    SQL> SELECT 'Say &somethingnot' FROM dual;
    Enter value for somethingnot: something
    old   1: SELECT 'Say &somethingnot' FROM dual
    new   1: SELECT 'Say something' FROM dual
    'SAYSOMETHING
    Say somethingTTFN
    John

  • SQL*Plus Worksheet formating

    I have Oracle Client 8.1.7 installed in my computer, and I can't
    seem to have the desired output format with the SQL*Plus
    worksheet.
    I have a database where the tables have several column, and most
    of these columns are text with 1024 characters length. I set the
    linesize to a huge number (say 3000), the trim and trimspool on,
    and I get the results ok.
    But, when I want to do a select from a table which is much
    smaller, the worksheet is always writing the complete linesize...
    Is there a way to display the columns according to the size they
    actually have (e.g. defined by the longest element) that is
    always valid. I mean without having to set column options for
    each table.
    Thank you in advance.
    Ana

    The column width sizing rules are a little opaque. The column size is a function of things like the width that the DB thinks the column is (could be huge if a SQL function is being selected), the column name or heading width, the linesize (for very wide columns), any global format (e.g. SET NUMWIDTH), or the explicit COLUMN FORMAT.
    For consistency and portability I'd always recommend using an explicit COLUMN FORMAT. You can never tell if someone is going to run your report after previously setting a COLUMN FORMAT of the same name. Or a new database version may come out where the default datatype of a SQL function has changed. In the past this has happened when CHARs became the longer VARCHAR2s.
    I don't think Enterprise Manager's SQL Worksheet (a simplistic interface that just calls SQL*Plus in the background) is doing anything special for formatting. So COLUMN FORMAT will work fine.
    -- CJ

  • Oracle 8i SQL and PL/SQL plus

    hi everybody, i am trying from two weeks to install oracle 8i SQL and PL/SQL plus on my PC on both Windows 2000 & XP and I installed every java runtime environment I found "the old and the new" but the SETUP insists on not working though it worked on the instructor's PC smoothly without problems.

    If you are getting any errors, you should tell us. Also, you should let us know what version you are trying to install.
    A very common problem at the moment is with Pentium 4 processors. If you have a Pentium 4, search the forums to find the answer.
    Alison

  • Detecting clientside NLS_LANG setting in SQL*Plus script

    Our company has developed an application that uses an Oracle database as it backend. Companies can buy our application and run it against their own Oracle installation.
    A new version of our application often requires an update to the Oracle database schema.
    Together with new application files we send our customers an update.sql script they must run against their database using SQL*Plus.
    This update script may contain international characters like é for example:
    UPDATE SHOPS SET DESCRIPTION = 'Café'
    WHERE SHOP_ID=1We save the SQL-script file in windows-1252 encoding so the character é is encoded as 0xE9 in the script file.
    When the DBA running the upgrade script has set NLS_LANG=.WE8MSWIN1252 this works perfectly.
    When the DBA has set his NLS_LANG=US7ASCII the é gets replaced by an upside-down question mark. Other NLS_LANG settings can also be troublesome.
    To prevent this we give very clear installation instructions. However, nobody reads them. This leads to two questions:
    A) Is there a way to prevent this problem so I do not depend on the NLS_LANG setting by the DBA running the upgrade script?
    B) Otherwise: is there a way to test for the NLS_LANG setting inside the script and abort if it is not WE8MSWIN1252?
    Info:
    Database is 10.2.0.3/10.2.0.4 and sometimes 10.2.0.5, always database character set WE8MSWIN1252.
    Client software: I do not know what each DBA uses but it will be mostly 10g client software
    Client OS: Some DBA's will be running the script from Windows, others from some Unix variety. I cannot control that.

    I agree with Sergiusz. You're much better off if you can remove character set dependencies from your scripts by using commands like this.
    UPDATE SHOPS SET DESCRIPTION =  unistr( 'Caf\00E9' )
    WHERE SHOP_ID=1 ;If that's not possible however you can try this approach to determine the session's character set.
    SQL> column USERENV_LANGUAGE format a30
    SQL> column oracle_charset   format a20
    SQL> r
      1  select
      2    userenv_language
      3  , substr
      4    ( userenv_language
      5    , instr( userenv_language, '.' ) + 1
      6    ) as oracle_charset
      7  from
      8  ( select sys_context( 'USERENV', 'LANGUAGE' ) as userenv_language
      9    from dual
    10* )
    USERENV_LANGUAGE               ORACLE_CHARSET
    AMERICAN_AMERICA.AL32UTF8      AL32UTF8 --
    Joe

  • Can not query PQH_BUDGET_DETAILS in SQL*Plus

    Hi!
    I can see the Positions in the Forms-Mask within EBS.
    I want to write a concurrent Programm which queries some data form the positions-table.
    If i klick on "Help > Diagnostics > Examine" and select "system.last_query" i can see, that the data comes from a view called: "PQH_POS_BUDGETS_V".
    But if i try to query this view in SQL*Plus, it is empty.
    So i had a look at how this view is build, and i found, that the base tables should be PQH_BUDGETS and PQH_BUDGET_DETAILS.
    How can i query the position_id in PQH_BUDGET_DETAILS in a concurrent program or an self-writen BI Publisher Report?
    If i try to query in SQL*Plus it's empty.
    Who can help me with this issue?
    Thank you for your help!
    Best regards,
    Thomas

    Hi!
    Thats great!
    Thank you very much!
    Best regards,
    Thomas

Maybe you are looking for

  • HT1338 how to get money back for a paided app

    I paided for an application today called "Grand Theft Auto: San Andreas" for my MacBook Air and after it finished downloading I opened the application and it then it said, "You can not open the application Grand Theft Auto San Andreas because it is n

  • Accessibility in Acrobat Professional 8- MAC platform

    I am having issues in Acrobat Professional 8 in the accessibility section. I have a document that was originally created in InDesign CS3, then exported as a PDF and opened in Acrobat Professional. After opening I go to File- Properties and set the la

  • Dual Monitors Plus TV

    Hi, newbie here... hope you can help. I did a search on the forum but couldn't find an answer to the following... I am running a GTX 760 (driver 331.82 and enabled for mercury playback) with 2 computer monitors and a third monitor which is a decent F

  • Business package for best practces on EP 6.0

    Hello friends, The BP for Best practices on EP 6.0 is under restricted release. The documentation attached to the package asks to contact address [email protected] to participate in the restricted release implementation. But there is no response from

  • What File Type we have to pass to get the pipe delimeter ?

    Hi Sir, Am fetching data from sap and downloading it on to the desktop or any drive, here am using GUI_DOWNLOAD function module in the am passing separetor = '|' filetype = 'ASC' but in output file am not getting the pipes, see the following code. *F