Need help with pl/sql tables

i am trying but iam not understanding this....
Evaluate this program fragment:
DECLARE
TYPE user_tab_rec IS RECORD (
db_user dba_users.username%TYPE,
DBA_TAB dba_tables%ROWTYPE);
TYPE user_rec_tab IS TABLE OF test_rec
INDEX BY BINARY_INTEGER;
Tab_rec dba_tables%ROWTYPE;
Obj_owner dba_objects.owner%TYPE;
begin
(processing)
end;
What line will generate an error?
1.
TYPE user_tab_rec IS RECORD (
2.
db_user dba_users.username%TYPE,
3.
DBA_TAB dba_tables%ROWTYPE);
4.
TYPE user_rec_tab IS TABLE OF test_rec
5.
INDEX BY BINARY_INTEGER;
6.
Tab_rec dba_tables%ROWTYPE;
7.
Obj_owner dba_objects.owner%TYPE;
The correct answer is b. The line in b attempts to define a PL/SQL TABLE TYPE using a record that contains a composite datatype, which is not allowed. Answers a, c, and d are incorrect because they will not generate any errors when compiled.
how can line b attempt to define a pl/sql table type..........
thank u ramsy

The correct answer is bB? I see no B.
Do you mean three?
But then again
maybe line ten.
Because (processing) isn't
valid syntax you see.
I know, I know
Let's see what'll go.
And then we'll see
Is it A B or C?
SQL> r
  1  DECLARE
  2  TYPE user_tab_rec IS RECORD (
  3  db_user dba_users.username%TYPE,
  4  DBA_TAB dba_tables%ROWTYPE);
  5  TYPE user_rec_tab IS TABLE OF test_rec
  6  INDEX BY BINARY_INTEGER;
  7  Tab_rec dba_tables%ROWTYPE;
  8  Obj_owner dba_objects.owner%TYPE;
  9  begin
10  null;
11* end;
TYPE user_rec_tab IS TABLE OF test_rec
ERROR at line 5:
ORA-06550: line 5, column 31:
PLS-00201: identifier 'TEST_REC' must be declared
ORA-06550: line 5, column 1:
PL/SQL: Item ignored
SQL> create type TEST_REC as object(a number);
  2  /
Type created.
SQL> DECLARE
  2  TYPE user_tab_rec IS RECORD (
  3  db_user dba_users.username%TYPE,
  4  DBA_TAB dba_tables%ROWTYPE);
  5  TYPE user_rec_tab IS TABLE OF test_rec
  6  INDEX BY BINARY_INTEGER;
  7  Tab_rec dba_tables%ROWTYPE;
  8  Obj_owner dba_objects.owner%TYPE;
  9  begin
10  null;
11  end;
12  /
PL/SQL procedure successfully completed.
SQL> Hmmm........................
Cheers, APC

