SQLPLUS prompt in one row

Hellou
I need help in SQLPLUS. I need to prompt into the file one row of information like this:
0000004202;;00151564;[email protected];160120071333
this -> 0000004202;;00151564;[email protected]; is just static text
this -> 160120071333 is date in format (ddmmyyyyHHMM)
And I need it in one row
prompt 0000004202;;00151564;[email protected]; select to_char(sysdate,'ddmmyyyyHH24MM') from dual
does not work
Can you help me?
I used something Like this:
spool file
declare cas_aktual VARCHAR(12);
begin
select to_char(sysdate,'ddmmyyyyHH24MM') into cas_aktual from dual;
dbms_output.enable;
dbms_output.put_line('blabla'||cas_aktual||'konec');
end;
spool OFF
But it isn't work too

>
I used something Like this:
spool file
declare cas_aktual VARCHAR(12);
begin
select to_char(sysdate,'ddmmyyyyHH24MM') into
cas_aktual from dual;
dbms_output.enable;
dbms_output.put_line('blabla'||cas_aktual||'konec');
end;
spool OFF
But it isn't work tooYou need a forward-slash character ("/") right after the PL/SQL block to allow sqlplus to run the contents of the buffer.
test@ora>
test@ora> spool c:\test.log
test@ora>
test@ora> declare cas_aktual VARCHAR(12);
  2  begin
  3  select to_char(sysdate,'ddmmyyyyHH24MM') into cas_aktual from dual;
  4  dbms_output.enable;
  5  dbms_output.put_line('blabla'||cas_aktual||'konec');
  6  end;
  7  /
blabla300720081207konec
PL/SQL procedure successfully completed.
test@ora>
test@ora> spool OFF
test@ora>
test@ora> host type c:\test.log
test@ora>
test@ora> declare cas_aktual VARCHAR(12);
  2  begin
  3  select to_char(sysdate,'ddmmyyyyHH24MM') into cas_aktual from dual;
  4  dbms_output.enable;
  5  dbms_output.put_line('blabla'||cas_aktual||'konec');
  6  end;
  7  /
blabla300720081207konec
PL/SQL procedure successfully completed.
test@ora>
test@ora> spool OFF
test@ora>
test@ora>isotope

