Small doubt in query

Hi
SQL> CREATE TABLE char_test (col1 CHAR(10));
Table created.
Elapsed: 00:00:00.03
SQL> INSERT INTO char_test VALUES ('qwerty');
1 row created.
Elapsed: 00:00:00.00
SQL> SELECT col1, length(col1), dump(col1) "ASCII Dump" FROM char_test;
COL1 LENGTH(COL1)
ASCII Dump
qwerty 10 Typ=96 Len=10: 113,119,101,114,116,121,32,32,32,32
Elapsed: 00:00:00.02
SQL>
Please explain the bolded one. 10 Typ=96.
Thanks in advance.
-SATHYA

Hi,
CHAR datatype is always blank padded if you are storing any value less than the specified length.
See the below link:
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14261/datatypes.htm#BABGIHIJ
Regards

Similar Messages

  • Doubt in Query designer

    Hi all:
    I have a doubt in Query ...
    I have an infocube for GR quantities and other infocube for confimation quantities.
    In a multiprovider,i collect this two cubes.In query designer,if i given GR date as i/p,
    confirmation quantities doesnt display.IF i didnt give GR date as i/p,then both GR and Confimation
    quantities display in seperate line.In that case if i see the confirmation quantitis column,GR quantity is
    and same for GR quanitiy.
    Waiting for your inputs.
    Rgds
    MSK

    MSK,
    These two pieces of information are at different levels. GR Date is mapped only to the GR quantities cube and no mapped to the confirmation quantities cube.
    Map GR date in the multi-provider to a date in the confirmation quantities cube.
    Aneesh

  • Small doubts regarding devices and permissions

    Hill all,
    Continuing with my experiences with Oracle 11gR2 and Solaris 11, i came up with some "small" doubts regarding the permissions and owners of the devices to be used as ASM diskgroups. I was able to install Grid and the database, both 11.2.0.3.0, in a single-instance configuration, but i had a small issue when creatind the diskgroup for the database data (+DATA). I created 3 devices (VirtualBox) to be used in the +DATA dg, and gave the the "oracle:dba" owner, with the permission 660. My doubts are:
    1) It wouldn't be more correct to make the owner of the device the user grid? (grid:dba)
    2) The permission 660 to the devices is the correct, or recommended permission? It did work with this permission.
    Thanks in advance.

    It depends on the user and group that runs the ASM instance. It can be oracle/dba, but can also be a different user, e.g. grid/asmadmin
    http://docs.oracle.com/cd/E11882_01/install.112/e22489/storage.htm#CHDFAGJD
    660 means rw. That should be ok. No other user/group than the ASM instance needs to access the devices.

  • Urgent--- small doubt

    Hi
    I need some docs for 8i installation on win2K. Also I've a small doubt.... I want to move one database (8.1.7.4) to a new server. On this new server I have to install Oracle 8.1.0...... Now the doubt is if I do backup/restore from the old server, do I still have to apply patch 4 on the new server???
    Any input is appreciated.
    Regards

    Hi,
    I suggest you apply the patch becuase the database backup has the version info which is 8.1.4. Thus when you will use the 8.1.0 Oracle kernel to start a 8.1.4 database then it might give an error. It is best suited to apply the patches in the new server the way it is in the old one. Once you have applied the patches in Oracle kernel (Oracle Software) you may go ahead with opening the database.
    This will keep the versions of the Oracle kernel and the version info in the database control file in sync.
    Regards.

  • Small doubt in select query

    i want to count the no. of employees whose endda = '31/12/9999' and stat2 = '3'.
    tables are pa0000.
    can anyone tell me the select query?

    DATA: w_noemp TYPE i.
    SELECT COUNT(*) INTO w_noemp FROM  pa0000
           WHERE  endda  = '99991231'
           AND    stat2  = '3'.

  • Small Doubt Regarding SY-MANDT

    Hi All,
         SELECT changenr FROM cdhdr CLIENT SPECIFIED INTO CORRESPONDING FIELDS OF TABLE it_cdhdr
                                             WHERE mandant = syst-mandt
                                             AND   objectclas = 'MATERIAL'
                                             AND   objectid   = wa_matl-matnr
                                             AND   tcode      = 'MM02'.
         I have written the select stament as shown above.
         In this i have a doubt like adding a field sy-mandt  in the where condition will increase the Efficiency of program or not.
    regards,
    raghu.

    Hi..
    No doubt the efficency would be affected but from business point of view there will many  things that need to be checked as in:
    If you are viewing data from CDHDR and CDPOS which is client specific then you are not viewing complete data.
    These tables give us and document changes made to a particular object in SAP but if anything is cross client like company code(lets assume) then changes to it wont be visible in all the clients..
    so there can be some key information you can miss out while working on some of the objects.
    else in this case its good to make query cross client.
    regards
    vishal

  • Doubt in query statement in receiver jdbc

    HI
    Again a doubt in XML format for receiver jdbc.
    I want to execute a query
    select sum(col1) sum(col2) from tablename where startdate <= tdate.
    My payload message looks like this
    <AggregateFn action="SQL_QUERY">
      <access>SELECT sum(Weight) FROM KmFuelTrace WHERE resourceno = '$resno$' AND startdate = '$sdate1$'</access>
    - <key>
      <resno compareOperation="EQ">CHILLED_02</resno>
      <sdate1 compareOperation="LT">06/08/2007</sdate1>
       </key>
      </AggregateFn>
    I am getting a error "Data type mismatch in criteria expression" .
    I have defined the datatypes correctly with DateTrans function . I think its the problem with access statement.
    How to give the selection criteria for non-text fields. (can i use same quotes and dollar combination for date field too) . Or is there any other mistake in the xml structure

    Aarthi,
    Try the following
    <AggregateFn action="SQL_QUERY">
    <access>SELECT sum(Weight) FROM KmFuelTrace WHERE resourceno = '$resno$' AND startdate = $sdate1$</access>
    - <key>
    <resno compareOperation="EQ">CHILLED_02</resno>
    <sdate1 compareOperation="LT">06/08/2007</sdate1>
    </key>
    </AggregateFn>
    Also check what us the date format that database uses and give the similar format.
    Regards,
    Sudharshan N A
    Message was edited by:
            Sudharshan Aravamudan

  • Regarding Doubt in Query

    Hi Friends,
    I have a doubt in Oracle Query.
    Query
    SELECT ID FROM LIST;
    ResultSet
    1
    2
    3
    4
    5
    789
    In the above query the result will in seperate rows, bu i want it as
    1,2,3,4,5.............,789.
    Can anyone help me to write a query for this type of output.
    Thanks,
    Dick....

    with t as(select 1 col1 from dual
    union select 2 from dual
    union select 3 from dual
    union select 4 from dual
    union select 5 from dual
    union select 6 from dual)
    select   ltrim(max(sys_connect_by_path(to_char(col1),',')),',') col1
    from (select col1,
           row_number() over(order by col1) r1,
           row_number() over(order by col1)-1 r2
          from t)
    start with r1 = 1
    connect by prior r1=r2;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Character string buffer too small (select list query based LOV)

    Hi,
    Using the select list query based LOV with a select witch is too big, you get this error.
    report error:
    ORA-20001: Error fetching column value: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    When using the Popup LOV query based LOV) then it works nice.
    Can that be solved somehow?
    With the Popup LOV the return value is displayed in stead of the description.

    Hi Andy,
    How do I incorporate your suggestion on a report ?
    Example : I have
    select apex_item.display_and_save(1,column1,5) col1,
    apex_item.display_and_save(2,column2,5) col2 ,
    apex_item.popup_from_query(3, emp_name, 'select user_name, name  empname from table2) col3
    Table 2 is a long list , and I'm getting string buffer too small due to this.
    Your suggestion with HTP is good but I'm not sure how to implement it for reports as I'll like the user to change the values with the select_list.
    I'm not using forms as they want mulit-record on the same page.
    Hope to hear back from you soon.
    Thanks very much.

  • A small doubt in credit management

    hi,
    i have a small query related to credit management, 
    Eg: For customer XXX there is 1000/- as credit limit.  He has used all the total amount which is shown in credit exposure 999%.
    How the system behaves or what is the impact on credit exposure that is 999% for this customer when it comes to raising of credit memo request to the same customer let's take credit memo request value is 100/-.
    please explain.
    regards,
    balajia.

    Hello Friend,
    See basically the Credit Management Works as:
    1. Every Invoice & Debit Memo increses the Debit Amount which is Receivables from Customers. Thus this increases the Credit exposure.
    2. Every Credit Memo decreases the Debit Amount (as it is a Credit entry) which decreses the Receivables from Customers. Thus thus this reduces the Credit exposure & the percentages...
    Hope this clears...
    Thanks,
    Jignesh Mehta

  • Doubts in Query & Infoset Builder

    Hi All,
    I have a problem/doubt with my query, Due to a requirement I have to place a Check box in my Selection scree of Query.
    Unfortunately when I place my Checkbox in Info-set(SQ02), Its showing check Box at first place.
    Example:
    We have a Query with selection screen fields as
    MBLNR
    MJAHR
    MATNR
    MENGE
    Now When I add a Checkbox in SQ02 & when I run the report, I am getting this Checkbox, at Top of selection screen.
    Actually I am looking to have this Check box after my selection-screen elements.
    I tried with Sequence on selection-screen, but its only working with the fields declared in Selections.
    Is there any chance like I can declare my Selection screen parameters in the position I want.
    Please advice me.
    Thanks,
    Dileep .C

    user10447332 wrote:
    (!)select * from emp where rownum>5
    it wont give o/p/what is the reason.
    if we mention rownum<=5 then it gives o/p what is the reasonIts because rownum is applied to the row at the last stage of fetch. It is applied to the row which would be displayed to the user. So after your row is ready to be shown to the requester, it is assigned rownum as 1 and then oracle checks if it is greater than 5. Since the result is false, this row is rejected and next row is given rownum as 1 and checked again. Since all rows would fail (as all rows would be assigned as rownum 1) you would get no rows selected.
    (2)
    i have two data bases. i want to import 2 tables from database1 to data base2.how to do it.
    Well you can use
    - exp/imp
    expdp/impdp
    copy commmand
    db link
    (3)i have servers at 3 locations us,uk,asia.
    if data is changed in one server.it should reflect in all servers.
    if we query from any server we have to get same result how to do it.You can use
    materialized view
    oracle streams
    3rd party tool like golden gate
    (4)
    i have data in excel file.i want to load data from excel file int o my tavble .how to do it(dont use sql loader)I only know sql loader as a way to do it
    Regards
    Anurag

  • Doubt in Query(on 28th)

    Hi all
    I wrote the following query
    SELECT COUNT(DISTINCT QUESTION_ID) AS QCOUNT,
    DECODE(((SUM(SUM(WORK_SPACE))/5)*100)/QCOUNT,<50,COUNT(DISTINCT RESPONSER_ID)) AS COUNT1,
    DECODE(((SUM(SUM(WORK_SPACE))/5)*100)/QCOUNT,>=50 AND <=60,COUNT(DISTINCT RESPONSER_ID)) AS COUNT2,
    DECODE(((SUM(SUM(WORK_SPACE))/5)*100)/QCOUNT,>=60 AND <=75,COUNT(DISTINCT RESPONSER_ID)) AS COUNT3,
    DECODE(((SUM(SUM(L.WORK_SPACE))/5)*100)/QCOUNT,>75,COUNT(DISTINCT RESPONSER_ID)) AS COUNT4
    FROM TQDB_LEARNER_RESPONSE
    Can i use QCOUNT IN DECODE Function.
    I am getting 'Missing Expression Error"
    Is thr any other alternative to write this query
    Regards.

    Hi Thanks for reply.
    I have changed my query as following.
    SELECT
    CASE WHEN (((SUM(DISTINCT WORK_SPACE)/5)*100)/COUNT(DISTINCT QUESTION_ID))<50 THEN COUNT(DISTINCT RESPONSER_ID) ELSE NULL END AS COUNT1,
    CASE WHEN (((SUM(DISTINCT WORK_SPACE)/5)*100)/COUNT(DISTINCT QUESTION_ID))>=50 AND (((SUM(WORK_SPACE)/5)*100)/COUNT(DISTINCT QUESTION_ID)) <=60 THEN COUNT(DISTINCT RESPONSER_ID) ELSE NULL END AS COUNT2,
    CASE WHEN (((SUM(DISTINCT WORK_SPACE)/5)*100)/COUNT(DISTINCT QUESTION_ID))>=60 AND (((SUM(WORK_SPACE)/5)*100)/COUNT(DISTINCT QUESTION_ID)) <=75 THEN COUNT(DISTINCT RESPONSER_ID) ELSE NULL END AS COUNT3,
    CASE WHEN (((SUM(DISTINCT WORK_SPACE)/5)*100)/COUNT(DISTINCT QUESTION_ID))>75 THEN COUNT(DISTINCT RESPONSER_ID) ELSE NULL END AS COUNT4
    FROM TQDB_LEARNER_RESPONSE
    Will it work for AND Condition(>=50 and <=60)
    Pls Help me

  • Doubts in query ..

    Hi Genius,
                  I have a doupts in Report..
          <b> budat = 01.04.2007 to 30.04.2007</b> 
          <b> matnr = a001</b>
           SELECT * FROM zs_mkpf_mseg
                        into corresponding fields of table it_opbal
                        WHERE werks =  itmat-werks
                        AND matnr = itmat-matnr
                        AND budat LT s_budat-low.
    Now iam getting the opening balance..that is the closing balance of up to
    30-3-2007.
    My req is..between 1st month to 30th, i have to calculate the opbal of every day wise(1-4-07 to 30-4-07) for that how i should write the query statement.
    please suggest me.

    Hi
    SELECT gjahr belnr  FROM bseg
                        into corresponding fields of table int_bseg
                        WHERE werks =  itmat-werks
                        AND budat = s_budat-low.
    loop at int_BSEG.<-- loop at ur date declared internal table
    read table int_bseg WITH KEY BELNR = INT_BSEG-BELNR
            GJAHR = INT_BSEG-GJAHR. <-- to read the same internal table
    IF int_bseg-belnr = 'compare value'.
            total = total + int_bseg-belnr. " here goes ur coding part for date "
    try like thi s
    Reward all helpfull answers
    Regards
    Pavan

  • Small Doubt in ALE config

    Hi,
    Iam reffering this blog to do ALE settings
    /people/swaroopa.vishwanath/blog/2007/01/22/ale-configuration-for-pushing-idocs-from-sap-to-xi
    If i completly follow this Blog means ,  Is there is any need to do in WE20 & WE21 entries ????
    Instead of doing through this blog can i do in this way....
    1) Create LS in SALE
    2) Create RFC Destination in SM59 with the above created LS name
    3) Create WE21 Port
    4) Create We20 Partner Profile
    Is this way is ok rather than going in the Above mentioned Blog.
    What is the difference between these Two Approches
    Regards

    Hi Vamasi,
    After creating distribution model, you can generate partner profile automatically by just one single push button. It avoids our manual process of creating partener profile.
    However you can create partner profile manually as well using WE20 / WE21. But in both cases you need distribution model if you want to send message to XI system.
    "Generate the partner profiles by selecting the navigation path from the main menu, Environment --> Generate Partner profiles " --> Will make life easier by auto. generating profile for you base on distribution model parameter. ( Just one click n everything would be done).
    Both are doing same thing.
    Hope this will ans. your query.
    Thanks,
    Nilesh

  • Doubt abt query outlines

    I am working on performance issue in my project.I want to create stored outlines for the query fetching the results.But in user_Outlines table a, under category default the outline is shown as USED .How can I make this USED for my query?
    If I have session level stored outlines under default category and some other category for same query and then when I run the query which stored outline is considered is taken by query ?Is it default one?
    Please clarify...

    I don't understand your question.
    The USED flag indicates if an outline has been employed. Unused outlines can be purged immediately. Outlines with a used status must be set to unused before they can be removed with a package procedure call. Outlines get used by executing their query.
    I personally don't use outlines. Using hints effectively is tricky, and hints can produce unexpected results when upgrading or patching database versions. I use hints when necessary but prefer to control them myself instead of letting the database do it. I might use outlines of other methods to get a query to run efficiently did not work but they wouldn't be my first choice