Similar Messages

  • Need help with calc from tables

    I have a table that contains query #1 and have another table
    that contains a field that needs to use the result of the cfset in
    another calc.
    The new calc in query #2 needs to divide the Num_Checks_Trans
    from query #1 by the by the Weekly_Hours_Recorded in query #2.
    Can anyone help me figure this out?
    <b>1.</b>
    <cfquery name="QryEmployeeDetail"
    datasource="NBProdReports">
    SELECT TblContractInfo_SubMenuTable.User_ID,
    TblContractInfo_SubMenuTable.Contract_Number,
    TblContractInfo_SubMenuTable.Transaction_Type,
    TblContractInfo_SubMenuTable.Num_Checks_Trans, TblTransType.Value,
    TblContractInfo_SubMenuTable.Notes, TblMasterTrans.Date_Opened
    from TblContractInfo_SubMenuTable, TblMasterTrans,
    TblTransType
    WHERE TblContractInfo_SubMenuTable.Task_Number =
    TblMasterTrans.Task_Number
    and TblTransType.Transaction_Type =
    TblContractInfo_SubMenuTable.Transaction_Type
    And TblMasterTrans.Date_Opened BETWEEN
    #createODBCDate(DED_startDate)# AND #createODBCDate(DED_endDate)#
    order BY TblMasterTrans.Date_Opened ASC,
    TblContractInfo_SubMenuTable.User_id ASC
    </cfquery>
    <cfset totalTrans = 0 />
    <cfloop query="QryEmployeeDetail">
    <cfset totalTrans = totalTrans +
    (QryEmployeeDetail.Num_Checks_Trans * QryEmployeeDetail.Value)
    /></cfloop>
    Text
    2.
    <cfquery name="QryEmployeeDetail"
    datasource="NBProdReports">
    SELECT TblContractInfo_SubMenuTable.User_ID,
    TblContractInfo_SubMenuTable.Contract_Number,
    TblContractInfo_SubMenuTable.Transaction_Type,
    TblContractInfo_SubMenuTable.Num_Checks_Trans, TblTransType.Value,
    TblContractInfo_SubMenuTable.Notes, TblMasterTrans.Date_Opened
    from TblContractInfo_SubMenuTable, TblMasterTrans,
    TblTransType
    WHERE TblContractInfo_SubMenuTable.Task_Number =
    TblMasterTrans.Task_Number
    and TblTransType.Transaction_Type =
    TblContractInfo_SubMenuTable.Transaction_Type
    And TblMasterTrans.Date_Opened BETWEEN
    #createODBCDate(DED_startDate)# AND #createODBCDate(DED_endDate)#
    order BY TblMasterTrans.Date_Opened ASC,
    TblContractInfo_SubMenuTable.User_id ASC
    </cfquery>

    This can be rewritten as a single query which is good for a
    number of reasons, including we only make one trip to the database
    and we do our calculations on the SQL backend, which is faster than
    doing them in CFML.
    What you're going to want to do is SUM() the total
    transaction values by having a column like SUM(Num_Checks_Trans *
    Value) AS totalTrans. To get the value for your other column you
    can calculate that like Num_Checks_Trans / Weekly_Hours_Recorded. I
    didn't see the latter in either of your queries so I'm not sure
    where it comes from, but you can definitely use it in your SELECT
    clause when calculating.
    Since SUM() is an aggregate function, you'll have to use a
    GROUP BY clause to make it work. You'll have to GROUP BY each
    column in the SELECT statement. If some of the columns have
    differing data that you won't want to use in the GROUP, you can
    always use a nested subquery as part of your FROM clause and then
    join that to the original queries with the totals.
    I hope that helps.
    - William

  • Need help with a SQL qurey that returns multiple rows for one record?

    I have the following query where I use a CASE WHEN clause to determine the date of a shift that begins with "FRLO" on day1 - day14 of the pay period. It works great if a schedule record contains one day that begins "FRLO", but if more than one day is "FRLO" then it only returns the first day it finds and not the others. Is there some way to get the query to return a ron for every day 1 - 14 that begins "FRLO"? System if Oracle 11G
    Order of the results is not important as this is part of a larger query that orders the results.
    Thanks in advance for any help,
    George
    SELECT s.empid,
    CASE
    WHEN UPPER (SUBSTR (s.Day1, 0, 4)) = 'FRLO'
    THEN
    pp.startpp
    WHEN UPPER (SUBSTR (s.Day2, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 1
    WHEN UPPER (SUBSTR (s.Day3, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 2
    WHEN UPPER (SUBSTR (s.Day4, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 3
    WHEN UPPER (SUBSTR (s.Day5, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 4
    WHEN UPPER (SUBSTR (s.Day6, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 5
    WHEN UPPER (SUBSTR (s.Day7, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 6
    WHEN UPPER (SUBSTR (s.Day8, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 7
    WHEN UPPER (SUBSTR (s.Day9, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 8
    WHEN UPPER (SUBSTR (s.Day10, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 9
    WHEN UPPER (SUBSTR (s.Day11, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 10
    WHEN UPPER (SUBSTR (s.Day12, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 11
    WHEN UPPER (SUBSTR (s.Day13, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 12
    WHEN UPPER (SUBSTR (s.Day14, 0, 4)) = 'FRLO'
    THEN
    pp.startpp + 13
    END
    startdate,
    NULL starttime,
    NULL endtime,
    8 hours,
    0 minutes
    FROM schedules s
    JOIN
    payperiods pp
    ON pp.periodid = s.periodid
    WHERE UPPER (SUBSTR (s.Day1, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day2, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day3, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day4, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day5, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day6, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day7, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day8, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day9, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day10, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day11, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day12, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day13, 0, 4)) = 'FRLO'
    OR UPPER (SUBSTR (s.Day14, 0, 4)) = 'FRLO';
    CURRENT OUTPUT
    EMPID STARTDATE STARTTIME ENDTIME HOURS MINUTES
    753738, 3/25/2013 , , ,8 ,0
    753740, 3/25/2013 , , ,8 ,0
    753748, 3/25/2013 , , ,8 ,0
    DESIRED OUTPUT
    EMPID STARTDATE STARTTIME ENDTIME HOURS MINUTES
    753738, 3/25/2013 , , ,8 ,0
    753740, 3/25/2013 , , ,8 ,0
    753748, 3/25/2013 , , ,8 ,0
    753738, 3/26/2013 , , ,8 ,0
    753740, 3/26/2013 , , ,8 ,0
    753740, 3/28/2013 , , ,8 ,0
    753748, 1/1/2013 , , ,8 ,0
    753738, 4/3/2013 , , ,8 ,0
    753748, 4/3/2013 , , ,8 ,0
    CREATE TABLE SCHEDULES
    SCHEDULEID NUMBER(12) NOT NULL,
    EMPID NUMBER(12) NOT NULL,
    PERIODID VARCHAR2(6 BYTE) NOT NULL,
    AREAID NUMBER(12) NOT NULL,
    DAY1 VARCHAR2(50 BYTE),
    DAY2 VARCHAR2(50 BYTE),
    DAY3 VARCHAR2(50 BYTE),
    DAY4 VARCHAR2(50 BYTE),
    DAY5 VARCHAR2(50 BYTE),
    DAY6 VARCHAR2(50 BYTE),
    DAY7 VARCHAR2(50 BYTE),
    DAY8 VARCHAR2(50 BYTE),
    DAY9 VARCHAR2(50 BYTE),
    DAY10 VARCHAR2(50 BYTE),
    DAY11 VARCHAR2(50 BYTE),
    DAY12 VARCHAR2(50 BYTE),
    DAY13 VARCHAR2(50 BYTE),
    DAY14 VARCHAR2(50 BYTE),
    NOPTIND1 INTEGER DEFAULT 0,
    NOPTIND2 INTEGER DEFAULT 0,
    NOPTIND3 INTEGER DEFAULT 0,
    NOPTIND4 INTEGER DEFAULT 0,
    NOPTIND5 INTEGER DEFAULT 0,
    NOPTIND6 INTEGER DEFAULT 0,
    NOPTIND7 INTEGER DEFAULT 0,
    NOPTIND8 INTEGER DEFAULT 0,
    NOPTIND9 INTEGER DEFAULT 0,
    NOPTIND10 INTEGER DEFAULT 0,
    NOPTIND11 INTEGER DEFAULT 0,
    NOPTIND12 INTEGER DEFAULT 0,
    NOPTIND13 INTEGER DEFAULT 0,
    NOPTIND14 INTEGER DEFAULT 0
    CREATE TABLE PAYPERIODS
    PERIODID VARCHAR2(6 BYTE) NOT NULL,
    STARTPP DATE,
    ENDPP DATE
    Insert into SCHEDULES
    (SCHEDULEID, EMPID, PERIODID, AREAID, DAY1,
    DAY2, DAY3, DAY4, DAY5, DAY6,
    DAY7, DAY8, DAY9, DAY10, DAY11,
    DAY12, DAY13, DAY14, NOPTIND1, NOPTIND2,
    NOPTIND3, NOPTIND4, NOPTIND5, NOPTIND6, NOPTIND7,
    NOPTIND8, NOPTIND9, NOPTIND10, NOPTIND11, NOPTIND12,
    NOPTIND13, NOPTIND14)
    Values
    (3693744, 753738, '082013', 2167, 'X',
    'FRLO<1530>', 'FRLO<1530>', '1530', '1530', '1530',
    'X', 'X', '1530', '1530', 'FRLO',
    '1530', '1530', 'X', 0, 0,
    0, 0, 0, 0, 0,
    0, 0, 0, 0, 0,
    0, 0);
    Insert into SCHEDULES
    (SCHEDULEID, EMPID, PERIODID, AREAID, DAY1,
    DAY2, DAY3, DAY4, DAY5, DAY6,
    DAY7, DAY8, DAY9, DAY10, DAY11,
    DAY12, DAY13, DAY14, NOPTIND1, NOPTIND2,
    NOPTIND3, NOPTIND4, NOPTIND5, NOPTIND6, NOPTIND7,
    NOPTIND8, NOPTIND9, NOPTIND10, NOPTIND11, NOPTIND12,
    NOPTIND13, NOPTIND14)
    Values
    (3693745, 753740, '082013', 2167, 'X',
    'FRLO<1530>', 'FRLO<1530>', '1530', 'FRLO', '1530',
    'X', 'X', '1530', '1530', '1530',
    '1530', '1530', 'X', 0, 0,
    0, 0, 0, 0, 0,
    0, 0, 0, 0, 0,
    0, 0);
    Insert into SCHEDULES
    (SCHEDULEID, EMPID, PERIODID, AREAID, DAY1,
    DAY2, DAY3, DAY4, DAY5, DAY6,
    DAY7, DAY8, DAY9, DAY10, DAY11,
    DAY12, DAY13, DAY14, NOPTIND1, NOPTIND2,
    NOPTIND3, NOPTIND4, NOPTIND5, NOPTIND6, NOPTIND7,
    NOPTIND8, NOPTIND9, NOPTIND10, NOPTIND11, NOPTIND12,
    NOPTIND13, NOPTIND14)
    Values
    (3693746, 753748, '082013', 2167, 'X',
    'FRLO<1530>', '1530', '1530', '1530', '1530',
    'X', 'X', 'FRLO<1530>', '1530', 'FRLO',
    '1530', '1530', 'X', 0, 0,
    0, 0, 0, 0, 0,
    0, 0, 0, 0, 0,
    0, 0);
    COMMIT;
    Insert into PAYPERIODS
    (PERIODID, STARTPP)
    Values
    ('082013', TO_DATE('03/24/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;

    Do you have the opportunity to change the data model to have one day per row ? It would make this easier to get this result without the need for a 14-way CASE or UNION.
    If not...
    The case statement will return as soon as it matches one of the conditions. Since you want a match when any column in the row starts with FRLO you can use a UNION ALL treating each column as a separate result. There may be more efficient ways to do this, but here is one way:
    Select S.Empid,       Pp.Startpp Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day1, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+1 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day2, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+2 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day3, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+3 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day4, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+4 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day5, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+5 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day6, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+6 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day7, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+7 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day8, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+8 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day9, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+9 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day10, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+10 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day11, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+11 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day12, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+12 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day13, 0, 4)) = 'FRLO'
    Union All 
    Select S.Empid,       Pp.Startpp+13 Startdate,       Null Starttime,       Null Endtime,       8 Hours,       0 Minutes
      From Schedules S       Join  Payperiods Pp On Pp.Periodid = S.Periodid
      Where Upper (Substr (S.Day14, 0, 4)) = 'FRLO'

  • Power Query for Excel - Need Help with Oracle SQL Syntax

    Hello everyone,
    I am new to Power Query and am not able to figure this out.  I am trying to pull in data into my Excel spreadsheet using a specific Oracle SQL query.  While in query editor, how do I take the Oracle.Database function and add my SQL statement? 
    I already know what I want, I don't want it to download all the table names.  According to the help page, I should be able to do this but it does not provide a syntax example
    Also, I don't understand what "optional options as nullable record" means.
    Below is what function and arguments the help page notes.  How do I use this?
    Oracle.Database(server as text, optional options as nullable record) as table
    Any help is greatly appreciated.
    Thank you,
    Jessica

    When I try this, I get an error 
    DataSource.Error: Oracle: Sql.Database does not support the query option 'Query' with value '"Select * from Owner.View_Name"'. Details: null
    I'm trying to download oracle data from a view into power query - Power Query navigator does not list th eviews from my source, it lists only the tables. When I try write sql statements, it throws me the above
    error. This is what I tried
     Oracle.Database("Source/Service",[Query="Select * from Owner.View_Name"])
    Any ideas how to fix this? 

  • Need help with paging in table layout

    Hi
    I am creating a basic table-form page with around 5000 rows in database table that needs to be displayed.
    However what i see after creating the table form page and adding detail groups i loose paging in the table layout.
    This is however undesirable.I cannot think of what is exactly making this happen there are no significant changes that i have made to the application.
    If I could know what possibly is causing the change, help would be appreciated.
    I can discuss this in detail.

    Which version of JHeadstart are you using?
    What do you mean with "i loose paging in the table layout"? Are the previous/next set and drop down list to select a range no longer displayed?
    Can you reproduce this in the HR demo applcation?
    If you remove the detail groups again, is pagination then working again.
    Steven Davelaar,
    JHeadstart team.

  • Need help with adding a table-like chart

    Post Author: lindad
    CA Forum: Charts and Graphs
    I am trying to see if there is any way to add a table to a Crystal Report (using Crystal 10) that looks like a table you would create in MSWord.  We need an easy way to remove and add columns in a table and right now using drawn lines and moving fields to realign every time is a real pain.

    Post Author: lindad
    CA Forum: Charts and Graphs
    The table includes multiple rows and columns where the fields are from different places in the db.  Also, the headers are just txt fields that do not associate with a specific field. 
    If I add a border to the fields, I still need to manually move them horizontally and vertically to realign if I add or delete a column or row.  As you know in MSWord, if you add or remove a column or row in a table, the table automatically resizes itself and makes the fields line up correctly.
    Is there any way to do this in Crystal?

  • Need Help with Advanced SQL Query

    It's advanced for me, at least. I have three tables that I
    need to use:
    Product (product_id and product_title are the fields)
    shipRegion (shipRegion_ID)
    product_shipRegion_shipCharge (product_id, shipRegion_ID,
    primaryShipCharge, secondaryShipCharge)
    What I am trying to do is create a query that will look for
    two things:
    1. Any product that is listed in the
    product_shipRegion_shipCharge table that has a primary or secondary
    ship charge of $0.00 or is NULL.
    That part is easy:
    SELECT DISTINCT p.product_id, p.product_title
    FROM product p
    INNER JOIN product_shipRegion_shipCharge pss ON p.product_id
    = pss.product_id AND (pss.primaryShipCharge IS NULL OR
    pss.primaryShipCharge = 0 OR pss.secondaryShipCharge IS NULL OR
    pss.secondaryShipCharge = 0)
    WHERE p.display = 1
    AND p.price > 0
    It's this next part that's tricky for me:
    2. Get the product_id and product_title (from the product
    table) that does NOT have any entry in the
    product_shipRegion_shipCharge table.
    I'm guessing that I need to include some kind of LEFT JOIN in
    the above query to find out what all of the regions are (from the
    shipRegion table) and then see what's missing for each product in
    the product_shipRegion_shipCharge table, but I have no idea how to
    do it.
    Anyone?
    Josh

    This should be what the query would look like using the left
    join:
    SELECT product_table.product_id, product_table.product_title
    FROM product_table
    LEFT OUTER JOIN product_shipRegion_shipCharge
    ON product_shipRegion_shipCharge.product_id =
    product_table.product_id
    WHERE product_shipRegion_shipCharge. product_id IS NULL
    SQL Server's query optimizer will probably turn the '...IN
    (subquery)' or '...exists (subquery)' into this kind of execution
    plan on its own - depending on your table structures.

  • Need help with MS SQL server JDBC driver

    Anyone has experience getting ACS working with SQL2005? We keep getting ‘com.adobe.adept.persist.DatabaseException: java.sql.SQLException: No suitable driver’
    We’re using sqljdbc.jar and sqljdbc4.jar that downloaded from Microsoft website. We added this to every library folder under tomcat, JRE and SDK but it did not help. Any suggestion will be helpful.
    Thanks-

    Hi,
    We have ACS with SQL Server 2005 Std correctly working.
    We have this settings:
    ############ SQL Server Connection ############
    com.adobe.adept.persist.sql.driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
    com.adobe.adept.persist.sql.connection=jdbc:sqlserver://ip-addressSQL:PortSQL;databaseName =Adept
    com.adobe.adept.persist.sql.dialect=microsoft
    com.adobe.adept.persist.sql.user=userSQL
    com.adobe.adept.persist.sql.password=passSQL
    Wi use Microsoft SQL Server JDBC Driver 3.0 downloaded from Microsoft website (http://www.microsoft.com/download/en/details.aspx?id=21599)
    Good luck,

  • Newbie - need help with a SQL query for a bar chart

    Hi,
    I'm a new user on APEX with no real SQL knowledge and I'm trying to build a dashboard with charts into an existing APEX application. Based on another application, I have come up with the following SQL code:
    select null link
    , CATEGORY label
    , count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
    , count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
    from GRAPO_PROHEADTRK
    where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
    group by CATEGORY
    Order by COUNT(PROJECT_ID) DESC
    The code from the other app was:
    select null link
    , FUNCTIONAL_AREA label
    , count (decode(PROJECT_STATUS,'Active',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'Complete',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'On Hold',PROJECT_ID)) "On Hold"
    , count (decode(PROJECT_STATUS,'Recurring',PROJECT_ID))"Recurring"
    , count (decode(PROJECT_STATUS,'Pipeline',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'Not Approved',PROJECT_ID))"Not Approved"
    from PM_V2
    where LOB='S2S' and (FUNCTIONAL_AREA='Accounts Payable' or FUNCTIONAL_AREA='Expense' or FUNCTIONAL_AREA='Procurement' or FUNCTIONAL_AREA='Fixed Assets')
    group by FUNCTIONAL_AREA
    Order by COUNT(PROJECT_ID) DESC
    I'm getting a "Failed to parse SQL query!" error when I try to run validation.
    Is this enough info for some assistance? Any help would really be appreciated.
    Thanks,
    Rachel

    Hello,
    This is more of an SQL question, rather than specifically APEX-related. It's notable that you say: I'm a new user on APEX with no real SQL knowledgeWhich is fine (we all have to start somewhere, afterall) but it might be worth de-coupling the problem from APEX in the first instance. I'd also strongly recommend either taking a course, reading a book (e.g. http://books.google.co.uk/books?id=r5vbGgz7TFsC&printsec=frontcover&dq=Mastering+Oracle+SQL&hl=en#v=onepage&q=Mastering%20Oracle%20SQL&f=false) or looking for a basic SQL tutorial - it will save you a whole lot of heartache, I promise you. Search the oracle forums for the terms "Basic SQL Tutorial" and you should come up with a bunch of results.
    Given that you've copied your query template from another, I would suggest ensuring that the actual query works first of all. Try running it in either:
    * SQL Editor
    * SQL*Plus
    * an IDE like SQL Developer (available free from the OTN: http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html ) or TOAD or similar.
    You may find there are syntax errors associated with the query - it's difficult to tell without looking at your data model.
    select null link
    , CATEGORY label
    , count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
    , count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
    from GRAPO_PROHEADTRK
    where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
    group by CATEGORYNote that your "order by" clause references a field called "PROJECT_ID", which exists in the old query but you've changed other similar references to "PROJECT_STATUS" - is it possible you've just missed this one? The perils of copy-paste coding I'm afraid...

  • I need help with an SQL Error: ORA-00904: "TBL_0022"."EUID": invalid identi

    Hello All,
    I am receiving an error message when I run a relatively simple insert statement. I have verified that all the columns are defined in the tables.
    Error starting at line 1 in command:
    INSERT INTO TBL_0022(TBL_0022.OLD_OBSID,TBL_0022.EUID,TBL_0022.MCUID,TBL_0022.WORKPERF,TBL_0022.LOC,TBL_0022.ACTION,TBL_0022.SIGN,TBL_0022.VEHID,TBL_0022.DLID,TBL_0022.SECID,TBL_0022.OBSDATE,TBL_0022.ENTDATE,TBL_0022.EID,TBL_0022.OLD0022ID,TBL_0022.OLD_ENTDATE)
    (SELECT TBL_0022_COPY.OLD_OBSID,TBL_0022_COPY.EUID,TBL_0022_COPY.MCUID,TBL_0022_COPY.WORKPERF,TBL_0022_COPY.LOC,TBL_0022_COPY.ACTION,TBL_0022_COPY.SIGN,TBL_0022_COPY.VEHID,TBL_0022_COPY.DLID,TBL_0022_COPY.SECID,TBL_0022_COPY.OBSDATE,TO_DATE(SUBSTR(TBL_0022_COPY.ENTDATE, 1, 8),'mm/dd/yyyy'),TBL_0022_COPY.EID,TBL_0022_COPY.OLD0022ID,TBL_0022_COPY.OLD_ENTDATE
    FROM TBL_0022_COPY
    WHERE length(TBL_0022_COPY.ENTDATE) = 14)
    Error at Command Line:1 Column:40
    Error report:
    SQL Error: ORA-00904: "TBL_0022"."EUID": invalid identifier

    Don't worry. Below is the formatted code for you. Run this and let me know what error it gives.
    INSERT INTO TBL_0022(TBL_0022.OLD_OBSID,
                         TBL_0022.EUID,
                         TBL_0022.MCUID,
                         TBL_0022.WORKPERF,
                         TBL_0022.LOC,
                         TBL_0022.ACTION,
                         TBL_0022.SIGN,
                         TBL_0022.VEHID,
                         TBL_0022.DLID,
                         TBL_0022.SECID,
                         TBL_0022.OBSDATE,
                         TBL_0022.ENTDATE,
                         TBL_0022.EID,
                         TBL_0022.OLD0022ID,
                         TBL_0022.OLD_ENTDATE)
    SELECT  TBL_0022_COPY.OLD_OBSID,
            TBL_0022_COPY.EUID,
            TBL_0022_COPY.MCUID,
            TBL_0022_COPY.WORKPERF,
            TBL_0022_COPY.LOC,
            TBL_0022_COPY.ACTION,
            TBL_0022_COPY.SIGN,
            TBL_0022_COPY.VEHID,
            TBL_0022_COPY.DLID,
            TBL_0022_COPY.SECID,
            TBL_0022_COPY.OBSDATE,
            TO_DATE(SUBSTR(TBL_0022_COPY.ENTDATE, 1, 8),'mm/dd/yyyy'),/* Something is wrong here with respect to 8 in substr*/
            TBL_0022_COPY.EID,
            TBL_0022_COPY.OLD0022ID,
            TBL_0022_COPY.OLD_ENTDATE
    FROM TBL_0022_COPY
    WHERE length(TBL_0022_COPY.ENTDATE) = 14Cheers
    Sarma.

  • Need help with global temporary table

    Can anyone please help, the following line of code :
    CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp ( obt_uuid VARCHAR2 ) ON COMMIT DELETE ROWS
    Yeilds the following error both in PL/SQL and running it in SQL PLUS
    Error starting at line 1 in command:
    CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp ( obt_uuid VARCHAR2 ) ON COMMIT DELETE ROWS
    Error report:
    SQL Error: ORA-00906: missing left parenthesis

    Hi,
    You have to put length to varchar2 column...
    SQL> CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp ( obt_uuid VARCHAR2(30) ) ON COMMIT DELETE ROWS;
    Table created
    SQL> CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp2 ( obt_uuid VARCHAR2 ) ON COMMIT DELETE ROWS;
    CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp2 ( obt_uuid VARCHAR2 ) ON COMMIT DELETE ROWS
    ORA-00906: missing left parenthesis
    SQL> Regards,

  • Need help with this sql query

    the following query returns me the correct no of rows:
    select col1 from tab1 where
    col1 like '%'||chr(32)||'%';
    but i need to use my query in the following form and it doesn't return any row:
    select col1 from tab1 where
    col1 IN ('%'||chr(32)||'%');
    what am I doing worng?
    thanks in advance.

    Or in 10g (just recycling another example):
    WITH t AS (SELECT 'OPTI1457' || CHR(32) col1
                 FROM dual
                UNION
               SELECT 'OPT123' || CHR(9)
                 FROM dual
                UNION
               SELECT 'OPTIM12345'
                 FROM dual
    SELECT t.*
      FROM t
    WHERE REGEXP_LIKE(t.col1, CHR(32) || '|' || CHR(9))
    ;       C.

  • Need help with PL/SQL functions

    Hi,
    Is there a way to compare if a set of elements is present in another set using some function?
    Example: Is it possible to find out if all words present in 'BANQUE SAFRA SA' is present in 'BANQUE JACOB SAFRA (SUISSE) SA' using some function in Oracle 9i?
    Any suggestion would be appreciated.
    Thank you,
    Anushree

    Boneist,
    your solution would giv "false positives":
    SQL&gt; with my_tab as (select 'BANQUE JACOB SAFRA (SUISSE) SA' col1 from dual union all
      2                  select 'BANQUE SAFRA (SUISSE) SB' col1 from dual union all
      3                  select 'BANQUE SAFRA SA' col1 from dual union all
      4                  select 'BANQUE SAFRANE SA' col1 from dual)
      5  -- end of mimicking your data. USE SQL below!
      6  select * from my_tab
      7  where col1 like replace('BANQUE SAFRA SA', ' ', '%');
    COL1
    BANQUE JACOB SAFRA (SUISSE) SA
    BANQUE SAFRA SA
    BANQUE SAFRANE SA  Here is a PL/SQL funcion that does not expect the words in the specific order:
    SQL> DECLARE
      2     FUNCTION strInStr(
      3        a   IN   VARCHAR2,
      4        b   IN   VARCHAR2)
      5        RETURN VARCHAR2
      6     IS
      7        i          PLS_INTEGER;
      8        startpos   PLS_INTEGER;
      9        endpos     PLS_INTEGER;
    10        word       VARCHAR2(4000);
    11     BEGIN
    12        FOR i IN 1 .. LENGTH(a) - LENGTH(REPLACE(a, ' ')) + 1 LOOP
    13           startpos := INSTR(' ' || a, ' ', 1, i);
    14           endpos := INSTR(a || ' ', ' ', 1, i);
    15           word := SUBSTR(a, startpos, endpos - startpos);
    16
    17           IF ' ' || b || ' ' NOT LIKE '% ' || word || ' %' THEN
    18              RETURN 'N';
    19           END IF;
    20        END LOOP;
    21
    22        RETURN 'Y';
    23     END;
    24  BEGIN
    25     DBMS_OUTPUT.put_line(strInStr('BANQUE SAFRA SA', 'BANQUE JACOB SAFRA (SUISSE) SA'));
    26     DBMS_OUTPUT.put_line(strInStr('SAFRA BANQUE SA', 'BANQUE JACOB SAFRA (SUISSE) SA'));
    27     DBMS_OUTPUT.put_line(strInStr('BANQUE SAFRA FRANCE', 'BANQUE JACOB SAFRA (SUISSE) SA'));
    28     DBMS_OUTPUT.put_line(strInStr('QUE SAFRA SA', 'BANQUE JACOB SAFRA (SUISSE) SA'));
    29  END;
    30  /
    Y
    Y
    N
    N

  • Need help with InDesign CS2 table

    How do you add multiple cells vertically to 1 row in a table? When I try to do this it add cells to the entire table. When I try to adjust them by clicking and dragging right or left, it moves all the other cells. I am using IDCS2

    CS2 is a little primitive, but put your cursor in the cell you want to divide, then Table > Split Cell Vertically (or horizontally), which will divide it in half. Repeat as necessary. To adjust the dimensions of the split cells over the text tool over a divider until you see the double-headed arrow, then press the Shift key while dragging the divider.

  • Need Help with this SQL Report

    Declare @Total int
    Select
    @Total=count(*)
    From
    v_Add_Remove_Programs
    Where
    v_Add_Remove_Programs.DisplayName0 Like '@DisplayName'
    Select Distinct
    v_Add_Remove_Programs.DisplayName0 as [Software Product],
    Version0 as [Version],
    COUNT(v_GS_System.Name0) as [Count],
    Round(100.0*count(*)/@Total,1) as [Percentage]
    FROM
    v_Add_Remove_Programs
    Join
    v_GS_System ON v_Add_Remove_Programs.ResourceID = v_GS_System.ResourceID
    WHERE
    v_Add_Remove_Programs.DisplayName0 Like '@DisplayName'
    GROUP BY
    Version0,
    v_Add_Remove_Programs.DisplayName0
    ORDER BY
    [Percentage] DESC
    Select Distinct
    v_GS_SYSTEM.Name0 as [Computer Name],
    v_Add_Remove_Programs.DisplayName0 as [Software Product],
    Version0 as [Version]
    FROM
    v_Add_Remove_Programs
    Join
    v_GS_SYSTEM ON v_Add_Remove_Programs.ResourceID = v_GS_SYSTEM.ResourceID
    WHERE
    v_Add_Remove_Programs.DisplayName0 Like '@DisplayName'
    GROUP BY
    v_GS_SYSTEM.Name0,
    Version0,
    v_Add_Remove_Programs.DisplayName0
    ORDER BY
    [Version] DESC
    If I remove the @DisplyaName variables and type in a product name sucha as:
    = 'Microsoft Office Professional 2013" or something, it works fine. How can I get the @DisplayName variables to work for me?
    Thanks

    v_Add_Remove_Programs.DisplayName0 Like '%'+ @DisplayName+'%'

Maybe you are looking for

  • My computer can no longer see my ipod mini.

    I bought my ipod about 2 weeks ago. 3 days ago i found that whenever i plugged it in to the computer, itunes would start up, it would start syncing with the ipod and then i would get the "blue screen of death" from windows and my system would restart

  • Drop Shadow is Causing a Colour Box to Appear Upon Print

    I am in the midst of creating a brochure which I am wanting ot use some drop shadows on to create separation between colours. I have noticed that in the three locations that i've used drop shadows (one is a white square shape, one is on font, and one

  • SPA3102 questions

    Hey all, I just read the admin guide for the SPA 3102 but I wanna make sure I didn't misunderstand anything so, could someone confirm that I can do all the stuff below, and note I'm in the UK. 1. Register 1 voip provider (VA) for outgoing calls, 1 di

  • My MacBook pro airport is not picking up IP address, how do I fix this?

    All this started after an automated update by the computer. Anyone else with this problem?

  • Query eDirectory LDAP using VB -

    Hey, I've been searching for days for a solution to vbe abe to do a simple query against eDirectory that would return an attribue from user's accounts. There seems to be very little information on this and the little I have doesnt work either so is t