Better SQL writing techniques

I know this is out of the Java scope but I am sure there are many SQL experts in this forum, I was just wondering whether anyone can point me to the right sources for learning how to write better SQL and hence faster execution.
I tried google and mostly I get the standard fixing the index, running the query analyzer ...etc.
But what I really want is some examples on things that we should avoid doing/using in a SQL statement, things that we should do more (for example, using outer join, but I never really come across an article that explains why that is).
I would appreciate if anyone knows a book or just a tutorial which does just that.
Thx.

Buying books and taking classes at community colleges are what help you to get better at sql writing.
I myself took a course in sql. The thing is that you can get better by taking classes. By the way, avoid join statements if you want to execute things faster. I prefer to use stored procedures because they are a compiled thing which in turn means faster execution. I don't have examples for stored procedures right now.
Hope it helps.

Similar Messages

  • Which is better - SQL Statement in APEX or as a function returning a type?

    Hi
    I have a general question about best practices for APEX development.
    If we have say a report region based on a SQL statement, is it better (from a performance perspective) to have the SQL statement defined in the region in APEX OR have the actual select statement executed in the backend and have the result set returned in a type to APEX?
    As an example:
    In APEX region
    SELECT col1, col2, col3 FROM table_aOR
    In APEX region
    select col1, col2, col3 from TABLE(CAST(<my package>.<my proceduere > AS <my type >)) ;<my package>.<my proceduere > would obviously execute the statement
    SELECT col1, col2, col3 FROM table_ausing dynamic SQL and return the results to APEX in thy type <my type>.
    Apologies if this sounds to be a really stupid thing to ask.
    Kind regards
    Paul

    Denes Kubicek wrote:
    You should use a pipelined function only then when you can't use SQL. Otherwise SQL is the way to go.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------thanks Denes... but does it matter if:
    1. The SQL statement is actually defined in the APEX region
    or
    2: The select statement is stored in a packageD function and returned to APEX?
    I seem to recall an article I read stating that it is best for all client applications to call stored procedures and functions rather than have SQL statement embedded in the actual application?
    Kind regards
    Paul

  • Windows7 Beta - SQL Developer causes Windows themes to be disabled

    If there is already a solution to this issue, I'd love to hear about it.
    When I start SQL Developer on Windows7 Beta x64, I get a notice that:
    A program that you're running is incompatible with the Windows 7 themes. When this happens, some visual elements are automatically turned off. When the program is no longer running, the visual elements that were turned off are turned on again automatically.
    The windows "themes" is the aero interface - I'm not sure if this is an issue with Vista or not (it has an aero interface too), I gave up on Vista almost immediately and have been running either XP (with no problems) or Windows7 Beta (only minor glitches).
    Does anyone know if there a Java or other setting that addresses this issue?

    Go to <sqldev install dir>\sqldeveloper\sqldeveloper\bin\sqldeveloper.conf and add the following line:
    AddVMOption -Dsun.java2d.noddraw=true
    I recommend you dont change the theme from the default to something else like Windows, lots of graphical glitches/exceptions
    Hope that helps.

  • A better SQL to avoid Index growth

    Our developer passed this code along to us as we are getting some performance and behaviour in our 9.2.0.7 DB. When this process run, our 4MB index grows to over 1.5 GB and we are forced to re-org it to bring it back down.
    BEGIN
    PRETERR := 'NO ERROR';
    PRETCODE := 0;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectalias';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectalias', V.PVR_ALIAS, NULL, NULL
    FROM T_PARTY_VERSION V, T_PARTY PT, T_PARTY_FUNCTION F
    WHERE PT.PTY_PARTY_ID = V.PVR_PTY_PARTY_ID
    AND F.PFY_PTY_PARTY_ID = PT.PTY_PARTY_ID
    AND SYSDATE BETWEEN PVR_EFFECTIVE_START_DATE AND
    PVR_EFFECTIVE_END_DATE
    AND PT.PTY_PARTY_STATUS <> 'D'
    AND V.PVR_ALIAS IS NOT NULL
    AND F.PFY_SHR_STAKE_HOLDER_FN_CODE = 'LENDER'
    ORDER BY 2;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectlender';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectlender', V.PVR_BUSINESS_NAME, NULL, NULL
    FROM T_PARTY_VERSION V, T_PARTY PT, T_PARTY_FUNCTION F
    WHERE PT.PTY_PARTY_ID = V.PVR_PTY_PARTY_ID
    AND F.PFY_PTY_PARTY_ID = PT.PTY_PARTY_ID
    AND SYSDATE BETWEEN PVR_EFFECTIVE_START_DATE AND
    PVR_EFFECTIVE_END_DATE
    AND PT.PTY_PARTY_STATUS <> 'D'
    AND V.PVR_BUSINESS_NAME IS NOT NULL
    AND F.PFY_SHR_STAKE_HOLDER_FN_CODE = 'LENDER'
    ORDER BY 2;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectlendername';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectlendername', PP.PRP_COLUMN_1, NULL, NULL
    FROM T_POLICY, T_POLICY_PARTY, T_POLICY_PARTY_PROPERTY PP
    WHERE POL_POLICY_ID = PPA_POL_POLICY_ID
    AND PPA_EFFECTIVE_END_DATE = TO_DATE('9999-01-01', 'RRRR-MM-DD')
    AND PPA_SHR_STAKE_HOLDER_FN_CODE = 'LENDER'
    AND POL_POLICY_ID = PP.PRP_POL_POLICY_ID
    AND PP.PRP_EFFECTIVE_END_DATE = TO_DATE('9999-01-01', 'RRRR-MM-DD')
    AND PP.PRP_COLUMN_1 IS NOT NULL
    ORDER BY 2;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectinsinstcode';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectinsinstcode', V.PVR_INSTITUTION_CODE, NULL, NULL
    FROM T_PARTY_VERSION V, T_PARTY PT, T_PARTY_FUNCTION F
    WHERE PT.PTY_PARTY_ID = V.PVR_PTY_PARTY_ID
    AND F.PFY_PTY_PARTY_ID = PT.PTY_PARTY_ID
    AND SYSDATE BETWEEN PVR_EFFECTIVE_START_DATE AND
    PVR_EFFECTIVE_END_DATE
    AND PT.PTY_PARTY_STATUS <> 'D'
    AND V.PVR_INSTITUTION_CODE IS NOT NULL
    AND F.PFY_SHR_STAKE_HOLDER_FN_CODE = 'LENDER'
    ORDER BY 2;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectinstransit';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectinstransit', V.PVR_TRANSIT_NUM, NULL, NULL
    FROM T_PARTY_VERSION V, T_PARTY PT, T_PARTY_FUNCTION F
    WHERE PT.PTY_PARTY_ID = V.PVR_PTY_PARTY_ID
    AND F.PFY_PTY_PARTY_ID = PT.PTY_PARTY_ID
    AND SYSDATE BETWEEN PVR_EFFECTIVE_START_DATE AND
    PVR_EFFECTIVE_END_DATE
    AND PT.PTY_PARTY_STATUS <> 'D'
    AND V.PVR_TRANSIT_NUM IS NOT NULL
    AND F.PFY_SHR_STAKE_HOLDER_FN_CODE = 'LENDER'
    ORDER BY 2;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectSubInstCode';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectSubInstCode', V.PVR_INSTITUTION_CODE, NULL, NULL
    FROM T_PARTY_VERSION V, T_PARTY PT, T_PARTY_FUNCTION F
    WHERE PT.PTY_PARTY_ID = V.PVR_PTY_PARTY_ID
    AND F.PFY_PTY_PARTY_ID = PT.PTY_PARTY_ID
    AND SYSDATE BETWEEN PVR_EFFECTIVE_START_DATE AND
    PVR_EFFECTIVE_END_DATE
    AND PT.PTY_PARTY_STATUS <> 'D'
    AND V.PVR_INSTITUTION_CODE IS NOT NULL
    AND F.PFY_SHR_STAKE_HOLDER_FN_CODE = 'LENDER'
    ORDER BY 2;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectSubTransNum';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectSubTransNum', V.PVR_TRANSIT_NUM, NULL, NULL
    FROM T_PARTY_VERSION V, T_PARTY PT, T_PARTY_FUNCTION F
    WHERE PT.PTY_PARTY_ID = V.PVR_PTY_PARTY_ID
    AND F.PFY_PTY_PARTY_ID = PT.PTY_PARTY_ID
    AND SYSDATE BETWEEN PVR_EFFECTIVE_START_DATE AND
    PVR_EFFECTIVE_END_DATE
    AND PT.PTY_PARTY_STATUS <> 'D'
    AND V.PVR_TRANSIT_NUM IS NOT NULL
    AND F.PFY_SHR_STAKE_HOLDER_FN_CODE = 'LENDER'
    ORDER BY 2;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectFileOwner';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectFileOwner',
    PVR_FIRST_NAME || ' ' ||
    DECODE(PVR_MIDDLE_NAME,
    NULL,
    PVR_MIDDLE_NAME || ' ') || PVR_LAST_NAME,
    NULL,
    PTY_PARTY_CODE
    FROM T_ROLE TR, T_USER_ROLE TUR, T_PARTY TP, T_PARTY_VERSION TPV
    WHERE TP.PTY_PARTY_ID = TPV.PVR_PTY_PARTY_ID
    AND SYSDATE BETWEEN TPV.PVR_EFFECTIVE_START_DATE AND
    TPV.PVR_EFFECTIVE_END_DATE
    AND TP.PTY_PARTY_ID = TUR.ULE_PFY_PTY_PARTY_ID
    AND (SYSDATE BETWEEN TUR.ULE_START_DATE AND TUR.ULE_END_DATE OR
    TUR.ULE_END_DATE IS NULL)
    AND TR.RLE_ROLE_ID = TUR.ULE_RLE_ROLE_ID
    AND PTY_PARTY_CODE NOT LIKE 'LTEST%'
    AND TR.RLE_ROLE_NAME IN
    ('VPOPS', /*'VPRSK2', */
    'OPSLEADER', 'TEAMLEADER', 'OPSLEVEL5', 'OPSLEVEL4', 'OPSLEVEL3',
    'OPSLEVEL2', 'OPSLEVEL1', 'OPSTRNG')
    AND PTY_PARTY_CODE IS NOT NULL
    ORDER BY 2;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectbrokername';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectbrokername', PP.PPA_NAME_BROKER_TEXT, NULL, NULL
    FROM T_POLICY, T_POLICY_PARTY PP
    WHERE POL_POLICY_ID = PPA_POL_POLICY_ID
    AND PPA_EFFECTIVE_END_DATE = TO_DATE('9999-01-01', 'RRRR-MM-DD')
    AND PPA_SHR_STAKE_HOLDER_FN_CODE = 'LENDER'
    AND TRIM(PP.PPA_NAME_BROKER_TEXT) IS NOT NULL
    ORDER BY 2;
    DELETE FROM T_TEAM_LIST_VAL WHERE LIST_DOMAIN = 'selectorg';
    INSERT INTO T_TEAM_LIST_VAL
    (LIST_DOMAIN, LIST_VALUE_1, LIST_VALUE_2, LIST_VALUE_3)
    SELECT DISTINCT 'selectorg', PT.PTY_PARTY_CODE, NULL, NULL
    FROM T_PARTY_VERSION V, T_PARTY PT, T_PARTY_FUNCTION F
    WHERE PT.PTY_PARTY_ID = V.PVR_PTY_PARTY_ID
    AND F.PFY_PTY_PARTY_ID = PT.PTY_PARTY_ID
    AND SYSDATE BETWEEN PVR_EFFECTIVE_START_DATE AND
    PVR_EFFECTIVE_END_DATE
    AND PT.PTY_PARTY_STATUS <> 'D'
    AND PT.PTY_PARTY_CODE IS NOT NULL
    AND F.PFY_SHR_STAKE_HOLDER_FN_CODE = 'LENDER'
    ORDER BY 2;
    COMMIT;Question 1 is with a delete and insert one after another, will this cause it to grow rapidly? Would it be better to run all the delete's first, commit and then the inserts and commit?
    Question 2 is at a high level, what method would be better. We though a truncate, however, the developer only deletes 40% data.

    Jonathan Lewis wrote:
    huh? wrote:
    Our developer passed this code along to us as we are getting some performance and behaviour in our 9.2.0.7 DB. When this process run, our 4MB index grows to over 1.5 GB and we are forced to re-org it to bring it back down.
    Your table definition shows the indexed column at CHAR(200) - which means fixed length; so 4MB equates to 20,000 row. If this grows to 1.5GB and rebuilds to 4MB then at some point your index runs to about 80KB per index entry. If, as you describe, you only delete about 40% of the data and re-insert a similar quantity just once the you must have hit a bug.
    You're on 9.2.0.7 (buggy) - were you using ASSM (also buggy). I came across a bug with ASSM on one occasion that resulted in a process using only 3 blocks from each index extent that it allocated during a pl/sql loop to modify a couple of hundred rows. Different circumstances from yours, and an earlier version - but you may have hit something similar.
    A few thoughts:
    <ul>
    If it's in ASSM move the index to a freelist-managed tablespace to see what happens
    If you need the index could you make it unusable for the load
    Should you have the index at all ?
    Should this table be list-partitioned on listdomain - then you could use partition exchange to load data like this
    </ul>
    Committing between delete and insert generally helps in cases like this.
    Committing between each delete/insert pair should (in the absence of bugs) help
    Regards
    Jonathan Lewis.Yes we are using ASSM. Yes we have been told the same that this sounds like a common bug. One thing we will do is the two commits as well as your suggestion and moving or altering the index and see how that fairs. Thanks for your help.

  • CRVS2010 Beta - SQL Prompt when viewing report

    Using integrated security SQL connections all works fine from development PC, but when I place out on Development server MS 2008, IIS 7.0 .net 4.0.   Report loads but I get prompted for SQL server credentials from report, I select Integrated Security from the prompt but no luck.  I have IIS7.0 Windows authentication and Impersomate turned on.
    This is using latest .net4.0 crsytal beta.
    I tested that a plain old integrated sql connection and sql text execute works from within code on server, so it is getting correct user impersonated, but report seems to be ignoring it or using anonymous.
    Any suggestions please?
    Below is config file:
    <?xml version="1.0"?>
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"><configSections><sectionGroup name="businessObjects"><sectionGroup name="crystalReports"><section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null"/></sectionGroup></sectionGroup></configSections>
         <appSettings>
              <add key="CrystalImageCleaner-AutoStart" value="true"/>
              <add key="CrystalImageCleaner-Sleep" value="60000"/>
              <add key="CrystalImageCleaner-Age" value="120000"/>
         </appSettings>
         <connectionStrings/>
         <system.web>
              <compilation debug="true" targetFramework="4.0">
                   <assemblies>
                        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
                        <add assembly="CrystalDecisions.ReportSource, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
                        <add assembly="CrystalDecisions.Shared, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
                        <add assembly="CrystalDecisions.Web, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
                        <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
                        <add assembly="CrystalDecisions.Enterprise.Framework, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
                        <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
                   </assemblies>
                   <buildProviders><add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></buildProviders></compilation>
              <authentication mode="Windows"/>
              <httpHandlers>
                   <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
              </httpHandlers>
         </system.web>
         <system.webServer>
              <validation validateIntegratedModeConfiguration="false"/>
              <handlers>
                   <add name="CrystalImageHandler.aspx_GET" path="CrystalImageHandler.aspx" verb="GET" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
              </handlers>
         </system.webServer>
         <businessObjects><crystalReports><rptBuildProvider><add embedRptInResource="true"/></rptBuildProvider></crystalReports></businessObjects></configuration>
    Edited by: Gafa99 on Sep 28, 2010 7:49 PM
    Subject modified as per the sticky post at the top of this forum; [Crystal Reports for Visual Studio 2010 Beta - read before posting|Crystal Reports for Visual Studio 2010 Beta - read before posting;
    Edited by: Ludek Uher on Sep 28, 2010 1:32 PM

    Changed report to use SQLOLEDE, instead of sql native client, and boom works on development server.

  • Please help with better sql plan - full test case

    Hello,
    here is my test case:
    SQL> create table ib_auth_devices(dv_id number(12) primary key , dv_cl_id number(12));
    Table created.
    SQL> create table ib_clients (cl_id number(12) primary key);
    Table created.
    SQL> alter table ib_auth_devices add constraint fk1 foreign key(dv_cl_id) references ib_clients(cl_id);
    Table altered.
    SQL> create table ib_tokens (to_dv_id number(12) primary key);
    Table created.
    SQL> alter table ib_tokens add constraint to_dv_id foreign key(to_dv_id) references ib_auth_devices(dv_id);
    Table altered.
    SQL> create table ib_auth_cards(au_dv_id number(12) primary key);
    Table created.
    SQL>  alter table ib_auth_cards add constraint  au_dv_id foreign key(au_dv_id) references ib_auth_devices(dv_id);
    Table altered.
    SQL> insert into ib_clients values(1);
    1 row created.
    SQL> insert into ib_clients values(2);
    1 row created.
    SQL> insert into ib_clients values(3);
    1 row created.
    SQL> insert into ib_clients values(4);
    1 row created.
    SQL> insert into ib_clients values(5);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> insert into ib_auth_devices values(1 , 1);
    1 row created.
    SQL> insert into ib_auth_devices values(2 , 2);
    1 row created.
    SQL>  insert into ib_auth_devices values(3,3);
    1 row created.
    SQL> insert into ib_auth_devices values(4,4);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> insert into ib_tokens values(1);
    1 row created.
    SQL> insert into ib_tokens values(2);
    1 row created.
    SQL> insert into ib_tokens values(3);
    1 row created.
    SQL> insert into ib_auth_cards values(1);
    1 row created.
    SQL> insert into ib_auth_cards values(2);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select cl_id from ib_clients;
         CL_ID
             1
             2
             3
             4
             5
    SQL> select cl_id from ib_clients cli , ib_auth_devices ad
      2  where
      3  cli.cl_id = ad.dv_cl_id;
         CL_ID
             1
             2
             3
             4
    SQL> select * from ib_tokens;
      TO_DV_ID
             1
             2
             3
    SQL> select * from ib_auth_cards;
      AU_DV_ID
             1
             2
    SQL> select * from ib_clients;
         CL_ID
             1
             2
             3
             4
             5
    SQL> select * from ib_auth_devices;
         DV_ID   DV_CL_ID
             1          1
             2          2
             3          3
             4          4
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_AUTH_DEVICES' , cascade => true);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_TOKENS'  , cascade => true);
    PL/SQL procedure successfully completed.
    SQL>  exec dbms_stats.gather_table_stats(user , 'IB_CLIENTS' , cascade => true);
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_AUTH_CARDS' ,  cascade => true);
    PL/SQL procedure successfully completed.
    SQL> l
      1  select cli.cl_id from ib_clients cli , ib_auth_devices ad,
      2          (select dv_cl_id as cl_id
      3            from ib_auth_cards, ib_auth_devices
      4            where
      5               au_dv_id = dv_id
      6            ) cards,
      7  (       select dv_cl_id as cl_id
      8            from ib_tokens, ib_auth_devices
      9            where
    10               to_dv_id = dv_id
    11           ) tokens
    12  where
    13  cli.cl_id = ad.dv_cl_id
    14  and cards.cl_id(+)= cli.cl_id
    15  and cards.cl_id is null
    16  and tokens.cl_id(+)= cli.cl_id
    17* and tokens.cl_id is null
    SQL> r
      1  select cli.cl_id from ib_clients cli , ib_auth_devices ad,
      2          (select dv_cl_id as cl_id
      3            from ib_auth_cards, ib_auth_devices
      4            where
      5               au_dv_id = dv_id
      6            ) cards,
      7  (       select dv_cl_id as cl_id
      8            from ib_tokens, ib_auth_devices
      9            where
    10               to_dv_id = dv_id
    11           ) tokens
    12  where
    13  cli.cl_id = ad.dv_cl_id
    14  and cards.cl_id(+)= cli.cl_id
    15  and cards.cl_id is null
    16  and tokens.cl_id(+)= cli.cl_id
    17* and tokens.cl_id is null
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=5 Card=4 Bytes=128)
       1    0   FILTER
       2    1     HASH JOIN (OUTER)
       3    2       FILTER
       4    3         HASH JOIN (OUTER)
       5    4           NESTED LOOPS (Cost=1 Card=4 Bytes=24)
       6    5             TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost=1
               Card=4 Bytes=12)
       7    5             INDEX (UNIQUE SCAN) OF 'SYS_C008299' (UNIQUE)
       8    4           VIEW (Cost=1 Card=2 Bytes=26)
       9    8             NESTED LOOPS (Cost=1 Card=2 Bytes=18)
      10    9               TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost
              =1 Card=4 Bytes=24)
      11    9               INDEX (UNIQUE SCAN) OF 'SYS_C008303' (UNIQUE)
      12    2       VIEW (Cost=1 Card=3 Bytes=39)
      13   12         NESTED LOOPS (Cost=1 Card=3 Bytes=27)
      14   13           TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost=1 C
              ard=4 Bytes=24)
      15   13           INDEX (UNIQUE SCAN) OF 'SYS_C008301' (UNIQUE)
    Statistics
              0  recursive calls
             12  db block gets
              9  consistent gets
              0  physical reads
              0  redo size
            364  bytes sent via SQL*Net to client
            431  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              8  sorts (memory)
              0  sorts (disk)
              1  rows processedAny ideas about rewriting this query to achive better performance ?
    Oracle version 8.1.7
    Best Regards.
    Grzegorz

    The answer to this question totally depends on the real volumes you have in your tables. Your test case is probably not showing us these volumes.
    However, I see some needless table accesses, so it's probably safe to conclude that this rewrite will speed something up:
    SQL> create table ib_auth_devices(dv_id number(12) primary key , dv_cl_id number(12));
    Tabel is aangemaakt.
    SQL> create table ib_clients (cl_id number(12) primary key);
    Tabel is aangemaakt.
    SQL> alter table ib_auth_devices add constraint fk1 foreign key(dv_cl_id) references ib_clients(cl_id);
    Tabel is gewijzigd.
    SQL> create table ib_tokens (to_dv_id number(12) primary key);
    Tabel is aangemaakt.
    SQL> alter table ib_tokens add constraint to_dv_id foreign key(to_dv_id) references ib_auth_devices(dv_id);
    Tabel is gewijzigd.
    SQL> create table ib_auth_cards(au_dv_id number(12) primary key);
    Tabel is aangemaakt.
    SQL> alter table ib_auth_cards add constraint  au_dv_id foreign key(au_dv_id) references ib_auth_devices(dv_id);
    Tabel is gewijzigd.
    SQL> insert into ib_clients values(1);
    1 rij is aangemaakt.
    SQL> insert into ib_clients values(2);
    1 rij is aangemaakt.
    SQL> insert into ib_clients values(3);
    1 rij is aangemaakt.
    SQL> insert into ib_clients values(4);
    1 rij is aangemaakt.
    SQL> insert into ib_clients values(5);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_devices values(1 , 1);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_devices values(2 , 2);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_devices values(3,3);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_devices values(4,4);
    1 rij is aangemaakt.
    SQL> insert into ib_tokens values(1);
    1 rij is aangemaakt.
    SQL> insert into ib_tokens values(2);
    1 rij is aangemaakt.
    SQL> insert into ib_tokens values(3);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_cards values(1);
    1 rij is aangemaakt.
    SQL> insert into ib_auth_cards values(2);
    1 rij is aangemaakt.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_AUTH_DEVICES' , cascade => true);
    PL/SQL-procedure is geslaagd.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_TOKENS'  , cascade => true);
    PL/SQL-procedure is geslaagd.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_CLIENTS' , cascade => true);
    PL/SQL-procedure is geslaagd.
    SQL> exec dbms_stats.gather_table_stats(user , 'IB_AUTH_CARDS' ,  cascade => true);
    PL/SQL-procedure is geslaagd.
    SQL> set autotrace on explain
    SQL> select cli.cl_id
      2    from ib_clients cli
      3       , ib_auth_devices ad
      4       , ( select dv_cl_id as cl_id
      5             from ib_auth_cards
      6                , ib_auth_devices
      7            where au_dv_id = dv_id
      8         ) cards
      9       , ( select dv_cl_id as cl_id
    10             from ib_tokens
    11                , ib_auth_devices
    12            where to_dv_id = dv_id
    13         ) tokens
    14   where cli.cl_id = ad.dv_cl_id
    15     and cards.cl_id(+)= cli.cl_id
    16     and cards.cl_id is null
    17     and tokens.cl_id(+)= cli.cl_id
    18     and tokens.cl_id is null
    19  /
                                     CL_ID
                                         4
    1 rij is geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=10 Card=4 Bytes=128)
       1    0   FILTER
       2    1     HASH JOIN (OUTER)
       3    2       FILTER
       4    3         HASH JOIN (OUTER)
       5    4           NESTED LOOPS (Cost=4 Card=4 Bytes=24)
       6    5             TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost=3 Card=4 Bytes=12)
       7    5             INDEX (UNIQUE SCAN) OF 'SYS_C001354381' (UNIQUE) (Cost=1 Card=1 Bytes=3)
       8    4           VIEW (Cost=3 Card=2 Bytes=26)
       9    8             NESTED LOOPS (Cost=3 Card=2 Bytes=18)
      10    9               INDEX (FULL SCAN) OF 'SYS_C001354385' (UNIQUE) (Cost=2 Card=2 Bytes=6)
      11    9               TABLE ACCESS (BY INDEX ROWID) OF 'IB_AUTH_DEVICES' (Cost=2 Card=1 Bytes=6)
      12   11                 INDEX (UNIQUE SCAN) OF 'SYS_C001354380' (UNIQUE) (Cost=1 Card=1)
      13    2       VIEW (Cost=3 Card=3 Bytes=39)
      14   13         NESTED LOOPS (Cost=3 Card=3 Bytes=27)
      15   14           INDEX (FULL SCAN) OF 'SYS_C001354383' (UNIQUE) (Cost=2 Card=3 Bytes=9)
      16   14           TABLE ACCESS (BY INDEX ROWID) OF 'IB_AUTH_DEVICES' (Cost=2 Card=1 Bytes=6)
      17   16             INDEX (UNIQUE SCAN) OF 'SYS_C001354380' (UNIQUE) (Cost=1 Card=1)
    SQL> select cli.cl_id
      2    from ib_clients cli
      3       , ib_auth_devices ad
      4   where cli.cl_id = ad.dv_cl_id
      5     and not exists
      6         ( select 'dummy'
      7             from ib_auth_cards
      8            where au_dv_id = ad.dv_id
      9         )
    10     and not exists
    11         ( select 'dummy'
    12             from ib_tokens
    13            where to_dv_id = ad.dv_id
    14         )
    15  /
                                     CL_ID
                                         4
    1 rij is geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=8 Card=1 Bytes=9)
       1    0   FILTER
       2    1     NESTED LOOPS (Cost=4 Card=1 Bytes=9)
       3    2       TABLE ACCESS (FULL) OF 'IB_AUTH_DEVICES' (Cost=3 Card=1 Bytes=6)
       4    2       INDEX (UNIQUE SCAN) OF 'SYS_C001354381' (UNIQUE) (Cost=1 Card=1 Bytes=3)
       5    1     INDEX (UNIQUE SCAN) OF 'SYS_C001354385' (UNIQUE) (Cost=1 Card=1 Bytes=3)
       6    1     INDEX (UNIQUE SCAN) OF 'SYS_C001354383' (UNIQUE) (Cost=1 Card=1 Bytes=3)Regards,
    Rob.

  • Better SQL Query for clients without boundaries?

    I've been using and modifying/experimenting with Chris Nackers' SQL query for missing boundaries (http://myitforum.com/myitforumwp/2011/12/07/sql-query-to-identify-missing-smsconfigmgr-boundaries/)
    below (changed to add aliases)--but this seems to mainly be showing us non-clients, as several computers that were indeed missing boundaries (using SCCM 2007 SP2 R3, and all our boundaries are protected, most are IP Range, a few IP Subnet, none AD Site) are
    not being listed, and everything in the listing has NULL SYS.Client0.
    Is there a better query to pinpoint this issue, or maybe using something (error code or log?) that would show computers that can't find a distribution point or some other evidence of not having a boundary?
    Thanks!
    SELECT DISTINCT SYS.Name0, SYS.Client0, IPA.IP_Addresses0, IPS.IP_Subnets0, SMSAS.SMS_Assigned_Sites0
    FROM dbo.v_R_System SYS
    LEFT OUTER JOIN dbo.v_RA_System_IPSubnets IPS ON SYS.ResourceID = IPS.ResourceID
    LEFT OUTER JOIN dbo.v_RA_System_IPAddresses IPA ON SYS.ResourceID = IPA.ResourceID
    LEFT OUTER JOIN dbo.v_RA_System_SMSAssignedSites SMSAS ON SYS.ResourceID = SMSAS.ResourceID
    LEFT OUTER JOIN dbo.v_RA_System_SystemOUName SOU ON SYS.ResourceID = SOU.ResourceID
    WHERE (SMSAS.SMS_Assigned_Sites0 IS NULL)
    AND (NOT (IPA.IP_Addresses0 IS NULL))
    AND (NOT (IPS.IP_Subnets0 IS NULL))
    AND SYS.Operating_System_Name_and0 LIKE 'microsoft%server%'
    ORDER BY IPS.IP_Subnets0, SYS.Name0

    I gotcha now... I think most people, myself included, rely on finding clients that are not assigned to determine if a boundary is missing. If you expect clients to not be assigned that's not going to work for you.
    WHERE (SMSAS.SMS_Assigned_Sites0
    IS NULL) 
    AND (NOT (IPA.IP_Addresses0
    IS NULL))
    AND (NOT
    (IPS.IP_Subnets0 IS
    NULL))
    = This is saying show me all clients not assigned but they do have an IP address and they do have a subnet discovered.
    In the case of CM12 it is actually possible for that not to work anyway because you can have separate boundaries for client assignment and content lookup.
    I am not aware of any query that can compare the IP address, AD Site and IP subnet from each client to what's configured in boundaries and find machines that do not fall into any boundary.
    John Marcum | http://myitforum.com/myitforumwp/author/johnmarcum/

  • How to find better SQL log in OBI Answers?

    While I have an error in making an OBI request in Answers page, the error message in the result tab is usually not very helpful, like:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27005] Unresolved column: "Sales Facts Current Month"."Amount Sold (000) Current Month". (HY000)
    SQL Issued: {call NQSGetQueryColumnInfo('SELECT "Sales Facts Current Month"."Amount Sold (000) Current Month", "Sales Facts"."Amount Sold", Calendar."Calendar Month Desc", Calendar."Calendar Month Name", Products."Prod Category" FROM SH')}
    SQL Issued: SELECT "Sales Facts Current Month"."Amount Sold (000) Current Month", "Sales Facts"."Amount Sold", Calendar."Calendar Month Desc", Calendar."Calendar Month Name", Products."Prod Category" FROM SHI then go to Session Monitor, and click the View Log link. By doing so, sometimes, I got the full sql statement. That is good and I can figure out the problems. Sometimes, I have things like:
    -------------------- SQL Request:
    SET VARIABLE QUERY_SRC_CD='Report',SAW_SRC_PATH='/shared/sh/Learn';SELECT Times."Calendar Month Name" saw_0, Times."Calendar Month Desc" saw_1, Products."Prod Category" saw_2, Salesfacts."Amount Sold" saw_3, REPORT_SUM(saw_3 BY saw_0, saw_1), REPORT_SUM(saw_3 BY ) FROM SH WHERE (TOPN(Times."Calendar Month Id",40) <= 40) AND (Channels."Channel Desc" = 'Direct Sales') ORDER BY saw_1, saw_0, saw_2
    +++Administrator:13290000:1329000f:----2009/09/29 09:18:33
    -------------------- General Query Info:
    Repository: Star, Subject Area: SH, Presentation: SH
    +++Administrator:13290000:1329000f:----2009/09/29 09:18:33
    -------------------- Cache Hit on query:
    Matching Query:     SET VARIABLE QUERY_SRC_CD='Report';SELECT Times."Calendar Month Name" saw_0, Times."Calendar Month Desc" saw_1, Products."Prod Category" saw_2, Salesfacts."Amount Sold" saw_3 FROM SH WHERE (TOPN(Times."Calendar Month Id",40) <= 40) AND (Channels."Channel Desc" = 'Direct Sales') ORDER BY saw_0, saw_1, saw_2
    Created by:     AdministratorThis does not help as the selected tables are not fully spell out. It appear like that OBI find the sql in cache and did process the request fully.
    Is there a way I can force OBI resend the request? Is there a way to get OBI log the full sql statement? That way I can copy the sql to SQL*Plus and find exactly the problem
    Thanks.

    Physical SQL is not visible as it hits the cache.
    you can :
    1) clear the physical cache from rpd and re-run the request.
    or
    2) copy the logical SQL, go to web Admin - issue SQL--paste the logical SQL there, then just change one parameter or two, so it does not hit the cache. E.g. change a filter to Feb from Jan...or just add a dummy column at the beginning as select 1 or select 'a' ....rest of the sql same.
    this way you can avoid hitting the cache and see the sql (at the bottom of the results - view log)
    make sure you have checked the presentation server cache option and set the log level to 4 or more to see details.
    HTH

  • Which is better design: writing a file or maintaining a list?

    Hi everybody,
    I'm just looking for a quick recommendation from the design perspective. For a group of 20,000 strings or more, if they need to be edited, is it better for efficiency and speed to save them in a list within a program, or to write a file containing the strings, and then access them from there? If you have an opinion on that I would really appreciate it.
    Thanks!
    Jezzica85

    jezzica85 wrote:
    So, if I definitely don't need a separate file, and I may not need a list, is there an easy way to read multiple lines in the same file reader? The easiest way to read individual lines, from a java.io.FileReader, is to wrap it in a BufferedReader and use readLine().
    Like this:BufferedReader in = new BufferedReader(myFileReader);
    String line;
    while((line = in.readLine() != null) {
      // do stuff with line
    Basically, I need to determine which lines are in my final file both by knowing the line I'm reading and the lines before and after it.If you only can tell whether you need a line depending on the lines that come after it, then you're going to have to store the line while you read the subsequent lines. In that case, a list will be fine. (Well, you can also use a regular scalar String-typed variable, but chances are you're going to be storing multiple lines at a time, thus a List). If you're only going to make the determination based on lines that came earlier, then you don't need a list. You might want to use boolean or other types of variables to keep track of whether you need to keep a line.
    For example, if the only criterion is that spans of blank lines get replaced by a single blank line, then you could probably get by with a single String variable. Stick the current line into a variable, then get the next line. If both the new line and the previous line are blank, throw away the new line. Otherwise, print the old one and put the new one in the old one's place in the variable.
    It will all depend on your program requirements. Just try to keep things simple and don't build stuff than you need.

  • Improve performance SQL using better SQL functions

    Good afternoon,
    I am trying to improve the performance of a SQL query, embedded within a Pro*C environment.
    The query is the following:
    SELECT ri FROM
    TRANSLAT WHERE (:ora9_ogt_prfx LIKE (TRANSLAT.OGT_PRFX||'%')) AND
    (:ora9_in_prfx LIKE (TRANSLAT.IN_PRFX||'%')) AND
    (LENGTH(:ora9_in_prfx) = ASCII(TRANSLAT.IN_LGTH))
    ORDER BY LENGTH(TRANSLAT.OGT_PRFX) DESC,
    LENGTH(TRANSLAT.IN_PRFX) DESC
    The table format is the following:
    SQL> desc translat;
    Name Type
    IN_LGTH CHAR(1)
    IN_PRFX VARCHAR2(24)
    NAME VARCHAR2(20)
    OGT_PRFX VARCHAR2(24)
    OUT_PRFX VARCHAR2(24)
    RI NUMBER(18)
    SNPUPDT NUMBER
    The idea of the query is the following:
    Give the information about a tupple with following conditions:
    - The field "OGT_PREFIX" starts with ora9_ogt_prfx
    - The field "IN_PREFIX" starts with ora9_in_prfx
    - Some length variable should be ok
    and order them, first following the OGT_PRFX field, and second following the IN_PRFX field.
    Following a tkprof analysis, this query is parsed again everytime it is needed,
    despite the usage of bind variables (all variables start with a ':' character).
    Questions:
    - Why is the query parsed again every time?
    - Personally I think this is due to the '||' operator. Is there another way of saying that a variable should start with the value of a field in such a way that the '||' operator is not needed (does there exist a logical operator like "Begins_with" so that the conditions becomes "TRANSLAT.IN_PRFX Begins_with :ora9_in_prfx")?
    - Within the query, there is always a reference towards the table itself while referencing a field. Would it make any performance difference if "TRANSLAT.OGT_PRFX" is replaced by "OGT_PRFX", "TRANSLAT.IN_PRFX" by "IN_PRFX", ...?
    Thanks a lot
    Dominique
    P.s. if this thread is entered in the wrong discussion forum, please let me know.

    - Why is the query parsed again every time?Because somewhere in the code the cursor gets closed, so on a subsequent usage you have to open it again and parse again.
    - Personally I think this is due to the '||'
    operator. Is there another way of saying that a
    variable should start with the value of a field in
    such a way that the '||' operator is not needed (does
    there exist a logical operator like "Begins_with" so
    that the conditions becomes "TRANSLAT.IN_PRFX
    Begins_with :ora9_in_prfx")?I think that you don't know a reason for the seen behaviour and you are guessing here.
    Please post the tkprof output here so we can examine what is the root cause for your performance problem. And by the way, what is the response time and what is acceptable?
    - Within the query, there is always a reference
    towards the table itself while referencing a field.
    Would it make any performance difference if
    "TRANSLAT.OGT_PRFX" is replaced by "OGT_PRFX",
    "TRANSLAT.IN_PRFX" by "IN_PRFX", ...?No, in fact the use of aliases or even table names is considered a good practice, especially when more tables are involved, and in this case of only one table it doesn't really matter.
    Regards,
    Rob.

  • Better sql query.

    hello all,
    i am using 11g db, and have written a query which joins 4-5 tables and fetches data .these are big tables and query takes some time.
    suppoes the tables are tab1 to tab5.
    now i want to add another condition using tab6, which has2.5 milion records.
    i have to see that the data fetched from the query does not have a matching record in tab6
    eg:
    filter condition is
    and (tab3.col1,tab3.col2) not in (select tab6.col1, tab6.col2 from tab6)
    i assume that this will iterate 2.5 million times for every row fetched from the main query .
    is there a better way?
    thanks

    The Oracle optimiser is smart and has many ways of doing things. The query might iterate over the first set and look up an index on tab6 (col1, col2) but I think it is more likely to do another type of anti-join (hash or merge) because row by row lookups end up doing so much I/O. It will do its best to avoid scanning tab6 multiple times. With millions of rows, single full table scans are good. If your original query is estimated to only get a few thousand rows, and there is no index, I'd expect to see a hash anti-join with the database working out the original result set then using the hash anti-join to remove the rows that have a match.
    You can get some idea by doing an explain plan on the proposed query, although the most accurate results come from running the query then using DBMS_XPLAN.DISPLAY_CURSOR to view the actual plan. In SQLPlus, set serverout off; alter session set statistics_level=ALL; run your query then select * from table(dbms_xplan.display_cursor(null, null, 'IOSTATS LAST'))
    Another way of describing the query is
    select ... from (current query) q
    left outer join tab6 on tab6.col1 = tab3.col1 and tab6.col2 = tab3.col2
    where tab6.col1 is null
    That uses an outer join to find the cases where the row exists and then the where clause excludes those, keeping only the rows where there was no match. This sometimes gives a different plan.
    Tell us your Oracle version, (to 4 places e.g. 11.2.0.3) at least, and try each query to see what it does.
    regards,
    David

  • Is VISA Write VI / Out Port (need AccessHW) better for writing to parallel port?

    We have experimented with 2 methods for writing to parallel port:
    1. Using NI VISA directly by calling VISA Write vi.
    2. Using the Out Port vi, for which we had to install AccessHW.
    Does the first method have any disadvantages. It seems to be a simpler solution.
    Operating system: Windows 2000
    Labview 8.2
    NI VISA 4.0

    Hey rashadi,
    There is nothing wrong with using the VISA write.vi to write to a parallel port.  Here is a great example program of how to use the VISA vi's to write to a parallel  port. 
    I hope this helps!
    Best regards,
    Jason W
    Applications Engineering
    National Instruments

  • BETTER RE-WRITING THAN FINAL DRAFT?

    My biggest problem in Final Draft 7 is when you go back and re-write dialogue, scene headings etc. When you delete things the chance is high that a dialogue part - for instance - recieve formatting from a following element. This is extremely disturbing, and when you try to correct each following element inherits the problem.
    Example: I go back to
                   CHARACTER
    Blah blah blah blah blah blah blah
    blah blah blah blah blah blah blah
    blah blah blah
    TRANSITION
    If i delete the red part, and starts replacing it (blah2), it often becomes like this:
                   CHARACTER
    Blah blah blah blah blah blah blah
    blah blah blah blah blah blah blah
    BLAH2 BLAH2 BLAH2TRANSITION
    (or something similar)
    Perhaps another topic, but:
    It is extremely important that you can write fast, without using the mouse/trackpad. Everything should be able to be reached with a simple key/shortcut. The worst thing about all word processing in general - but especially in scriptwriting -  is when you are forced to use the mouse. Make sure this is considered, and you will dominate the market in less than a few months. Rather release a well developed version first, than hand out new releases in steps and let us wait for the reasons to switch to AS. It is a picky and conservative target group, scriptwriters. The nice breakdown funcions will always be inferior in comparison to the user-friendliness of the writing itself.
    And last:
    Why does never Adobe offer competitions/perks/prices for good suggestions from their users?

    Can you explain why this just came into my mailbox?
    http://www.crispstyle.com Sell:Ed/POLO tshirt$13,jean$30,handbag$35,jordan shoes$32,jean$30 Free shipping!   
    http://www.crispstyle.com
    the website kicksquality :/ for many kinds of fashion shoes, like the
    nike,jordan,prama,****, also including the jeans,shirts,bags,hat and the
    decorations. All the products are free shipping, and the the price is competitive,
    and also can accept the paypal payment.,after the payment, can ship within short
    time.
    free shipping
    competitive price
    any size available
    accept the paypal
    our price:
    gstar coogi evisu true jeans $36;
    coach chanel gucci LV handbags $32;
    coogi DG edhardy gucci t-shirts $15;
    CA edhardy vests.paul smith shoes $35;
    jordan dunk af1 max gucci shoes $33;
    EDhardy gucci ny New Era cap $15;
    coach okely **** CHANEL DG Sunglass $16;
    our price:coach chanel gucci LV handbags $32coogi DG edhardy gucci t-shirts $15CA edhardy vests.paul smith shoes $35jordan dunk af1 max gucci shoes $33EDhardy gucci ny New Era cap $15coach okely CHANEL DG Sunglass $16.our price: (Bikini)coach chanel gucci LV handbags $32.coogi DG edhardy gucci t-shirts $15.CA edhardy vests.paul smith shoes $35.jordan dunk af1 max gucci shoes $33.EDhardy gucci ny New Era cap $15.coach okely CHANEL DG Sunglass $16
    http://www.crispstyle.com
    This message was sent to: JRQSR
    To post a reply to the thread message, either reply to this email or visit the message page:
    http://forums.adobe.com/message/2243854#2243854
    --end--

  • CRVS 2010 beta - SQL error 4502 (on previous runtimes the report works)

    I'm testing the new 2010 runtimes.
    Almost every report work except some.
    In one of them I obtain an error 4502 (View or function has more column names specified than columns defined) and I can't explain why.
    Doing "verify database" on the report it seems ok. Running it with previous runtimes gives no problem.
    Any hint or something to check?
    Maybe the query that CR sends to SQL Server is wrong.. but how can I check without CR2010?
    In CR11.5 it's correct.
    Thanks

    this is the "show query" for the main report (cr2008)
    SELECT "ProSerAll"."FKCodPro", "ProSerAll"."DesPro", "ProSerAll"."Des2Pro", "ProSerAll"."CodIvaVenPro", "ProSerAll"."CodSosPro", "ProSerAll"."CtlStaPro", "ProSerAll"."ImpPro", "ProSta"."AnnRifSta", "ProSta"."QtaGenSta", "ProSta"."ValGenSta", "ProSta"."ValFebSta", "ProSta"."QtaFebSta", "ProSta"."ValMarSta", "ProSta"."QtaMarSta", "ProSta"."ValAprSta", "ProSta"."QtaAprSta", "ProSta"."ValMagSta", "ProSta"."QtaMagSta", "ProSta"."ValGiuSta", "ProSta"."QtaGiuSta", "ProSta"."ValLugSta", "ProSta"."QtaLugSta", "ProSta"."ValAgoSta", "ProSta"."QtaAgoSta", "ProSta"."ValSetSta", "ProSta"."QtaSetSta", "ProSta"."ValOttSta", "ProSta"."QtaOttSta", "ProSta"."ValNovSta", "ProSta"."QtaNovSta", "ProSta"."ValDicSta", "ProSta"."QtaDicSta", "ProSerAll"."FKAnaAzi", "ProSerOrdFor"."DatUltOrdFor", "ProSerOrdFor"."QtaUltOrdFor", "ProSerAll"."IDPro"
    FROM   ("WinCodyDB"."dbo"."ProSerAll" "ProSerAll" INNER JOIN "WinCodyDB"."dbo"."ProSta" "ProSta" ON ("ProSerAll"."FKAnaAzi"="ProSta"."FKAnaAzi") AND ("ProSerAll"."IDPro"="ProSta"."FKIDPro")) INNER JOIN "WinCodyDB"."dbo"."ProSerOrdFor" "ProSerOrdFor" ON ("ProSerAll"."FKAnaAzi"="ProSerOrdFor"."FKAnaAzi") AND ("ProSerAll"."IDPro"="ProSerOrdFor"."FKIDPro")
    ORDER BY "ProSerAll"."FKCodPro", "ProSta"."AnnRifSta"
    Subreport 1 ("TEST" and "1" were subreport paramenters I input manually when I did "show query):
    SELECT "LisRig"."Qta1LisRig", "LisRig"."Qta2LisRig", "LisRig"."Qta3LisRig", "LisRig"."Qta4LisRig", "LisRig"."Qta5LisRig", "LisRig"."PreEur1LisRig", "LisRig"."PreEur2LisRig", "LisRig"."PreEur3LisRig", "LisRig"."PreEur4LisRig", "LisRig"."PreEur5LisRig", "LisRig"."FKNumLisRig", "LisRig"."FKCodProLisRig", "LisRig"."FKAnaAzi"
    FROM   "WinCodyDB"."dbo"."LisRig" "LisRig"
    WHERE  "LisRig"."FKNumLisRig"=1 AND "LisRig"."FKCodProLisRig"=N'TEST' AND "LisRig"."FKAnaAzi"=1
    Subreport 2 (same as above for "TEST" and "1")
    SELECT "ProStaAnnEse"."FKCodProSta", "ProStaAnnEse"."TotCarValSta", "ProStaAnnEse"."TotCarQtaSta", "ProStaAnnEse"."NumCarValSta", "ProStaAnnEse"."NumCarQtaSta", "ProStaAnnEse"."NumScaValSta", "ProStaAnnEse"."NumScaQtaSta", "ProStaAnnEse"."TotScaValSta", "ProStaAnnEse"."TotScaQtaSta", "ProStaAnnEse"."EsiAttSta", "ProStaAnnEse"."EsiIniSta", "ProStaAnnEse"."FKAnaAzi"
    FROM   "WinCodyDB"."dbo"."ProStaAnnEse" "ProStaAnnEse"
    WHERE  "ProStaAnnEse"."FKCodProSta"=N'TEST' AND "ProStaAnnEse"."FKAnaAzi"=1
    ORDER BY "ProStaAnnEse"."FKCodProSta"
    Subreport 3 ("1" and "1" were parameters)
    SELECT "CosGen"."CosPre", "CosGen"."CosUlt", "CosGen"."CosMed", "CosGen"."FKAnaAzi", "CosGen"."FKIDPro"
    FROM   "WinCodyDB"."dbo"."CosGen" "CosGen"
    WHERE  "CosGen"."FKAnaAzi"=1 AND "CosGen"."FKIDPro"=1
    Can't be more detailed than this.

  • Nees for better SQL error handling???

    Hello everybody!
    I am having problems with identifying the reason why SQLExceptions are thrown. What I mean is that the reason is stored in the sql state and the sql code variables. As far as I know, this sql code may be platform dependent which makes the whole mechanism somehow hard to use.
    I simply miss sublasses of the SQLException like - DuplicateEntrySQLException, ForeignKeyConstraintFailureSQLException, ...
    - I think this approach would be far too way natural and obvious.
    My question is: does anybody know about a package or something like that which would implement a kind of "re-thrower" class which would consume the SQLException, inspect it and based on the exception's state it would throw a nice exception in the sense described above?
    Thank you!
    Cheers,
    Miro

    Why not check the data beforehand only?
    Normally I have a validate method in which I run a check on the data submitted by the user. there I see if the Data is violating any of the foriegn key, unique constraints or length of the field.
    I don't insert the data first into the DB without any validation.
    If you don't do this, then there is no way for you to know whether the problem occurred because of the data provided by the user or because the DB is having system level or n/w level problem.
    On the fly analysis is not possible because a DB (ex. oracle, sql server) each is capable of throwing ten thousand kind of errors. you really can't translate it by a package.
    So the best way to handle your situation is that validate the data first. If there is a problem report it to the user. If validation suceeds then go ahead with the insert, update command.
    If the user still gets an SQLException then it assume a system level error and display message like "Foo Portal is temporarily unavailable. Kindly call 4343343 in case of emergency"
    Test your system pretty well specially the validation logic so that you don't display the sys unavailable message when the DB is available but the data has errors.
    hope this helps.
    regards,
    Abhishek.

Maybe you are looking for

  • Firefox says: your firefox profile cannot be loaded. It may be missing or inaccessible.

    I have a laptop that's windows 8 I have tried reinstalling and deleting firefox and nothing has worked. I can't get onto the toolbar of firefox because it will not open. There is a folder on my desktop that says old firefox data and in it are bookmar

  • COPA Realignments for line item based reports

    Hi Guru I built two CO-PA  line item based reports in our environment. Now , there are some organizational changes in our environment and Now I have re-derive a characteristic from customer master data. Does those changes reflect in my line item base

  • Portlet cusomization open in a new window

    When I click on customize in sample 'Lottery Portlet', I want edit customization window to open as a separate browser window. I am wondering if we can do this by adding javascript code to iFrame_customize.jsp file or some other file. Any help will be

  • Print in MIDP ...

    How to print some text to a printer connectting with the PALM ? tks.

  • Help with a script (what am I doing wrong)

    tell application "Finder" set theFolder to (choose folder with prompt "choose the user folder") as Unicode text set newFolder to make new folder at theFolder as Unicode text with properties {name:"test folder"} set targetFolder to newFolder move enti