Maybe you are looking for

  • My purchase history shows an audiobook I purchased but my iTunes wont let me download it.

    Last year I purchased the audiobook Sh*t my dad says on my iPod Touch, My purchase history shows that I did in fact for pay this audiobook, but my iTunes says I have never purchased a book. My old computer was destroyed, so I have no access to the fi

  • As I try to start Design Studio I get an error message about a shared library

    Hi everybody, I am new to this forum, and I want to use Design Studio. I managed to install it, and when I try to start it, I get an error message saying "Failed to load the JNI library "C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects

  • Lacie d2 drive not ejecting disc

    I have an odd problem with my Lacie d2 drive, when I put in a disc, any type of disc ... It seems as if the mechanical eject button on the face of the lacie is disabled forcing me to use my disc utility to eject the mounted disc. This is a new drive

  • Date on X axis in graph

    In which type of graph I could get date on X axis in graph other than line and bar. My graph has date in x axis and aggregate in y axis and a bubble in z axis which graph will support it.

  • Adobe Reader X on Virtual PC

    Opening a pdf file on the host computer from a virtual machine (Microsoft Virtual PC) takes 10 - 15 min. In the meantime I'm watching Reader window, all white, except for the title bar. With Protected Mode disabled, opening a file is normal, 3 - 4 se