Similar Messages

  • OCI - Array-Fetch vs. One-row-per-fetch

    Hello guys,
    i have a question about the OCI and the possibilities about fetches.
    Is it possible to get only one row per fetch without setting the array size to 1?
    I have a third party application that shows this behaviour which i have rebuild in sqlplus.
    SQL> create table mytest (a number);
    SQL> begin
      2  for i in 1 .. 1500 loop
      3  insert into mytest values (i);
      4      end loop;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> set autotrace traceonly;
    -- Now with the default array size of 15 with sqlplus
    SQL> select * from mytest;
         118  consistent gets
         101  SQL*Net roundtrips to/from client
         1500  rows processed
    -- Now with a bigger array size (150)
    SQL> set arraysize 150
    SQL> select * from mytest;
         17  consistent gets
         11  SQL*Net roundtrips to/from client
         1500  rows processed
    -- Now the behaviour of the third party application
    SQL> set arraysize 1
    SQL> select * from mytest;
         757  consistent gets
         751  SQL*Net roundtrips to/from client
         1500  rows processed
    SQL> set arraysize 2
    SQL> select * from mytest;
         757  consistent gets
         751  SQL*Net roundtrips to/from client
         1500  rows processedThe third party application is a c program and i can not take a look at the code.
    So as you can see the consistent gets are the same with arraysize 1 and 2. The sql statement which is executed of the c-program is returning a huge amount of data and it seems like it is run with arraysize 1 or 2 or it is executing a different OCI call.
    So now is my question:
    Which methods does the OCI interface provide to recieve (fetch) data?
    - Is it only array fetching (like sqlplus do) or is it possible to return only one row per fetch with a specific call.
    I can speed up the query by setting the bigger array-size in sqlplus .. but i want to point the programers to the possibilities with the OCI.
    Thanks and Regards
    Stefan

    The following call in OCI can be used to control the fetched rows
    MAX_PREFETCH_ROWS is number of rows you want to fetch in one round trip.
    (void) OCIAttrSet((dvoid *)DBctx->stmthp, (ub4) OCI_HTYPE_STMT,
    (dvoid *)&MAX_PREFETCH_ROWS,(ub4)sizeof(MAX_PREFETCH_ROWS),(ub4) OCI_ATTR_PREFETCH_ROWS, DBctx->errhp);

  • SQL*Plus two fetches for getting one row.

    Hi all.
    I have tested following script.
    alter session set events '10046 trace name context forever, level 12';
    select * from dual;And achieved such results (extract from .trc file).
    SQL*Plus: Release 11.2.0.1.0; (Oracle Version 10.2.0.4.0, 11.2.0.1.0)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.00       0.00          0          0          0           1
    total        4      0.00       0.00          0          0          0           1SQL*Plus: Release 8.1.7.0.0; (Oracle Version 8.1.7.0.0)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.00          0          0          0           0
    Fetch        2      0.00       0.00          0          1          4           1
    total        5      0.00       0.00          0          1          4           1Allround Automations PL/SQL Developer 8.0.4; (Oracle Version 10.2.0.4.0, 11.2.0.1.0)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          0          0           1
    total        3      0.00       0.00          0          0          0           1Allround Automations PL/SQL Developer 8.0.4; (Oracle Version 8.1.7.0.0)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          1          4           1
    total        3      0.00       0.00          0          1          4           11) I can't figure out why sqlplus does TWO fetches for getting ONE row (instead of pl/sql developer).
    8i raw trace
    PARSING IN CURSOR #1 len=31 dep=0 uid=0 oct=3 lid=0 tim=0 hv=3549852361 ad='4a0155c'
    select 'hello world' from dual
    END OF STMT
    PARSE #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=0
    BINDS #1:
    EXEC #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=0
    WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1111838976 p2=1 p3=0
    FETCH #1:c=0,e=0,p=0,cr=1,cu=4,mis=0,r=1,dep=0,og=4,tim=0
    WAIT #1: nam='SQL*Net message from client' ela= 0 p1=1111838976 p2=1 p3=0
    FETCH #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=0
    WAIT #1: nam='SQL*Net message to client' ela= 0 p1=1111838976 p2=1 p3=0
    WAIT #1: nam='SQL*Net message from client' ela= 0 p1=1111838976 p2=1 p3=0
    STAT #1 id=1 cnt=1 pid=0 pos=0 obj=195 op='TABLE ACCESS FULL DUAL '11g raw trace
    PARSING IN CURSOR #3 len=30 dep=0 uid=96 oct=3 lid=96 tim=1581355246985 hv=1158622143 ad='b8a1bcdc' sqlid='5h2yvx92hyaxz'
    select 'hello world' from dual
    END OF STMT
    PARSE #3:c=0,e=130,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=1388734953,tim=1581355246984
    EXEC #3:c=0,e=40,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=1388734953,tim=1581355247154
    WAIT #3: nam='SQL*Net message to client' ela= 7 driver id=1111838976 #bytes=1 p3=0 obj#=-1 tim=1581355247252
    FETCH #3:c=0,e=18,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,plh=1388734953,tim=1581355247324
    STAT #3 id=1 cnt=1 pid=0 pos=1 obj=0 op='FAST DUAL  (cr=0 pr=0 pw=0 time=0 us cost=2 size=0 card=1)'
    WAIT #3: nam='SQL*Net message from client' ela= 193 driver id=1111838976 #bytes=1 p3=0 obj#=-1 tim=1581355247735
    FETCH #3:c=0,e=2,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,plh=1388734953,tim=1581355247800
    WAIT #3: nam='SQL*Net message to client' ela= 5 driver id=1111838976 #bytes=1 p3=0 obj#=-1 tim=15813552478552) Is there any possibility to view data provided by each fetch?
    Thanks in advance!
    P.S.
    SQL> sho arraysize
    arraysize 15

    Thanks.
    I have tested two statements.
    select 'hello world' from dual where 1=1;
    select 'hello world' from dual where 1=0;When query returns no data, there is only one SQL*Net roundtrip (and one fetch)
    SQL> set autot on statistics
    SQL> select 'hello world' from dual where 1=1;
    'HELLOWORLD
    hello world
    Statistics
              0  recursive calls
              0  db block gets
              0  consistent gets
              0  physical reads
              0  redo size
            528  bytes sent via SQL*Net to client
            492  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> select 'hello world' from dual where 1=0;
    no rows selected
    Statistics
              0  recursive calls
              0  db block gets
              0  consistent gets
              0  physical reads
              0  redo size
            329  bytes sent via SQL*Net to client
            481  bytes received via SQL*Net from client
              1  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              0  rows processedBut in both cases i found in client trace this sequence of bytes:
    ] nsprecv: 00 00 36 01 00 00 00 00  |..6.....|
    ] nsprecv: 00 00 00 00 00 00 00 00  |........|
    ] nsprecv: 00 00 90 19 43 13 00 00  |....C...|
    ] nsprecv: 00 00 00 00 00 00 00 00  |........|
    ] nsprecv: 00 00 00 00 00 00 00 00  |........|
    ] nsprecv: 00 00 00 00 00 00 00 00  |........|
    ] nsprecv: 00 00 00 00 00 00 00 00  |........|
    ] nsprecv: 00 00 00 00 00 00 00 00  |........|
    ] nsprecv: 00 00 00 00 00 00 00 00  |........|
    ] nsprecv: 00 00 00 00 00 00 00 00  |........|
    ] nsprecv: 00 00 19 4F 52 41 2D 30  |...ORA-0|
    ] nsprecv: 31 34 30 33 3A 20 6E 6F  |1403:.no|
    ] nsprecv: 20 64 61 74 61 20 66 6F  |.data.fo|
    ] nsprecv: 75 6E 64 0A              |und.    |In first case - it was in 2nd packet and in second case (query returns no data) - part of 1st packet.

  • Database monitoring from sqlplus prompt?

    How can one monitor database from sqlplus prompt? I want to know about the connected users,queries fire by users,deadlock and explain plan of the query from sqlplus.
    Is there any direct query for the same.
    Thanks
    Vipin

    connected users,queries fire by users,deadlockYou can use v$ views example v$session, v$lock
    explain plan of the query from sqlplusYou can use
    SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());
    Additionaly I would advise you visit and search more about it
    http://www.oracle.com/technology/documentation/index.html
    Adith

  • How to return one ROW with Multiple value seperated by Colon in a SQL Query

    Hi,
    I have a SQL query as mentioned.
    select deptno
      from deptI want to mofidfy this query, so that this should return me department list with colon delimeted in one ROW.
    10:20:30:40.......Thanks,
    Deepak

    In 10g:
    select rtrim(xmlagg(xmlparse(content deptno || ':')).getstringval(), ':') data
    from   dept;
    DATA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    10:20:30:40with apologies for the abuse of XML...

  • How to Plot number and string in one row (data logger counter via MODBUS) ?

    hi all i made data log quantity using Digital Counter via modbus (RS-485) to monitoring quantity and reject that has and Name Operator, Machine and Part Number.
    i have problem about plot the number & string in one row, as shown on the picture below :
    how to move that string on one row ? i attach my vi.
    Thanks~
    Solved!
    Go to Solution.
    Attachments:
    MODBUS LIB Counter.vi ‏39 KB

    Hi rhiesnand,
    right now you add 2 new rows to your array.
    The solution is to concatenate both row parts to one bigger 1D array before adding that array as new row to your 2D array!
    Like this:
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to Plot number and string in one row (data logger counter) ?

    hi all i made data log quantity using Digital Counter via modbus to monitoring quantity and reject that has and Name Operator, Machine and Part Number.
    i have problem about plot the number & string in one row, as shown on the picture below :
    how to move that string on one row ? i attach my vi.
    Thanks~
    Attachments:
    MODBUS LIB Counter.vi ‏39 KB

    Duplicate and answered - http://forums.ni.com/t5/LabVIEW/How-to-Plot-number-and-string-in-one-row-data-logger-counter-via/m-p...

  • Grouping all in one row

    Hi guys, I got a black out. I got this situation:
    Create table Forum ( Icity varchar(50), IMonth int, Iyear int, ACons int, BCons int, CCons int) insert into forum values ('Buenos Aires',1,2014,100,0,0), ('Buenos Aires',2,2014,140,0,0), ('Buenos Aires',3,2014,60,0,0), ('Toronto',1,2014,400,0,0), ('Toronto',2,2014,625,0,0), ('Toronto',3,2014,880,0,0), ('Buenos Aires',1,2014,0,330,0), ('Buenos Aires',2,2014,0,1230,0), ('Buenos Aires',3,2014,0,470,0), ('Toronto',1,2014,0,1100,0), ('Toronto',2,2014,0,1520,0), ('Toronto',3,2014,0,400,0), ('Buenos Aires',1,2014,0,0,300),('Buenos Aires',2,2014,0,0,440), ('Buenos Aires',3,2014,0,0,1080), ('Toronto',1,2014,0,0,640), ('Toronto',2,2014,0,0,1020), ('Toronto',3,2014,0,0,880)
    I had to run a huge union all taking data fro ACons, BCons, CCons, no way to do link or other stuff, we're talking about millions rows, different servers..anyway. I got this situation. Now I need an output like:
    Buenos Aires 1 2014 100 330 300
    Toronto  1 2014  400 1100 640
    Pratically Icity, Imonth, Iyear, Acons, Bcons, Ccons in one rows and not in three difefrent rows. I already did this stuff a lot of time but I'm going underpressure by another side ( a Cube that doesn't update correctly).
    Any suggestion? Thanks everyone.

    Are you looking for the below? If not, please let us know:
    Create table Forum ( Icity varchar(50), IMonth int, Iyear int, ACons int, BCons int, CCons int)
    insert into forum values
    ('Buenos Aires',1,2014,100,0,0), ('Buenos Aires',2,2014,140,0,0),
    ('Buenos Aires',3,2014,60,0,0), ('Toronto',1,2014,400,0,0),
    ('Toronto',2,2014,625,0,0), ('Toronto',3,2014,880,0,0),
    ('Buenos Aires',1,2014,0,330,0), ('Buenos Aires',2,2014,0,1230,0),
    ('Buenos Aires',3,2014,0,470,0), ('Toronto',1,2014,0,1100,0),
    ('Toronto',2,2014,0,1520,0), ('Toronto',3,2014,0,400,0),
    ('Buenos Aires',1,2014,0,0,300),('Buenos Aires',2,2014,0,0,440),
    ('Buenos Aires',3,2014,0,0,1080), ('Toronto',1,2014,0,0,640),
    ('Toronto',2,2014,0,0,1020), ('Toronto',3,2014,0,0,880)
    Select Icity,IMonth,Iyear,MAX(ACons),MAX(BCons),MAX(cCons) From Forum
    Group by Icity,IMonth,Iyear
    Drop table Forum

  • Multiple record in one row..

    Hi experts,
    I want to merge multiple row from same table into one row... is it possible? if so then how??
    Regards,
    SKP

    Sure, it's possible
    create table scott.a
    as
    select 1 a, 2 b from dual     
    union all
    select 3 a, 4 b from dual     
    create table scott.b
    (a number, b number, c number, d number)
    insert into scott.b
    select a1.a,a1.b,a2.a,a2.b from scott.a a1, scott.a a2
    where a1.a = 1 and a2.a = 3
    P.S. Sorry, at first misunderstood the task
    Message was edited by:
    Dmytro Dekhtyaryuk

  • Display results in one row

    Query below is returning data in multiple rows, I want to display them as one row:
    select
    event_id,
    data_type_cd,
    quantity
    from Event,Data_types
    where event_id = 1234
    and event.DATA_TYPE_ID = data_types.DATA_TYPE_ID
    (I want to display data_type_cd concatenated with quantity as every code had different quantity)

      > Sample data is:
      > Data_type_id Quantity
      > ------------------ ----------
      > 1 34
      > 2 67
      > 15 35
      > 20 23
      > I want to display as:
      > 1 34 2 67 15 35 20 23
    if you want all the rows in one column see this given example below:
      SQL> select t.*
        2    from (select  1 data_type_id, 34 quantity from dual union all
        3          select  2 data_type_id, 67 quantity from dual union all
        4          select 15 data_type_id, 35 quantity from dual union all
        5          select 20 data_type_id, 23 quantity from dual) t;
      DATA_TYPE_ID   QUANTITY
                 1         34
                 2         67
                15         35
                20         23
      SQL> select substr(sys_xmlagg(xmlelement(col, ' ' || data_type_id||' '||quantity)).extract('/ROWSET/COL/text()').getclobval(), 2) new_disp
        2    from (select  1 data_type_id, 34 quantity from dual union all
        3          select  2 data_type_id, 67 quantity from dual union all
        4          select 15 data_type_id, 35 quantity from dual union all
        5          select 20 data_type_id, 23 quantity from dual) t;
      NEW_DISP
      1 34 2 67 15 35 20 23
      SQL>

  • Concatenating values in one row

    I need to write a function that will give me a concatenated list of all the records where gurmail_matl_code_mod like '8%'
    This query is giving me those results:
    GURMAIL_PIDM     CODE1     CODE2
    1135711          
    1135711          8IBD
    1135711     8IBW     
    I want something like this 1135711 8IBW 8IBD in one row.
    select
    gurmail_pidm,
    max(decode(rn,1,gurmail_matl_code_mod )) code1,
    max(decode(rn,2,gurmail_matl_code_mod )) code2
    from (select gurmail_pidm,
                  gurmail_matl_code_mod,
                  row_number() over (partition by gurmail_pidm order by gurmail_matl_code_mod desc) rn
                  from
                      (select  gurmail_pidm,gurmail_matl_code_mod
                               from saturn.spriden,
                                    general.gurmail
                                    where spriden_pidm = gurmail_pidm
                                    and spriden_change_ind is null
                                    and gurmail_matl_code_mod  like '8%'
                                    and gurmail_pidm = 1135711
                                    and GURMAIL_DATE_PRINTED is null
                                    and gurmail_matl_code_mod is not null))
                                    group by gurmail_pidm, gurmail_matl_code_mod   How I can modify this query or let me know if you have other ideas..
    Thank you

    Hello
    try this,
    SQL>  with tab as(Select 1135711 GURMAIL_PIDM, Null CODE1 from dual Union All
      2               Select 1135711 GURMAIL_PIDM, '8IBD' CODE1 from dual Union All
      3               Select 1135711 GURMAIL_PIDM, '8IBW' CODE1 from dual)
      4  SELECT GURMAIL_PIDM || sys_connect_by_path(CODE1,' ') Result
      5    FROM (SELECT GURMAIL_PIDM
      6                ,code1
      7                ,row_number() over(Partition BY GURMAIL_PIDM Order BY GURMAIL_PIDM) rn
      8            FROM tab)
      9   WHERE connect_by_isleaf = 1
    10   Start With rn = 1
    11  Connect BY Prior rn = rn - 1;
    RESULT
    1135711  8IBW 8IBDHope this helps
    Christian Balz

  • Columns adjustment in one row

    Hello,
    I hope some1 can help me for these.
    I am using apex 3.1.2 ver
    My first question: how can I put more columns for example 4 columns with heading in one row? when I do, screen is too wide but i do not want scrolling?
    e.g
    aaaaaaaaaaaaaaa( ) bbbbbbbbbbbbbb ( ) ccccccccccccccccc ( ) ddddddddddd( )
    second question?
    how can i display second column value based on first column value before saving the page?
    e.g. aaaaaaa(1) bbbbbbbb(should display text value based on first column)
    for example 1 - abc
    2 - def
    3 - ghi and so on.
    last question? how can i disable the column? should column enable based on other column? e.g if a then second column take value other disabled?
    Many thx.
    kind regards,

    Irha10 wrote:
    how can I put more columns for example 4 columns with heading in one row? when I do, screen is too wide but i do not want scrolling?In item property change "Begin on new Line " to "Yes"
    Irha10 wrote:
    how can i display second column value based on first column value before saving the page?01. You have to create a branch to same page
    02. Submit the page using any event (such as button press or something). So when you enter details to first item and then press button then page will submit and reload the same page.
    03. In the page create a before region process and check whether second item is not null and third item is null then populate third item. Then first item is not null and second item null then populate second item.
    Irha10 wrote:
    ? how can i disable the column? should column enable based on other column? e.g if a then second column take value other disabled?You can use a java script and enable and dissable item based on any condition such as value of another item
    Example
    if ($x('P16_YYY').value !='SOME VALUE')
      $x('P16_XXX').disabled = true;
    }else
      $x('P16_XXX').disabled = false;
    }

  • Multiple records in one row

    Hi all,
    I want to display all the party codes which have same party name,
    and I want to display all the party codes in one row separated by comma. is it possible?

    You can either use analytic functions + hierarchy or stragg (listagg if you are on 11.2) or undocumentd wm_concat. There are plenty examples on this forum. For example:
    select  deptno,
            ltrim(sys_connect_by_path(job,','),',') job_list
      from  (
             select  deptno,
                     job,
                     row_number() over(partition by deptno order by job) rn
               from  emp
      where connect_by_isleaf = 1
      start with rn = 1
      connect by deptno = prior deptno
             and rn = prior rn + 1
        DEPTNO JOB_LIST
            10 CLERK,MANAGER,PRESIDENT
            20 ANALYST,ANALYST,CLERK,CLERK,MANAGER
            30 CLERK,MANAGER,SALESMAN,SALESMAN,SALESMAN,SALESMAN
    select  deptno,
            rtrim(stragg(job || ','),',') job_list
      from  emp
      group by deptno
        DEPTNO JOB_LIST
            10 MANAGER,PRESIDENT,CLERK
            20 CLERK,ANALYST,CLERK,ANALYST,MANAGER
            30 SALESMAN,MANAGER,SALESMAN,SALESMAN,CLERK,SALESMAN
    select  deptno,
            wm_concat(job) job_list
      from  emp
      group by deptno
        DEPTNO JOB_LIST
            10 MANAGER,PRESIDENT,CLERK
            20 CLERK,ANALYST,CLERK,ANALYST,MANAGER
            30 SALESMAN,MANAGER,SALESMAN,SALESMAN,CLERK,SALESMANSY.

  • Displaying records in one row??

    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34I had written a query(splitting KBIM code data & PBIM code data which actually brought back results as seen below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     NULL     NULL
    NULL     NULL     Y     B1234I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234

    Hi,
    francislazaro wrote:
    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34...
    I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234
    So you don't want anything in the results about userrecordids 'm002' and 'm003', because they do not have both board_codes 'KBIM' and 'PBIM', is that it?
    One way to get those results is a self-join, as if all the rows with borad_code 'KBIM' were in one table, and all the rows with borad_code 'PBIM' were in another:
    SELECT     'Y'          AS "KBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    ,     'Y'          AS "PBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    FROM     boards     k
    JOIN     boards     p     ON     k.userrecordid     = p.usrrecordid
    WHERE     k.board_codes     = 'KBIM'
    AND     p.board_codes     = 'PBIM'
    ;Another way is a GROUP BY, like Mpautom suggested.
    If your requirements change in the future, so that you need to include all rows, even if they don't have both board_codes, then you could change the JOIN to a FULL OUTER JOIN and make what I wrote as the WHERE clause part of the join condition, but I suspect the GROUP BY approach would be more efficient in that case.

  • Arranging charts in one row

    Hi,
    How should I go about aligning 3 line charts in one row? What I plan to do is have a report containing data on the first row and on the second row I'll have 3 charts to represent the data above. Right now my charts are occupying rows 2,3,4 and are in column 1.
    Any suggestions will be greatly appreciated. Many thanks

    I figured out what to do. I placed negative values on the left, right, top, bottom margin parameters. That expanded my chart without expanding the region that contains it. Thanks for all your help though.
    Now can someone show me how to set my chart font to BOLD?

Maybe you are looking for

  • .pdf documents displaying transparent in browser

    I am having a strange display glitch when I attempt to view a .pdf in Firefox 6. I believe this started happening around the time I upgraded Firefox, but I have updated the Adobe Reader plugin. I am using Windows 7. Here is an example of what a .pdf

  • Requirement: New tool to migrate attachments within KM repository

    Dear Colleagues                                                                                I need to write a new migration tool to migrate atttachments in KM.(NW                04s SP10) I will give you an example                                 

  • Differentiating SOs to STOs

    Dear Readers, How can one differentiate a sale order from a stock transfer order during batch determination, specifically routine RV01F901? The closest I've got to is noticing the VBTYP (SD document category). For a SO it is C. For a STO it is howeve

  • Explorer Crash/Refresh when trying to Run As Admin or Right Clicking

    Hi guys, I've been looking for days for a solution and have come to the end of my tether. Basically here is the problem: Norton Internet Security has stopped working and will not launch when I try to open it. Mozilla Firefox stopped connecting to the

  • Higher response time after adding more CPU

    Hello all, have you ever experienced that after incresing SAPs (adding 2 more CPU + 4 GB of memory) on the VMware ESX 3.5 the DB response time went from 150 to 400-500 ms ? NO DB parameter were changed. In app server, only extended memory and program