Multiple columns from a query sorted vertically

Is it possible to sort a query resultset vertically, with
multiple columns across the page, in the following manner, with
page breaks after 40 rows? I can get it to sort horizontally just
fine with tables, but how can it be done vertically as shown?
JONES, Abby JONES, Betty JONES, Dawn JONES, Frank
JONES, Adam JONES, Bill JONES, Debbie JONES, Gayle
JONES, Alice JONES, Bob JONES, Denton JONES, Henry
JONES, Ben JONES, Cathy JONES, Emma JONES, John

This will get you started. I assume you had the appropriate
order by clause in your query. I also assume you want 4 columns per
line.
My approach would be to convert the query to an array and
then output the array.
columns = 4;
maxrows = 40;
recordsperpage = columns * rows;
records = query.recordcount;
myArray = ArrayNew(2);
ThisColumn = 1;
ThisRow = 1;
if (records gt recordsperpage)
LoopTill = recordsperpage;
else
LoopTill = records;
for ( ii = 1; ii lte LoopTill; ii = ii + 1){
myArray[ThisRow][ThisColumn] = query.field[ii];
increment ThisRow;
if (ThisRow = MaxRows + 1) {
ThisRow = 1;
increment ThisColumn;
} // if
} // looop
You can do the rest

Similar Messages

  • Merge statement - update multiple columns from a single sub-select

    Is it possible to write in 10gR2, a MERGE statement, with UPDATE for multiple columns from a single sub_select?
    like this:
    MERGE INTO tableA
    using ( select * from temp) tmp
    on( tableA. col1 = tmp.col1)
    when matched then
    update set  ( tableA.col5,
                       tableA.col6,
                       tableA.col7) = ( select sum(col2), sum(col3), sum(col5)
                                                                                 from tableX
                                                                                where tableX.col1 = tableA.col1...)

    Hi,
    The USING clause is not a sub-query, so it can't reference columns from tables that are not in it.
    Include tableA in the USING clause if you really need to refer to it there. (It's not obvious that you do.)
    As always, it helps if you post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data (In the case of a DML statement, such as MERGE, this will be the state of the tables when everything is finished.)
    (4) Your best attempt so far (formatted)
    (5) The full error message (if any), including line number
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
    Formatted tabular output is okay for (3).

  • Return multiple columns from an analytic function with a window

    Hello,
    Is it possible to obtain multiple columns from an analytic function with a window?
    I have a table with 4 columns, an id, a test id, a date, and the result of a test. I'm using an analytic function to obtain, for each row, the current test value, and the maximum test value in the next 2 days like so:
    select
    id,
    test_id,
    date,
    result,
    MAX ( result ) over ( partition BY id, test_id order by date RANGE BETWEEN CURRENT ROW AND INTERVAL '2' DAY FOLLOWING ) AS max_result_next_two_day
    from table
    This is working fine, but I would like to also obtain the date when the max result occurs. I can see that this would be possible using a self join, but I'd like to know if there is a better way? I cannot use the FIRST_VALUE aggregate function and order by result, because the window function needs to be ordered by the date.
    It would be a great help if you could provide any pointers/suggestions.
    Thanks,
    Dan
    http://danieljamesscott.org

    Assuming RESULT is a positive integer that has a maximum width of, say 10,
    and assuming date has no time-component:
    select
       id
      ,test_id
      ,date
      ,result
      ,to_number(substr(max_result_with_date,1,10)) as max_result_next_two_day
      ,to_date(substr(max_result_with_date,11),'YYYYMMDD') as date_where_max_result_occurs
    from (select
            id
           ,test_id
           ,date
           ,result
           ,MAX(lpad(to_char(result),10,'0')||to_char(date,'YYYYMMDD'))
               over (partition BY id, test_id
                     order by date
                     RANGE BETWEEN CURRENT ROW AND INTERVAL '2' DAY FOLLOWING )
            AS max_result_with_date
          from table)

  • Multiple columns from the same dimension table as row labels performing slowly

    (Working with SSAS tabular)
    I'm trying to figure out what the approach should be for the following scenario:
    Lets say we have a Customer table. The table has columns such as account number, department number, name, salesperson, account manager, number of customers, delivery route, etc
    A user of the model could want to see any permutation of that information as the row labels. How should that be handled?
    What we've been doing so far is that the user adds each column they want into the "ROWS" section in Excel. This works fine with smaller tables (for example, "Department" table with a "Department Code" and "Department Name",
    but on large tables this quickly chokes. I understand why this is happening, I just haven't found a better way to accomplish the same thing.
    I can add a calculated column to the model through VS, but obviously this is unsupportable and unscalable when each person needs their own permutations of the data. Can something similar be done in Excel? 
    This question seems to be what I need:
    http://social.msdn.microsoft.com/Forums/en-US/97d1157a-1402-4227-b96a-79524401ddcd/mdx-query-performance-when-selecting-multiple-attributes-from-same-dimension?forum=sqlanalysisservices
    However I can't find any information on how to add those properties (is it a multidimensional-only thing?)

    Thanks for the help. Sorry but i'm a self-taught developer, and i may be missing some basics :)
    Anyway i've done what you suggested but i get this error:
    [nQSError: 15011]The dimension table source Dimension Services.DM_D_SERVIZI_SRV has an aggregate content specification that specifies the level Product. But the source mapping contains column COD_PRODUCT with a functional dependency association on a more detailed level .
    where:
    - DM_D_SERVIZI_SRV is the physical alias for the Service Dimension (and the name of the LTS too)
    - COD_PRODUCT is the leaf of the hierarchy, the physical primary key, but it hasnt to be included in the hierarchy
    Do i have to add another level with the primary key and hide it to the users?
    I tried to solve this going to the logical tables source properties, on the tab contents, setting "logical level" to null for the hierarchy, but i don't know if this is correct.
    Thanks

  • Count(*) , group by with multiple columns from multiple tables involved

    Hi all,
    I am relatively new to SQL.
    Currently I have these few requirements, to display quite a number of fields from 3 tables for display of report.
    In my query I need to:
    1.) count(*)
    2.) select quite a number of fields from table 1,2,3
    However when count(*) is used, grouped by has to be used to.
    How do I actually use group by with so many columns to be selected?
    I have actually used the query below, but the count(*) returns 1, the correct output should be 3 instead.
    select count(*), table1.col1, table1.col2, table1.col3, table2.col3, table2.col4, table2.col6, table3.col1, table3.col4, table3.col5
    from table1, table2, table3
    where
    <conditions>........................
    group by table1.col1, table1.col2, table1.col3, table2.col3, table2.col4, table2.col6, table3.col1, table3.col4, table3.col5
    I know this group by statement looks very unrefined. How can I select multiple fields from different tables, and yet get the count(*) correctly?
    Thank you so much for your time.

    Hmm yes it actually does return count as 1 for each row. But there are 3 rows returned. E.g.
    ctr table1.col1 table1.col2 ..........
    1 value1 value1
    1 value2 value3
    1 value3 value4
    If I put the count(*) outside, it returns 3 , the correct output
    ctr
    3
    select count(*) from
    select table1.col1, table1.col2, table1.col3, table2.col3, table2.col4, table2.col6, table3.col1, table3.col4, table3.col5
    from table1, table2, table3
    where
    <conditions>
    group by table1.col1, table1.col2, table1.col3, table2.col3, table2.col4, table2.col6, table3.col1, table3.col4, table3.col5
    Thus I was wondering if it was the group by of multiple colns that resulted in the count stucked at value 1.

  • Update multiple UDF from one query generator

    Hi All,
    I have Form1 with multiple UDF1 which have been key in by users
    And another Form2 with multiple UDF2 which exactly same with Form1 UDF1
    Is there a way that I can copy multiple UDF at Form2UDF2 from Form1UDF1 instead of creating query for each individual UDF, where in query generator I can select more the one column but only first column will be insert to the single UDF.
    Thanks

    Hi Firos,
    I mean I have 7UDF in the Payment Form where the information to this UDF are come from 7UDF in the invoice form which already created previously so I would like to copy those UDF from invoice to UDF in payment by using single query to capture all the UDF information by doing:
    SELECT T0.[DocNum], T0.[UDF1], T0.[UDF2], T0.[UDF3], T0.[UDF4], T0.[UDF5], T0.[UDF6], T0.[UDF7]
    FROM OINV T0 WHERE T0.[CardCode] = $[ORCT.CardCode]
    From above query can I pass the result directly to UDF in Payment Form? or I need to create one query for each individual UDF.
    Thanks

  • Help needed in returning multiple columns from one field

    Hi,
    I have been given a task to rewrite the query (see below), so that I get three columns from the one field, based on their contents.
    The script returns all the columns and concatenates them into one, but returns them as comma delimmited within the returned column, to generate a report.
    These tables are from Siebel.
    Our Oracle version is:
    select banner from sys.v_$version;
    --returns
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    PL/SQL Release 8.1.7.4.0 - Production
    CORE     8.1.7.0.0     Production
    TNS for Solaris: Version 8.1.7.4.0 - Production
    NLSRTL Version 3.4.1.0.0 - Production
    Here is what I was given;
    set arraysize 200
    Spool d:\Daily_reports\Data\RegManage\Electricity\eCISPLUS_Product_Switch_Not_Started_Discount.csv
    -- this will concatenate all the returned columns into one
    SELECT DISTINCT '"'||
    rtrim(ltrim(S_ORG_EXT.OU_NUM)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.NAME)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.TODO_CD)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.EVT_STAT_CD)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_SOURCE_TYPE)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_TXU_PRICELIST_NAME)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PEAKANYTIME_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PA_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.X_OTH_ACCOUNT_NUMBER)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_NUM)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_CHECKSUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.QUOTE_NUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_COOLING_OFF_DATE)) || '","' ||
    rtrim(ltrim(S_PROD_INT.NAME)) || '"'
    The field S_PROD_INT.NAME is the one that I need to split so that it is retured
    into three different columns.
    1st column needed -
    where S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge __ %'
    OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now __ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More __ %'
    OR S_PROD_INT.NAME Like 'Electricity Mates Rates __ %'
    2nd column needed -
    where S_PROD_INT.NAME Like 'Gas TRUenergy Business Edge __ %'
    OR S_PROD_INT.NAME Like 'Gas TRUenergy Business Now __ %'
    OR S_PROD_INT.NAME Like 'Gas Go for More __ %'
    OR S_PROD_INT.NAME Like 'Gas Mates Rates __ %'
    3rd column needed from
    S_PROD_INT.NAME Like '* ___ Discount for Paying Your Bill by the Due Date')
    -- Tables
    FROM SIEBEL.S_ADDR_PER S_ADDR_PER,
    SIEBEL.S_DOC_QUOTE S_DOC_QUOTE,
    SIEBEL.S_EVT_ACT S_EVT_ACT,
    SIEBEL.S_ORG_EXT S_ORG_EXT,
    SIEBEL.S_PRI_LST S_PRI_LST,
    SIEBEL.S_PROD_INT S_PROD_INT,
    SIEBEL.S_QUOTE_ITEM S_QUOTE_ITEM
    WHERE S_EVT_ACT.TARGET_OU_ID = S_ORG_EXT.ROW_ID
    AND S_DOC_QUOTE.ROW_ID = S_QUOTE_ITEM.SD_ID
    AND S_ADDR_PER.ROW_ID = S_ORG_EXT.PR_ADDR_ID
    AND S_PROD_INT.ROW_ID = S_QUOTE_ITEM.PROD_ID
    AND S_ORG_EXT.ROW_ID = S_DOC_QUOTE.TARGET_OU_ID
    AND S_DOC_QUOTE.PRI_LST_ID = S_PRI_LST.ROW_ID
    AND S_EVT_ACT.TODO_CD = 'Product Switch-Electricity'
    AND S_EVT_ACT.EVT_STAT_CD In ('In Progress','Not Started','On Hold')
    AND S_DOC_QUOTE.STAT_CD In ('Completed','Verbal Acceptance','Written Acceptance')
    AND S_DOC_QUOTE.X_OFFER_TYPE = 'Product Switch'
    AND (S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge __ %' OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now __ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More __ %' OR S_PROD_INT.NAME Like 'Electricity Mates Rates __ %'
    OR S_PROD_INT.NAME Like 'Electricity __ Discount for Paying Your Bill by the Due Date' or S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge ___ %'
    OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now ___ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More ___ %'
    OR S_PROD_INT.NAME Like 'Electricity Mates Rates ___ %'
    OR S_PROD_INT.NAME Like 'Electricity ___ Discount for Paying Your Bill by the Due Date')
    UNION
    SELECT DISTINCT '"'||
    rtrim(ltrim(S_ORG_EXT.OU_NUM)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.NAME)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.TODO_CD)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.EVT_STAT_CD)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_SOURCE_TYPE)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_TXU_PRICELIST_NAME)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PEAKANYTIME_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PA_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.X_OTH_ACCOUNT_NUMBER)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_NUM)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_CHECKSUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.QUOTE_NUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_COOLING_OFF_DATE)) || '"'
    FROM SIEBEL.S_ADDR_PER S_ADDR_PER,
    SIEBEL.S_DOC_QUOTE S_DOC_QUOTE,
    SIEBEL.S_EVT_ACT S_EVT_ACT,
    SIEBEL.S_ORG_EXT S_ORG_EXT,
    SIEBEL.S_PRI_LST S_PRI_LST
    WHERE S_EVT_ACT.TARGET_OU_ID = S_ORG_EXT.ROW_ID
    AND S_ADDR_PER.ROW_ID = S_ORG_EXT.PR_ADDR_ID
    AND S_ORG_EXT.ROW_ID = S_DOC_QUOTE.TARGET_OU_ID
    AND S_DOC_QUOTE.PRI_LST_ID = S_PRI_LST.ROW_ID
    AND S_EVT_ACT.TODO_CD = 'Product Switch-Electricity'
    AND S_EVT_ACT.EVT_STAT_CD In ('In Progress','Not Started','On Hold')
    AND S_DOC_QUOTE.STAT_CD In ('Completed','Verbal Acceptance','Written Acceptance')
    AND S_DOC_QUOTE.X_OFFER_TYPE = 'Product Switch'
    AND NOT EXISTS (SELECT /*+ unnest */ 'X'
    FROM SIEBEL.S_PROD_INT S_PROD_INT, SIEBEL.S_QUOTE_ITEM S_QUOTE_ITEM
    WHERE S_DOC_QUOTE.ROW_ID = S_QUOTE_ITEM.SD_ID
    AND S_PROD_INT.ROW_ID = S_QUOTE_ITEM.PROD_ID
    AND (S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge __ %'
    OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now __ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More __ %'
    OR S_PROD_INT.NAME Like 'Electricity Mates Rates __ %'
    OR S_PROD_INT.NAME Like 'Electricity __ Discount for Paying Your Bill by the Due Date' or S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge ___ %'
    OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now ___ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More ___ %'
    OR S_PROD_INT.NAME Like 'Electricity Mates Rates ___ %'
    OR S_PROD_INT.NAME Like 'Electricity ___ Discount for Paying Your Bill by the Due Date'));
    spool off
    This is what one row looks like;
    "1-UWLHY","Alpha Vic Kelly Kay","Product Switch-Electricity","Not Started","AMBASS_50REBATE","Go Green PKANY-Powercor","QEGS1","GG","QEGS1","GG","","6407421678","8","1-UWLI6","12-JUN-07","Electricity Mates Rates 7% Discount"
    we want
    "1-UWLHY","Alpha Vic Kelly Kay","Product Switch-Electricity","Not Started","AMBASS_50REBATE","Go Green PKANY-Powercor","QEGS1","GG","QEGS1","GG","","6407421678","8","1-UWLI6","12-JUN-07",'Electricity Mates Rates 7% Discount","Gas TRUenergy Business Edge 10% Discount","Electricity 3% Discount for Paying Your Bill by the Due Date"
    I have tried to:
    - create a cursor
    - each column as - ie
    S_PROD_INT.NAME as "EVD",
    S_PROD_INT.NAME as "GVD",
    S_PROD_INT.NAME as "PbDDD"
    but when I try to use them in where "EVD" Like 'etc...'
    error that table does not exist
    I have tried also as
    where 'EVD' Like 'etc...' -- error
    where EVD Like 'etc...' -- error
    - create them as %TYPE variable
    - more
    but keep getting errors
    Any ideas and help will be most appreciated as I have tried and researched all I can think and get my hands on with my limited skills.
    Thanks.
    Regards, Steve

    Unfortunately my skills are not high enough as I obviously don't know where to put the code exaclty.
    I am first just running it on the top part of the script but get the error;
    ORA-00900: invalid SQL statement
    What I am running is; -- Commented
    WITH s_prod_int AS
    SELECT 1 row_id, 'Electricity Mates Rates 7% Discount' name FROM s_prod_int --these were 'FROM dual' originally, I changed to s_prod_int (Received same error regardless whether from dual or s_prod_int)
    UNION ALL
    SELECT 1, 'Gas TRUenergy Business Edge 10% Discount' FROM s_prod_int
    UNION ALL
    SELECT 1, 'Electricity 3% Discount for Paying Your Bill by the Due Date' FROM s_prod_int
    SELECT DISTINCT '"'||
    rtrim(ltrim(S_ORG_EXT.OU_NUM)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.NAME)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.TODO_CD)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.EVT_STAT_CD)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_SOURCE_TYPE)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_TXU_PRICELIST_NAME)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PEAKANYTIME_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PA_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.X_OTH_ACCOUNT_NUMBER)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_NUM)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_CHECKSUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.QUOTE_NUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_COOLING_OFF_DATE)) || '","' ||
    rtrim(ltrim(a.name)) ||'","'|| --I assume I am still able to right and left trim
    rtrim(ltrim(b.name)) ||'","'||
    rtrim(ltrim(c.name))||'"' name -- not sure what this name is here for (have ran with and without it here
    FROM SIEBEL.S_ADDR_PER S_ADDR_PER,
    SIEBEL.S_DOC_QUOTE S_DOC_QUOTE,
    SIEBEL.S_EVT_ACT S_EVT_ACT,
    SIEBEL.S_ORG_EXT S_ORG_EXT,
    SIEBEL.S_PRI_LST S_PRI_LST,
    s_prod_int a, -- I assume these needed to go in here
    s_prod_int b,
    s_prod_int c
    SIEBEL.S_QUOTE_ITEM S_QUOTE_ITEM
    WHERE S_EVT_ACT.TARGET_OU_ID = S_ORG_EXT.ROW_ID
    AND S_DOC_QUOTE.ROW_ID = S_QUOTE_ITEM.SD_ID
    AND S_ADDR_PER.ROW_ID = S_ORG_EXT.PR_ADDR_ID
    AND S_PROD_INT.ROW_ID = S_QUOTE_ITEM.PROD_ID
    AND S_ORG_EXT.ROW_ID = S_DOC_QUOTE.TARGET_OU_ID
    AND S_DOC_QUOTE.PRI_LST_ID = S_PRI_LST.ROW_ID
    AND S_EVT_ACT.TODO_CD = 'Product Switch-Electricity'
    AND S_EVT_ACT.EVT_STAT_CD In ('In Progress','Not Started','On Hold')
    AND S_DOC_QUOTE.STAT_CD In ('Completed','Verbal Acceptance','Written Acceptance')
    AND S_DOC_QUOTE.X_OFFER_TYPE = 'Product Switch'
    AND a.NAME LIKE 'Electricity TRUenergy Business Edge%' --Placed all the where part in the original where clause
    OR a.NAME LIKE 'Electricity TRUenergy Business Now%'
    OR a.NAME LIKE 'Electricity Go for More%'
    OR a.NAME LIKE 'Electricity Mates Rates%'
    AND a.row_id = b.row_id
    AND (
    b.NAME LIKE 'Gas TRUenergy Business Edge%'
    OR b.NAME LIKE 'Gas TRUenergy Business Now%'
    OR b.NAME LIKE 'Gas Go for More%'
    OR b.NAME LIKE 'Gas Mates Rates%'
    AND b.row_id = c.row_id
    AND (
    c.NAME LIKE '%Discount for Paying Your Bill by the Due Date'
    NAME -- Not sure what this NAME is for - tried with and without - same error

  • Place multiple columns (from a word doc) in a document?

    Hello,
    I am trying to place a word document with three columns of text in an indesign document. I tried changing the settings to "three columns" but that didn't help, the document shows up as one long column that of course runs off the bottom of the page.
    What setting am I missing?
    Cheers,
    James

    Placing heavily formatted Word docs is always an issue. InDesign treats the text as a continuous string.
    >the document shows up as one long column that of course runs off the bottom of the page.
    Could you explain this a little more? Are you saying that InDesign is creating a frame that runs off the page, or that you get a single column with only some of the text and a red plus sign in the out port?
    I suspect the latter. There are a number of ways to place text, and options for how to do columns, too. If you've set up the document with three column guides you can flow continuous text into three frames inside the columns. Hold the shift key while you click the loaded place cursor to autoflow all of the text from column to column, adding pages until all of the text is on a page.
    If you selected use master text frame when you set up the document, or put frames on the page before issuing the place command, you'll see the loaded cursor change from a square corner to parentheses when you are over the frame and the text will flow into that frame, filling from the top. If there is no existing frame, InDesign will create one on the fly that fits the guide width and runs to the bottom margin guide, but the top of the frame will be where you click. Subsequent frames when you use autoflow will start at the top margin.
    As Scott said, you can also set a text frame to hold multiple columns, if you prefer. Both methods have advantages and disadvantages. Balancing columns is easier when they are in a single frame because you can adjust the frame size to affect all the columns at once.
    Peter

  • Creating multiple reports from one query

    Hello Everyone
    I are designing crystal reports where 1 query is built for 1 report / 1 sub-report. To improve overall efficiency of reports, I am trying to design multiple reports/ subreports from the same query. All the sub-reports belong to the parent report and they are very similar to each other.
    For example: in Webintelligence, we can just create 1 data provider and pull multiple reports from it and display it in multiple tabs.
    Can we do the same thing in Crystal reports??
    Please advice.
    Thanks
    Edited by: Devesh  Modi on Jun 9, 2010 11:19 PM

    Hello,
    If you are using WEBI then you have access to BOE. Create a Universe and publish it to the Repository and then you can use it as your data source.
    But I think what you are asking is how to query the DB once? Not possible, each subreport will run the query each time it's viewed.
    What you may want to do is create a Stored Procedure and get all of you info into one data collection and not use subreports, use grouping to emulate subreports. As an Example ....
    You may want to create a case in Service Market Place since you have BOE and work with a Report Design Rep to help you work out the best solution for you.
    Thank you
    Don

  • Retrieve varchar column from Oracle query in a resulset

    Hi, I'am a begginer in JSP Technologies.
    I've do a small jsp that opens a db connection to an oracle, execute a query a show results.
    When the columns of the query are int I've no problem, the jsp show the columns of the resulset, but when the columns selected are varchars the jsp doesn't show anything....
    Can anyone help me?
    Example:
    Table: CUSTOMERS
    Col1 : ID_COSTUMER int
    Col2: CUSTOMER_NAME varchar
    <%
    Connection canal = null;
    ResultSet tabla = null;
    Statement instruccion=null;
    try { Class.forName("oracle.jdbc.driver.OracleDriver");
    canal=DriverManager.getConnection("jdbc:oracle:thin:@XXXXXXXXXXXXXXXXXXXp");
    instruccion = canal.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    } catch(java.lang.ClassNotFoundException e){};
    String Query = "SELECT ID_CUSTOMER FROM CUSTOMERS";
    try { tabla = instruccion.executeQuery(Query);
    out.println("<TABLE Border=10 CellPadding=5><TR>");
    out.println("<TD>CUSTOMER</TD></TR>");
    while(tabla.next()) {
    out.println("<TR>");
    out.println("<TD>"+tabla.getString(1)+"</TD>");
    out.println("</TR>"); };
    out.println("</TABLE></CENTER></DIV></HTML>");
    tabla.close(); instruccion.close(); canal.close();}
    catch(SQLException e) {};
    %>Results:
    CUSTOMER
    1
    2
    3
    4
    Doing the change in query:
    SELECT CUSTOMER_NAME FROM CUSTOMERS
    I have not results....
    Thank you.

    sorry, I misplaced an ending code bracket on last one
    I'm not really familiar with doing this inside a jsp.. but there are a few things that you should try to make sure that it isn't a database problem before assuming it is a problem on your jsp.... It is possible you have already tried the following but just to make sure.
    When you do the second query does the first two out.printlns that are before the while still output? If not then your query is incorrect.
    Second I would try
    String Query = "SELECT ID_CUSTOMER,CUSTOMER_NAME FROM CUSTOMERS";
    try { tabla = instruccion.executeQuery(Query);
    out.println("<TABLE Border=10 CellPadding=5><TR>");
    out.println("<TD>CUSTOMER_ID</TD><TD>CUSTOMER_NAME</TD></TR>");
    while(tabla.next()) {
    out.println("<TR>");
    out.println("<TD>"+tabla.getString(1)+"</TD>");
    out.println("<TD>"+tabla.getString(2)+"</TD>");
    out.println("</TR>"); };
    out.println("</TABLE></CENTER></DIV></HTML>");I suspect this will also return nothing.. if that is the case then you need to check your database. If it does infact return values for the ID and nothing for the NAME then I'm not sure at this point what the problem is.

  • Stored procedure in  package return multiple columns from multiple tables

    Hi ,
    Can a single stored procedure return multiple column values from different tables.
    example:
    tabA: col2, tabB:col3,tabC:col4 etc.
    one more question:
    if a stored procedure like to return 10 columns for a particular record from a single table do i need to define a TYPE statement for each colum like
    TYPE col1 is TABLE of varchar
    TYPE col2 is TABLE of varchar
    here i want to return only one row, not many rows.
    thanks

    You can try one procedure with OUT or IN/OUT parameters that collect the values from one or more sql statements.
    CREATE OR REPLACE PROCEDURE P1
    (P_COD IN TABLE.COD%TYPE,
    P_DESC1 OUT TABLE1.DESC1%TYPE,
    P_DESC2 OUT TABLE2.DESC2%TYPE)
    IS
    BEGIN
    SELECT table1.DESC1, table2.DESC2
    INTO P_DESC1, P_DESC2
    FROM TABLE1, table2 WHERE
    table1.COD = P_COD and
    table1.cod = table2.cod ;
    END P1;
    JP

  • How to update multiple columns from different tables using cursor.

    Hi,
    i have two tables test1 and test2. i want to udpate the column(DEPT_DSCR) of both the tables TEST1 and TEST2 using select for update and current of...using cursor.
    I have a code written as follows :
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
         LOOP
              FETCH C1 INTO v_mydept1,v_mydept2;
              EXIT WHEN C1%NOTFOUND;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
         END LOOP;
         COMMIT;
    END;
    The above code when run says that it runs successfully. But it does not updates the desired columns[DEPT_DSCR].
    It only works when we want to update single or multiple columns of same table...i.e. by providing these columns after "FOR UPDATE OF"
    I am not sure what is the exact problem when we want to update multiple columns of different tables.
    Can anyone help me on this ?

    oops my mistake.....typo mistake...it should have been as follows --
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    Now here is the upated PL/SQL code where we are trying to update columns of different tables --
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
    LOOP
    FETCH C1 INTO v_mydept1,v_mydept2;
    EXIT WHEN C1%NOTFOUND;
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    END LOOP;
    COMMIT;
    END;
    Please let us know why it is not updating by using using CURRENT OF

  • To fetch Query Column from  a query .

    Is there a way to extract the column from a database to an application written in C / Proc* C

    Maybe this? You may get Name/Value pairs e.g. via
    michaels> select dbms_xmlgen.getxml ('select ename,job from emp where ename=upper(''scott'')') x from dual
    X                                                                                                                                                                                                      
    <?xml version="1.0"?>                                                                                                                                                                                  
    <ROWSET>                                                                                                                                                                                               
    <ROW>                                                                                                                                                                                                 
      <ENAME>SCOTT</ENAME>                                                                                                                                                                                 
      <JOB>ANALYST</JOB>                                                                                                                                                                                   
    </ROW>                                                                                                                                                                                                
    </ROWSET>

  • How to store a DB row (multiple columns) from ResultSet object to hm/ht

    I am trying to store a DB row (which is containing ~150+ columns) from ResultSet Object to HashMap/Hashtable using the below code. But I wonder is, this not working and even do not get any error.
    dataslotHashmap.put(rsmd.getColumnName(i+1),rs.getObject(i+1));
    where "rsmd" ResultSetMetaData Object and "rs" is ResultSet Object.
    Need advice please

    Code snippet for reference:
    rs=stmt.executeQuery("select * from ......
    rsmd=rs.getMetaData();
    rs.next();
    int noc=rsmd.getColumnCount();
    for(int i=0;i<noc;i+=1) {
    dataslotHashmap.put(rsmd.getColumnName(i+1),rs.getObject(i+1));

  • Get multiple rows from mysql query in NetBeans

    Hi, I am working on a project in NetBeans 6.I have a checkboxlist, and I have a variable in which I save the selected values of the checkboxlist.Now, I want to make a query that will get the rows of the rowset that have the same id as the selected values.for example, I have a checkboxlist that has the following values: Helen, Maria, Anna.The user checks the first two, so I have a variable String[] "checked" that has in it the data 1,2.Now, I have a rowset that has the following query:
    SELECT ALL person.age
    FROM person
    WHERE person.id=? or something like this.I want the parameters to have the values (1,2) so that the rowset has the results of the ages of the two first rows.How do I accomplish that?I am assuming that with one "?" it can't be done because I need multiple parameters. Will something like this work: WHERE person.id IN something,but what will something be?

    christomar wrote:
    I have a rowset that has the following query:
    SELECT ALL person.age
    FROM person
    WHERE person.id=? or something like this.I want the parameters to have the values (1,2) so that the rowset has the results of the ages of the two first rows.How do I accomplish that?Use a PreparedStatement. You probably first need to read the Sun JDBC Tutorial before you do anything.
    I am assuming that with one "?" it can't be done because I need multiple parameters. I've seen people use up to 76 parameters so yes it can be done, it will look like this:
    Will something like this work: WHERE person.id IN something,Yes, you can submit any SQL you want as long as your db supports it (all support ANSI i believe)
    but what will something be?something in that context would be a list/set of data, but you're getting ahead of yourself I think. do the tutorial and look at some code

Maybe you are looking for

  • Running VMware Server 2 services as a non-root user

    Hello, I have switched from VirtualBox to VMware Server 2 on my Arch64 server and the transition has been relatively painless. I am at the point now where I want to run VMware's services as a non-root user account (I have a service account called "sv

  • Problems while using ORDER BY in declaring a PL/SQL cursor

    Hi, everybody I hope you can help me. We are programming a very simple PL/SQL Procedure where we are declaring the following Cursor:Declare Cursor CUnidadP is Select UNOR_CO_UNID_ORGID,UNOR_CO_PADREID,UNOR_NU_NIVEL from Unidad_Organizativa where Unor

  • After installing Firefox UK Comodo security keeps scanning 2 files in omni.jar folder as Trojan downloader agents, do I ignore?

    I have been using Property Bee as an add on for Right Move with previous version of Firefox. When it updated recently it kept showing alert warnings for trojans in temporary internet files.These were wiped and the whole system was scanned. Got rid of

  • Unauthoriz​ed Network Card is Plugged In

    Hi, I have a Lenovo T400 x86 laptop with AMT version 4.1.3 that is fully configured and functional with SCCM and vPro. it is provisioned and all is well. However, when i perform vPro commands like restart the computer from within SCCM OOB, i am hit w

  • Citrix Receiver Proxy

    Hi Im trying to configure the Citrix Mobile Receiver Proxy on a ASA but cant get it to work. The ASA got several VPN configured, both client, clientless vpn and L2L. It looks like ASA are terminating SSL every time the iPad connects. What could be mi