AD HOC SQL request

Hi,
Sorry if this one is a bit silly but how can I create a SQL request such as 'SELECT FIELDA,FIELDB,FIELDC FROM TABLE WHERE FIELDC = 'BLA'' and use the result as an input for an interface?
JF

Use ODI for that :)
Create or reverse the datastore "TABLE" with column FIELDA etc..
create an interface
drag and drop your datastore "TABLE' and create the mapping do not forget the filter FIELDC="BLA"

Similar Messages

  • Performance issue on 1 SQL request

    Hi,
    We have a performance problem. We have 2 systems. PRD and QAS (QAS is a copy of PRD as of September 2nd)
    SQL request is identical.
    table structures is identical.
    indexes are identical.
    views are identical
    DB stats have all been recalculated on both systems
    initSID.ora values are almost identical. only memory related parameters (and SID) are different.
    Obviously, data is different
    For you info, view ZBW_VIEW_EKPO fetched its info from tables EIKP, LFA1, EKKO and EKPO.
    Starting on September 15th, a query that used to take 10 minutes started taking over 120 minutes.
    I compared explain plans on both system and they are really different:
    SQL request:
    SELECT
      "MANDT" , "EBELN" , "EBELP" , "SAISO" , "SAISJ" , "AEDAT" , "AUREL" , "LOEKZ" , "INCO2" ,
      "ZZTRANSPORT" , "PRODA" , "ZZPRDHA" , "ZZMEM_DATE" , "KDATE" , "ZZHERKL" , "KNUMV" , "KTOKK"
    FROM
      "ZBW_VIEW_EKPO"
    WHERE
      "MANDT" = :A0#
    Explain plan for PRD:
    SELECT STATEMENT ( Estimated Costs = 300,452 , Estimated #Rows = 0 )
            8 HASH JOIN
              ( Estim. Costs = 300,451 , Estim. #Rows = 4,592,525 )
              Estim. CPU-Costs = 9,619,870,571 Estim. IO-Costs = 299,921
              Access Predicates
                1 TABLE ACCESS FULL EIKP
                  ( Estim. Costs = 353 , Estim. #Rows = 54,830 )
                  Estim. CPU-Costs = 49,504,995 Estim. IO-Costs = 350
                  Filter Predicates
                7 HASH JOIN
                  ( Estim. Costs = 300,072 , Estim. #Rows = 4,592,525 )
                  Estim. CPU-Costs = 9,093,820,218 Estim. IO-Costs = 299,571
                  Access Predicates
                    2 TABLE ACCESS FULL LFA1
                      ( Estim. Costs = 63 , Estim. #Rows = 812 )
                      Estim. CPU-Costs = 7,478,316 Estim. IO-Costs = 63
                      Filter Predicates
                    6 HASH JOIN
                      ( Estim. Costs = 299,983 , Estim. #Rows = 4,592,525 )
                      Estim. CPU-Costs = 8,617,899,244 Estim. IO-Costs = 299,508
                      Access Predicates
                        3 TABLE ACCESS FULL EKKO
                          ( Estim. Costs = 2,209 , Estim. #Rows = 271,200 )
                          Estim. CPU-Costs = 561,938,609 Estim. IO-Costs = 2,178
                          Filter Predicates
                        5 TABLE ACCESS BY INDEX ROWID EKPO
                          ( Estim. Costs = 290,522 , Estim. #Rows = 4,592,525 )
                          Estim. CPU-Costs = 6,913,020,784 Estim. IO-Costs = 290,141
                            4 INDEX SKIP SCAN EKPO~Z02
                              ( Estim. Costs = 5,144 , Estim. #Rows = 4,592,525 )
                              Search Columns: 2
                              Estim. CPU-Costs = 789,224,817 Estim. IO-Costs = 5,101
                             Access Predicates Filter Predicates
    Explain plan for QAS:
    SELECT STATEMENT ( Estimated Costs = 263,249 , Estimated #Rows = 13,842,540 )
            7 HASH JOIN
              ( Estim. Costs = 263,249 , Estim. #Rows = 13,842,540 )
              Estim. CPU-Costs = 59,041,893,935 Estim. IO-Costs = 260,190
              Access Predicates
                1 TABLE ACCESS FULL LFA1
                  ( Estim. Costs = 63 , Estim. #Rows = 812 )
                  Estim. CPU-Costs = 7,478,316 Estim. IO-Costs = 63
                  Filter Predicates
                6 HASH JOIN
                  ( Estim. Costs = 263,113 , Estim. #Rows = 13,842,540 )
                  Estim. CPU-Costs = 57,640,387,953 Estim. IO-Costs = 260,127
                  Access Predicates
                    4 HASH JOIN
                      ( Estim. Costs = 2,127 , Estim. #Rows = 194,660 )
                      Estim. CPU-Costs = 513,706,489 Estim. IO-Costs = 2,100
                      Access Predicates
                        2 TABLE ACCESS FULL EIKP
                          ( Estim. Costs = 351 , Estim. #Rows = 54,830 )
                          Estim. CPU-Costs = 49,504,995 Estim. IO-Costs = 348
                          Filter Predicates
                        3 TABLE ACCESS FULL EKKO
                          ( Estim. Costs = 1,534 , Estim. #Rows = 194,660 )
                          Estim. CPU-Costs = 401,526,622 Estim. IO-Costs = 1,513
                          Filter Predicates
                    5 TABLE ACCESS FULL EKPO
                      ( Estim. Costs = 255,339 , Estim. #Rows = 3,631,800 )
                      Estim. CPU-Costs = 55,204,047,516 Estim. IO-Costs = 252,479
                      Filter Predicates
    One more bit of information, PRD was copied to TST about a month ago and this one is also slow.
    I did almost anything I could think of.

    > DB stats have all been recalculated on both systems
    > initSID.ora values are almost identical. only memory related parameters (and SID) are different.
    > Obviously, data is different
    Ok, so you say: the parameters are different, the data is different and the statistics are different.
    I'm surprised that you still expect the plans to be the same...
    > For you info, view ZBW_VIEW_EKPO fetched its info from tables EIKP, LFA1, EKKO and EKPO.
    We will need to see the view definition !
    > Starting on September 15th, a query that used to take 10 minutes started taking over 120 minutes.
    Oh - Sep. 15th - that explains it ... just kiddin'.
    Ok, so it appears to be obvious that from that day on, the execution plan for the query was changed.
    If you're on Oracle 10g you may look it up again and also recall the CBO stats that had been used back then.
    > I compared explain plans on both system and they are really different:
    >
    > SQL request:
    >
    SELECT
    >   "MANDT" , "EBELN" , "EBELP" , "SAISO" , "SAISJ" , "AEDAT" , "AUREL" , "LOEKZ" , "INCO2" ,
    >   "ZZTRANSPORT" , "PRODA" , "ZZPRDHA" , "ZZMEM_DATE" , "KDATE" , "ZZHERKL" , "KNUMV" , "KTOKK"
    > FROM
    >   "ZBW_VIEW_EKPO"
    > WHERE
    >   "MANDT" = :A0#
    Ok - basically you fetch all rows from this view as MANDT is usually not a selection criteria at all.
    > Explain plan for PRD:

    SELECT STATEMENT ( Estimated Costs = 300,452 , Estimated #Rows = 0 )
    >
    >         8 HASH JOIN
    >           ( Estim. Costs = 300,451 , Estim. #Rows = 4,592,525 )
    >           Estim. CPU-Costs = 9,619,870,571 Estim. IO-Costs = 299,921
    >           Access Predicates
    >
    >             1 TABLE ACCESS FULL EIKP
    >               ( Estim. Costs = 353 , Estim. #Rows = 54,830 )
    >               Estim. CPU-Costs = 49,504,995 Estim. IO-Costs = 350
    >               Filter Predicates
    >             7 HASH JOIN
    >               ( Estim. Costs = 300,072 , Estim. #Rows = 4,592,525 )
    >               Estim. CPU-Costs = 9,093,820,218 Estim. IO-Costs = 299,571
    >               Access Predicates
    >
    >                 2 TABLE ACCESS FULL LFA1
    >                   ( Estim. Costs = 63 , Estim. #Rows = 812 )
    >                   Estim. CPU-Costs = 7,478,316 Estim. IO-Costs = 63
    >                   Filter Predicates
    >                 6 HASH JOIN
    >                   ( Estim. Costs = 299,983 , Estim. #Rows = 4,592,525 )
    >                   Estim. CPU-Costs = 8,617,899,244 Estim. IO-Costs = 299,508
    >                   Access Predicates
    >
    >                     3 TABLE ACCESS FULL EKKO
    >                       ( Estim. Costs = 2,209 , Estim. #Rows = 271,200 )
    >                       Estim. CPU-Costs = 561,938,609 Estim. IO-Costs = 2,178
    >                       Filter Predicates
    >                     5 TABLE ACCESS BY INDEX ROWID EKPO
    >                       ( Estim. Costs = 290,522 , Estim. #Rows = 4,592,525 )
    >                       Estim. CPU-Costs = 6,913,020,784 Estim. IO-Costs = 290,141
    >
    >                         4 INDEX SKIP SCAN EKPO~Z02
    >                           ( Estim. Costs = 5,144 , Estim. #Rows = 4,592,525 )
    >                           Search Columns: 2
    >                           Estim. CPU-Costs = 789,224,817 Estim. IO-Costs = 5,101
    >                          Access Predicates Filter Predicates
    Ok, we've no restriction to the data, so Oracle chooses the access methods it thinks are best for large volumes of data - Full table scans and HASH JOINS. The index skip scan is quite odd - maybe this is due to one of the join conditions.
    > Explain plan for QAS:

    SELECT STATEMENT ( Estimated Costs = 263,249 , Estimated #Rows = 13,842,540 )
    >
    >         7 HASH JOIN
    >           ( Estim. Costs = 263,249 , Estim. #Rows = 13,842,540 )
    >           Estim. CPU-Costs = 59,041,893,935 Estim. IO-Costs = 260,190
    >           Access Predicates
    >
    >             1 TABLE ACCESS FULL LFA1
    >               ( Estim. Costs = 63 , Estim. #Rows = 812 )
    >               Estim. CPU-Costs = 7,478,316 Estim. IO-Costs = 63
    >               Filter Predicates
    >             6 HASH JOIN
    >               ( Estim. Costs = 263,113 , Estim. #Rows = 13,842,540 )
    >               Estim. CPU-Costs = 57,640,387,953 Estim. IO-Costs = 260,127
    >               Access Predicates
    >
    >                 4 HASH JOIN
    >                   ( Estim. Costs = 2,127 , Estim. #Rows = 194,660 )
    >                   Estim. CPU-Costs = 513,706,489 Estim. IO-Costs = 2,100
    >                   Access Predicates
    >
    >                     2 TABLE ACCESS FULL EIKP
    >                       ( Estim. Costs = 351 , Estim. #Rows = 54,830 )
    >                       Estim. CPU-Costs = 49,504,995 Estim. IO-Costs = 348
    >                       Filter Predicates
    >                     3 TABLE ACCESS FULL EKKO
    >                       ( Estim. Costs = 1,534 , Estim. #Rows = 194,660 )
    >                       Estim. CPU-Costs = 401,526,622 Estim. IO-Costs = 1,513
    >                       Filter Predicates
    >
    >                 5 TABLE ACCESS FULL EKPO
    >                   ( Estim. Costs = 255,339 , Estim. #Rows = 3,631,800 )
    >                   Estim. CPU-Costs = 55,204,047,516 Estim. IO-Costs = 252,479
    >                   Filter Predicates
    Ok, we see significantly different table sizes here, but at least this second plan leaves out the superfluous Index Skip Scan.
    How to move on from here?
    1. Check whether you've installed all the current patches. Not all bugs that are in the system are hit all the time, so it may very well be that after new CBO stats were calculated you just begin to hit one of it.
    2. Make sure that all parameter recommendations are implemented on the systems. This is crucial for the CBO.
    3. Provide a description of the Indexes and the view definition.
    The easiest would be: perform an Oracle CBO trace and provide a download link to it.
    regards,
    Lars

  • Unable to view SQL Request in Log files

    Hi Folks,
    I am facing an issue which I am unable to find out the solution to view the physical query generated in log files in Presentation Services.
    Below is the SQL Request generated but I want to view the exact physical query i.e SQL Request which is hitting DB.
    So please guiude me to resolve this issue, I guess it is because of Initialization blocks created which is blocking to view the SQL request.
    -------------------- SQL Request:
    set variable LOGLEVEL = 7;SELECT "- Policy Effective-Start Date"."Start Quarter" saw_0, "- Insurance Policy Facts".Revenue saw_1, "- Insurance Policy Facts"."# Insurance Policies" saw_2, "Insurance Policy".Status saw_3, "Insurance Policy".Type saw_4 FROM "Insurance Policies" WHERE ("Insurance Policy".Type = 'Policy') AND ("- Policy Effective-Start Date"."Start Julian Day Number" BETWEEN VALUEOF(CURRENT_JULIAN_DAY)-365 AND VALUEOF("CURRENT_JULIAN_DAY")) ORDER BY saw_0, saw_3, saw_4
    /* QUERY_SRC_CD='rawSQL' */
    Regards
    Dj

    There is no Enterprise Edition of SSMS. There is SSMS Basic and SSMS Complete. Prior to 2012 sp1, only SSMS Basic were available with Express Edition - but as of 2012 sp1 Expredd also offers SSMS Complete. SSMS Complete is selected bu default when you install
    SSMS (unless you are prior to 2012 sp1 and are using Express, of course).
    However, even SSMS Basic *should* show Agent assuming you have permissions for that. This is hearsay, but from trusted sources. Here is what to do:
    Check what is installed for the machine from where you are running SSMS. You can do that using SQL Server Installation Center - see this blog post: http://sqlblog.com/blogs/tibor_karaszi/archive/2011/02/10/what-does-this-express-edition-look-like-anyhow.aspx
     (towards the end).
    On that machine try both this problematic account as well as an account which is sysadmin. Does the sysadmin account see Agent? If so, you know permissions aren't granted properly. If not, then you know the tool is the problme.
    Also try the problematic account from a machine where you know you see Agent normally. Again, this will help you assess whether the problem is the tool (SSMS) or permissions for the account.
    Tibor Karaszi, SQL Server MVP |
    web | blog

  • How to print sql request result to screen by page?

    Hello,
    I'm a beginer in java developpement. I'm looking for information for :
    I want to print to screen the result of a sql request. but I don't know how many lines will be selected. so I want to cut the result in many pages.
    1)how can I do this?
    2)may I do this in Java? if yes in wich package may I search? and is this take a lot of place in memory?
    3)or may I do this with SQL?
    Thank you for your help

    Hi,
    This is a small code snippet, i believe this is more than enough...
    String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=firstDB)))";
    String username= "test";
    String password = "test";
    String GET_EMPLOYEE_DETAILS = "select name, age from managers";
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    Connection con = DriverManager.getConnection(url, username, password1);
    PreparedStatement pstmt =con.prepareStatement(GET_EMPLOYEE_DETAILS );
    ResultSet rs = pstmt.executeQuery();
    while ( rs.next())
    System.out.println(rs.getString("name") + ":"+ rs.getInt("age") );
    rs.close();
    pstmt.close();
    con.close

  • Ad-Hoc SQL

    I'm adding ad-hoc SQL capabilities for Oracle to my application (the application is a database development tool). Essentially, the user has a text editor that they use to type what ever SQL they want. I need to give them a way to execute it. What they execute may consist of 1 individual SQL statement or it may contain many. For example, they may run this all at the same time:
    SELECT * FROM TABLEA;
    SELECT * FROM TABLEB;
    INSERT INTO SOMETABLE
    SELECT * FROM ANOTHERTABLE;
    DECLARE
    Var NUMBER;
    BEGIN
    Var := 1;
    END;
    and so on.
    I would need to execute this and produce 4 distinct set of results for the user. Can I pass all of this to Oracle? Will Oracle know what to do with this? Will Oracle give me results for the 4 individual statements? Do I need to parse each statement on my own and send them to Oracle one at a time?
    I'm trying to figure out how to go about developing this solution. I'm doing this in a PowerBuilder application if that makes any difference.
    Thanks,
    Brad

    Hi Brad,
    Like you I am a PB user and I guess new to Oracle, most of my past experience has been with MS SQL Server. But there is nothing like a kick up the bottom to get you thinking again and changing from SQL Server to Oracle does that job quite well.
    The code below is executed when the user hits the "GO" button, in my app I wanted the SQL stored in a file so that I could send this out to the users and they could EXEC it with this routine, anyway here goes:
    String     ls_file_name, ls_line, ls_sql
    Integer     li_handle, li_err = 0
    ls_file_name     = sle_enter_filename.text
    if (f_empty(ls_file_name)) then
         messageBox("STOP!", "MUST Enter a filename", stopSign!)
         return
    end if
    li_handle     = fileOpen(ls_file_name, lineMode!)
    if (li_handle < 0) then return
    ls_sql     = ''
    do while (li_err >= 0)
         li_err     = fileRead(li_handle, ls_line)
         if (li_err >= 0) then
              if (lower(ls_line) = 'go') then // go is like / in oracle
                   f_execSQL(ls_sql)
                   ls_sql     = ''
              else
                   ls_sql     += char(13) + char(10) + ls_line // need to put whitespace as fielRead removes CR/LF in affect.
              end if
         end if
    loop
    fileClose(li_handle)
    f_execSQL() is:
    EXECUTE IMMEDIATE :as_sql;
    f_dispSqlErrors('f_ExecSql - Executing: ' + as_sql)
    return(SQLCA.SQLCode)
    f_dispSqlErrors() - simply checks sqlcs.sqlCode and if it's not kosher (ie < 0) then reports and terminates.
    of_close()
    return
    Hope this helps.
    Bill

  • Ad hoc approval request in workflow

    Hi experts,
    Ad hoc approval request in workflow ,user should  forward work item multiple times for different users . Ad hoc approval multiple times to the same or different employees. Could you please provide me steps by steps how I need to create ad hoc .

    Hello Ganesh !
                    Hope you want to define ad hoc agent agent assignment.
                   If so, choose the activity step(the task's work item that you want to send)  in workflow  and from the menu take path :  Extras -> Ad_hoc functions -> Enable the Adhoc Agent Assignment.
                   In expression part , now you can find &Agent_0001.Agents& have automatically appeared.The one who want to start the workflow,can mention the SAP logon id of the agents to whom the work items needs to be sent.
    Regards,
    S.Suresh

  • Invalid month sql request for chart

    Hi,
    i try to refresh a report with a dynamical sql request as following :
    select NULL LINK, status_label LABEL, count(fcr.status_code) as VALUE
    from table
    where table.date > '05/06/2007'
    This query is generated dynamicaly from a date picker.
    My problem is that the chart witch should be refreshed by this query, isn't.
    The following error message come from the ajax query :
    chart Flash Chart error: ORA-20987: APEX - Flash Chart error:  - ORA-20001: Fetch error: ORA-01843: not a valid month
    Something disapoint me: when i execute the query in plSQL i have got my wished results.
    Does someone have any idea about this mistake?

    Hi better,
    Try to give
    where table.date >to_date( '05/06/2007','dd/mm/yyyy');Brgds,
    Mini
    Mark Answers Promptly

  • ST04-SQL Request

    Hi Friends,
    In my production system, I've executed the ST04 transaction, Detailed Analysis Menu....SQL Request....Sorted by Buffer gets... and I checked the SQL statement....and then clicked on display execution plan for SQL statement...
    There it shows the following information
    SELECT STATEMENT ( Estimated Costs = 17,039 , Estimated #Rows = 0 )
            1 TABLE ACCESS FULL LIPS
              ( Estim. Costs = 17,038 , Estim. #Rows = 1 )
              Estim. CPU-Costs = 885,646,245 Estim. IO-Costs = 16,963
              Filter Predicates
    What are the parameters that will indicate that there is an issue with the SQL statement
    Regards
    Aliila

    Hello Aliila,
    As indicated below, the statement is expensive as the explain plan goes for full table scan. As LIPS table is one of the line item table, it has to read all the blocks of this table to satisfy the user query. So if there is no WHERE clause in the corresponding ABAP code, then you have to discuss with your ABAP developer to input the selective fields in the WHERE clasue so that appropriate indexes will be choosen in the explain plan. From this i can easily conclude that this statment is expensive because of either of these reasons.
    1. Missing Where clause in the ABAP code ( I believe this is coming from Z* program/transaction) or
    2. User is not inputting any criteria for selecting this ( Here you to need to train the user).
    Back to your question: if you are doing sql cache analysis through ST04 normally you have to find out the statement based on the following criteria.
    1. Greater than 5% of  the total buffer gets ( This will cause memory load)
    and/or
    2. Greater than 2% of the physcial reads ( This cause I/O Load).
    you can find that total buffers gets and physical read from ST04 initial screen.
    Hope above information will help you.
    Yours Sincerely
    Dileep

  • Help asked for a sql request - thanks

    Hello,
    I'm not a sql Guru... Who can help for this sql request ?
    First I have this:
    SELECT ADDINFO_ID, INFO, LANGUAGE_FK, ENGLISH_NAME
    FROM V_ADDINFOS
    WHERE LANGUAGE_FK = 'EN' (which is very simple...-)
    But now complicated... I have to add this in the same request:
    select sum(val) as nbrInfo
    from(
    select count(*) val from eccgis where addinfo1_fk = ADDINFO_ID
    union all
    select count(*) val from eccgis where addinfo2_fk = ADDINFO_ID
    union all
    select count(*) val from eccgis where addinfo3_fk = ADDINFO_ID
    union all
    select count(*) val from thirdgis where addinfo1_fk = ADDINFO_ID
    union all
    select count(*) val from thirdgis where addinfo2_fk = ADDINFO_ID
    In other words, for each row of the first select, I need to know how much it is linked in the tables eccgis and thirdgis...
    Hope is is clear... -)
    Thank you very very much,
    Michel

    Hi, Michel,
    Almost anywhere that SQL allows an expression (such as a column name, literal or function call) it also allows a scalar sub-query, a SELECT statement based on any table (or tables) that returns one column and (at most) one row. Like other sub-queries, scalar sub-queries can be corellated to the main query.
    To get the grand total you want on each row of your output:
    SELECT ADDINFO_ID, INFO, LANGUAGE_FK, ENGLISH_NAME
    , (select count(*) from eccgis where addinfo1_fk = ADDINFO_ID)
    + (select count(*) from eccgis where addinfo2_fk = ADDINFO_ID)
    + (select count(*) from eccgis where addinfo3_fk = ADDINFO_ID)
    + (select count(*) from thirdgis where addinfo1_fk = ADDINFO_ID)
    + (select count(*) from thirdgis where addinfo2_fk = ADDINFO_ID)
    AS nrbInfo
    FROM V_ADDINFOS
    WHERE LANGUAGE_FK = 'EN';VERY IMPORTANT: Each sub-query must be in parentheses. You'll get a run-time error if any scalar sub-query returns more than one row. (Returning no rows is okay: the value will be NULL).
    By the way, this looks like a bad table design. If each row in eccgis or thirdgis can be associated with more than one foreign key, they should be kept in a separate table. That's the standard way to handle many-to-many relationships.

  • SQL requests when handling a refresh on a persistent-dirty instance

    I just noticed that Kodo issues two SQL requests when handling a refresh
    on a persistent-dirty instance, the first one getting the JDOLOCKX
    column value.
    For a persistent-clean instance, it makes sense to get the version
    number first and to check if it has been changed. If not, the attribute
    values are not read from the database.
    For a persistent-dirty instance, as the memory state has been changed,
    it has to be reloaded anyway and it seems to me that the first request
    is useless.
    Any confirmation ?
    Thanks.

    Yeah, the version check seems to be extraneous. We'll see what we can do
    about that. Thanks for pointing it out!

  • Regroup a lot of small sql request

    hello
    I'am developping a server in c
    This server connects to a database
    I use oo4o for the connection
    But I have I problem because I have a lot of small request like that
    select cdf_nom
    from cdf_codif, fitty_typeinteraction
    where
         fitty_fit_code_fk_pk like '183'
         and fitty_cdf_type_code_fk_pk = cdf_code_pk
         and cdf_numero_pk like 'IY'
    All works ok but the application is too slow because I have a function in c by request like that
         strcpy(sqls,"select cdf_nom");
         strcat(sqls," from splab_specialite_labo, cdf_codif");
         strcat(sqls," where");
         strcat(sqls," splab_sp_code_fk_pk like '");
         strcat(sqls,idLabo);
         strcat(sqls,"' ");
         strcat(sqls," and splab_cdf_lab_code_fk_pk = cdf_code_pk");
         strcat(sqls," and cdf_numero_pk like '15'");
         /* execute la requete */
         requete.Open(*databb,sqls);
         while (!requete.IsEOF())
              /* balise statutLabo */
              requete.GetFieldValue("cdf_nom", statutLabo,TAILLE_CDF_NOM);
              if (strlen(statutLabo) != 0)
                   bstrValue = AsciiToBSTR(statutLabo);
                   if (!bstrValue)
                        ERROR1("Theriaque : AsciiToBSTR function failed");
                        goto shutdown ;
                   cleanAllString(bstrValue);
                   elementNode = requestDoc->CreateNode(NODE_ELEMENT, V_StatutLabo, rootRequestNode, bstrValue);
                   if (!elementNode)
                        ERROR1("Theriaque : creation of element node failed");
                        goto shutdown ;
                   SAFERELEASE(elementNode);
                   if (bstrValue) SysFreeString(bstrValue);
                   bstrValue = NULL ;
              requete.MoveNext();
    I would like to know how to optimise it but I can't regroup all the small request in a big requestbecause it's to slow
    If it's possible a pl/sql bloc it's will be great

    Usually very large directories suffer from bad access times. If you have a single directory with nearly a million files, you will discover that the time for opening the file is much greater than the time for reading it.
    If you have a directory tree containing the files (say that you have a directory, with 100 subdirectories, each one containing 100 subdirectories, each one containing 100 files) you can open the files much faster.

  • Pb of union sql request

    hi,
    I have to execute this sql equest
    Code:
    SELECT ID, NOM, DEFINITION FROM MOT WHERE NOM like 'crédit %'
    UNION SELECT ID, NOM, DEFINITION FROM MOT WHERE NOM LIKE ' crédit' + '%'
    UNION SELECT ID, NOM, DEFINITION FROM MOT WHERE NOM LIKE '%' +" "+ 'crédit' +" "+ '%';
    but it is not possible because the fields NOM, DEFINITION are text fields and not varchar fields and it is not possible to executethis union clause .
    Could you help me to transform this request to another to execute it?
    It is very urgent, if you could help me it would be very kind from you!
    Best regards.
    Nathalie

    Hello,
    Sorry, I just re-read your post and to do the ordering there's a couple of ways I can think of to do it. I'm sure others can come up with something a little bit neater but this should help along the way:
    create table dt_test_order (col1 varchar2(100));
    insert into dt_test_order values('credit');
    insert into dt_test_order values('credit+something');
    insert into dt_test_order values('credit+something else');
    insert into dt_test_order values('something credit+something');
    insert into dt_test_order values('something credit+something else');
    insert into dt_test_order values('something else credit+something else');
    SELECT
         CASE
              WHEN col1 = 'credit' THEN
                   1
              WHEN col1 LIKE 'credit+%' THEN
                   2
              WHEN col1 LIKE '%credit+%' THEN
                   3          
         END col1_order,
         col1
    FROM
         dt_test_order;
    SELECT
         col1
    FROM
         dt_test_order
    ORDER BY
         CASE
              WHEN col1 = 'credit' THEN
                   1
              WHEN col1 LIKE 'credit+%' THEN
                   2
              WHEN col1 LIKE '%credit+%' THEN
                   3          
         END,
         LENGTH(col1);
    SELECT
         col1
    FROM
         dt_test_order
    ORDER BY
         CASE
              WHEN col1 = 'credit' THEN
                   1
              WHEN col1 LIKE 'credit+%' THEN
                   2
              WHEN col1 LIKE '%credit+%' THEN
                   3          
         END,
         col1;
    SELECT
         col1
    FROM
         dt_test_order
    ORDER BY
         CASE
              WHEN col1 = 'credit' THEN
                   1 + LENGTH(col1)
              WHEN col1 LIKE 'credit+%' THEN
                   2 + LENGTH(col1)
              WHEN col1 LIKE '%credit+%' THEN
                   3 + LENGTH(col1)          
         END;There's a few variations on the same theme.
    HTH
    David

  • Direct SQL Request & Navigation

    Hi,
    I have two reports created in answers using direct SQL. I would like to use navigation between both reports, they both have two columns year & month. Is it possible to use 'is prompted' and value interaction with direct sql reports?

    sliderrules wrote:
    ok thanks. I have created a dashboard prompt with two presentation variables pYear & pMonth.
    Does this need to be specified somewhere in my direct database request sql? Year & Month exists in the SQL but how do I pass the presentation variables?
    ThanksYou can call them in the SQL, here is a sample syntax:
    select
    'VALUEOF(NQ_SESSION.CAT)' session_variable,
    'VALUEOF(rv_test_date_to_char)' repository_variable,
    '@{pv_channel_desc}{Internet}' presentation_variable,
    channel_desc
    from channels
    where channel_desc='@{pv_channel_desc}{Internet}'
    Refer to http://108obiee.blogspot.com/2009/11/variables-in-direct-database-requests.html for more details.

  • Trace PL/SQL request

    Hi,
    I have a PL/SQL concurrent request which is called by the concurrent request each hour..
    I need something which is similar to the trace when we are using DBMS_OUTPUT.PUT_LINE.
    Is there a simple way that allow me to trace the commands executed by this pl/sql ??
    Thanks a lot.

    Hi,
    You can enable trace on any concurrent request by referring to (Note: 296559.1 - FAQ: Common Tracing Techniques within the Oracle Applications 11i/R12) and (Note: 453527.1 - How To Trace a Concurrent Request And Generate TKPROF File).
    Regards,
    Hussein

  • Table are not prefixed with Schema in  SQL request - Unable to get Data

    I began this new thread because I closed the [previous one|Unable to get data (DSN connection); a little bit early, I believed it was OK but no the problem still here.
    First my architecture :
    Oracle 9g
    +500 Reports made under CR developper 8.5 or 9.0
    Report opened in VB .net application, framework 2.0 using CR runtime 8.5 and 9.0
    We want to upgrade CR version to 2008, so modification of reports will be done with CR 2008 Developper, and we want to
    use only CR 2008 runtime.
    The problem :
    Everything works fine in CR Developer, but the same report with the same parameters failed when called inside .net.
    The error is "Unable to get data", the database connection is OK but the queries mades from inside the report are wrong :
    The tables/views in the from statement are not prefixed with the Schema, so Oracle don't find them.
    Example (SQL monitoring done with TOAD)
    Execution of postes.rpt report directly in CR :
    Timestamp: 10:30:03.881
    Successful logon attempt (session tag: 0x6464CB8)
    username: 'APPLI_HUET'; database: 'DEV'
    SELECT ...
    FROM  "COMMUN"."ETAB" "ETAB" INNER JOIN "GESTION_DES_TEMPS"."POSTES" "POSTES"
    ON "ETAB"."N_ETAB"="POSTES"."N_ETAB"
    WHERE  "POSTES"."N_ETAB"=2 ORDER BY "POSTES"."N_POSTE"
    Timestamp: 10:50:29.178
    Logoff (session tag: 0x6464CB8).
    Same report, same authentication but throught .net program :
    Timestamp: 11:01:24.569
    Successful logon attempt (session tag: 0xA93FC38)
    username: 'APPLI_HUET'; database: 'DEV'
    SELECT ...
    FROM   "ETAB" "ETAB" INNER JOIN "POSTES" "POSTES"
    ON "ETAB"."N_ETAB"="POSTES"."N_ETAB" WHERE  "POSTES"."N_ETAB"=2 ORDER
    BY "POSTES"."N_POSTE"
    Runtime error occurred: 942 (ORA-00942: Table ou vue inexistante)
    The .net code :
    Dim _report As New ReportDocument()
    _report.Load("report.rpt", OpenReportMethod.OpenReportByDefault)
    Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
    myConnectionInfo.ServerName = "DSN_file"
    myConnectionInfo.UserID = p_Userid
    myConnectionInfo.Password = p_Password
    ' to see code in this method se my original post
    SetDBLogonForReport(myConnectionInfo, _report)
    SetDBLogonForSubreports(myConnectionInfo, _report)
    Dim frmViewer As New CrystalReportViewer
    frmViewer.CrystalReportViewer1.ReportSource = _report
    frmViewer.Show()
    Any ideas ?

    Thanks for the and sorry but I don't understand.
    I've made a research of Location on this forum the more intersting thread I've found is rpt-files do not function anymore after deploying to a different database, but I still don't understand.
    I take a look at all code sample and I can't found anything.
    You say that .Location need to be set, indeed Location property of CrystalDecisions.CrystalReports.Engine.Table object only contains table name.
    I tried to overrides this value by the fully qualified table name (ie Schema.Table, for example GESTION_DES_TEMPS.POSTES), and it work  BUT it wouldn't be the solution, my code is designed to be generic, I can't have a database to know wich schema add before differents table name.
    Why when we execute the report directly in CR 2008 developper we don't have to redefine the table location ?
    Another test :
    I've made a new report directly in CR 2008 with a DSN, launch it in .net with the same DSN (server) : OK
    Then I launch it in .net with another DSN, it work also.
    Why report done with Crystal 8.5 or 9.0 have this problem ?
    I'me gonna be mad....
    Edited by: Yoann DAVID on Jan 8, 2010 3:32 PM

Maybe you are looking for

  • Apple TV update causing error message.

    I recently did an update on my Apple TV and after performing it I'm now getting an error message that my HDMI cable needs to be connected to a HDCP port (which I presume my TV doesn't have). I can no longer watch anything on iTunes or netflix. How do

  • Using indd CS4 for email blasts?

    Happy Holidays everyone.  Instead of using 'contant contact' or other such email blast software with templates, what I typically do is design an original email blast in InDesign, and then send it as a pdf to a company who switches it (somehow) into h

  • Applets and server scripts

    Hi, I'm trying to run a java applet with a web application I'm developing, but I'm having some trouble running it. I have a dll which generates html pages dynamically, and in one of the pages i want to call an applet, but I keep getting an error that

  • I as a webdeveloper can edit site - but not the invited publisher?

    Hei, I have a strange problem. I invited 2 cclients, to try out ICE and with the first client as publisher it was immediately successful. I invited him to a second site, but this time the answer was, no editable region. But I can edit it on my accoun

  • In CS5, saving a tiff, the jpg compression is greyed out, why? No layers. It's RGB, 8 bit file.

    in CS5, saving a tiff, the jpg compression is greyed out, why? No layers. It's RGB, 8 bit file.