SQL - using COUNT query

I have a database like this structure:

Table - lodges

LodgeID (PK)

Lodge

etc.

Table - scores

ScoreID (PK)

Score

CategoryID

LodgeID (FK)

I try to return the results in the form:

LodgeID, Lodge, category, number of Scores in this category, the average Score in this category

Thus, for example, if I had:

Lodges

LodgeID Lodge

1, lodge a

2, two lodge

scores

ScoreID, Score, CategoryID, LodgeID

1, 3, 101, 1

2, 5, 101, 1

3, 7, 101, 1

4, 10, 102, 2

2, 5, 20, 102

2, 6, 30, 102

7, 40, 102, 2

I will return:

1, box 1, 3, 5

2, Lodge 2, 4, 25

I tried things like:

SELECT COUNT (ScoreID) as scoreCount, AVG (Score) as Averagescore, Lodge OF scores_temp INNER JOIN lodges_temp ON scores_temp. LodgeID = lodges_temp. LodgeID

Without success. Pointers would be much appreciated.

Ignore that - just need to add a GROUP BY clause.

Tags: Dreamweaver

Similar Questions

  • By using the query table data pump

    I am trying to perform an export of data pump on a table by using a query in a parfile and I'm getting a strange behavior. The database version is 10.2.0.4.3 and the AIX 5.3 operating system. The query looks like this.

    QUERY = "POSDECLARATIONQUEUE:where SESSIONID in (select"B.SESSIONID"from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C, where"B.SESSIONID"="C.ID"and"C.ACCOUNTID"= 'A.ID' and 'Inform' = '10252')" "

    This works, but gets 0 rows. If I run the query against the instance in a session of SQLPlus as below then I get 0 rows returned.

    Select * from POSDECLARATIONQUEUE where SESSIONID in (select "B.SESSIONID" from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C, where "B.SESSIONID" = "C.ID" AND "C.ACCOUNTID" = 'A.ID' and 'Inform' = '10252');

    If I take the columns all about apostrophes in the query on the Forum with SQLPlus, I get over 2000 rows returned.

    SQL > select count (*) in the POSDECLARATIONQUEUE where SESSIONID in (select B.SESSIONID from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C where B.SESSIONID = C.ID and C.ACCOUNTID = A.ID and inform = 10252);

    COUNT (*)
    ----------
    2098

    If I remove the apostrophes in the query parfile then I get the following error in data pump export.

    DEU-00014: invalid value for the parameter, "schemas".

    The PATTERNS option is not specified in parfile him and the TABLES option specifies that the table POSDECLARATIONQUEUE.

    Can someone help with this, I can't seem to be able to get the syntax just to work within data pump.

    Kind regards.
    Graeme.

    Published by: user12219844 on April 14, 2010 03:34

    It seems that your query can be a little wrong:

    That's what you have:

    QUERY = "POSDECLARATIONQUEUE:where SESSIONID in (select"B.SESSIONID"from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C, where"B.SESSIONID"="C.ID"and"C.ACCOUNTID"= 'A.ID' and 'Inform' = '10252')" "

    That's what I would have thought it should look like:

    QUERY = POSDECLARATIONQUEUE: "where SESSIONID in (select B.SESSIONID from POSACCOUNT A, POSDECLARATIONQUEUE B, POSDECLARATIONSESSION C where B.SESSIONID = C.ID and C.ACCOUNTID = A.ID and inform = 10252).

    You want to double "around the full query and you have not need single ' around all =." The single ' treat these values as strings and he said

    "B.SESSIONID" = "C.ID".
    the B.SESSIONID string is the string C.ID

    In your query you used in sql has been

    B.SESSIONID = C.ID

    that said, it is that the B.SESSIONID stored value equal to the value stored at C.ID

    Which is what you want.

    Dean

  • How can I use join query ANSI in Forms 10 g

    Dear all,

    How I use the query as mentioned below in Forms 10 g

    SELECT <fields>  
      FROM TableA a INNER JOIN TableB b ON a.key = b.key
    

    Kind regards

    Zafar Iqbal

    You cannot use the SQL commands that did not exist in the 8.0 database.

    Oracle Forms (and reports) has a full PL/SQL engine and (only) the SQL parser.

    However, form (and reports) PL/SQL engine / SQL parser is at a level that was in the Oracle 8.0 database.

    Kind regards

    Zlatko

  • Detroit SQL of the query in writing: analysis of the GAPS in order of Row_Wid in a Table

    I am writing a query that scans a product Dimension Row_Wid, notes the gaps in the sequence and generates the missing Row_Wids. It loads these 'missing Feds"in a sequence of wid created table to reuse by Informatica transformation of research without bond during the subsequent data loads. Yes, I expect many people asking why I do this. The simple reason is that Informatica has a limit of 2 147 sequence generator 483 647'. I arrived at this upper limit, but my table contains only 2.2 million lines of actual data. I'm trying to reuse these Row_Wids now 'not used '.

    I have a job with success the query to find the first ditch and fill some of that gap. Now my next problem is to figure out how to get my request to move away from the next. I can't use the PL/SQL in the query. My client does not allow its use.

    I'll paste the code I have now. I need to evolve to the next gap. Suggestions? Help? Ideas?



    The Version of database: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

    The table I'm inserting: CREATE GLOBAL TEMPORARY TABLE "OLAP". "" ROWWIDVAL "("ROWWID"NUMBER (10.0), NUMBER (10,0)"EXTRAVAL") ON COMMIT PRESERVE ROWS;
    A note: the Temp Table to test this point, I've created is "RowWidVal" and it has two columns.

    -Updated Code collaboration-
    Insert Into RowWidVal(
    SELECT
         CASE
              WHEN NumGen <= GapSize+2 THEN (P2.MinGapStart-1)+NG.NumGen
         END RowWid, 0
    FROM
         (SELECT MIN(T4.GapStart) MinGapStart, MIN(T4.GapStop) MinGapStop, (MIN(T4.GapStop) - MIN(T4.GapStart)) GapSize
              FROM
                   (SELECT T2.row_wid + 1 GapStart,
                        (SELECT MIN(T1.row_wid) - 1 FROM w_product_d_test T1 WHERE T1.row_wid > T2.row_wid) GapStop
                        FROM w_product_d_test T2
                        LEFT OUTER JOIN w_product_d_test T3 ON T2.row_wid = T3.row_wid - 1
                   WHERE T3.row_wid IS NULL
                   ) T4
         WHERE T4.GapStop IS NOT NULL
      ) P2,
         (SELECT LEVEL NumGen
          FROM dual
          CONNECT BY LEVEL <= (SELECT ((Min(GapStop) - Min(T4.GapStart)) +1) GapSize
                                   FROM
                                       (SELECT T2.row_wid + 1 GapStart,
                                            (SELECT MIN(T1.row_wid) - 1 FROM w_product_d_test T1 WHERE T1.row_wid > T2.row_wid) GapStop
                                            FROM w_product_d_test T2
                                            LEFT OUTER JOIN w_product_d_test T3 ON T2.row_wid = T3.row_wid - 1
                                            WHERE T3.row_wid IS NULL
                                       ) T4
                                        WHERE T4.GapStop IS NOT NULL)
         ) NG
    WHERE P2.MinGapStart < P2.MinGapStart+(GapSize+2));
    Published by: user1002601 on 16 January 2013 08:33

    Published by: user1002601 on 16 January 2013 08:39

    How about this?

    Sample data:

    SQL> create table w_product_d_test (row_wid number);
    
    Table created
    
    SQL>
    SQL> insert into w_product_d_test (row_wid)
      2  select column_value
      3  from table(sys.odcinumberlist(1,2,3,4,5,11,12,13,31,32,33,34));
    
    12 rows inserted
    
    SQL> select * from w_product_d_test;
    
       ROW_WID
    ----------
             1
             2
             3
             4
             5
            11
            12
            13
            31
            32
            33
            34
    
    12 rows selected
     
    

    Generate sequence available numbers:

    SQL> with gaps as (
      2    select rw, gapsize
      3    from (
      4      select row_wid as rw
      5           , row_wid - lag(row_wid,1,0) over(order by row_wid) - 1 as gapsize
      6      from w_product_d_test
      7    )
      8    where gapsize > 0
      9  )
     10  select g.rw - t.column_value as available_rw
     11  from gaps g
     12     , table(
     13         cast(
     14           multiset( select level from dual connect by level <= g.gapsize )
     15           as sys.odcinumberlist
     16         )
     17       ) t
     18  ;
    
    AVAILABLE_RW
    ------------
              10
               9
               8
               7
               6
              30
              29
              28
              27
              26
              25
              24
              23
              22
              21
              20
              19
              18
              17
              16
              15
              14
    
    22 rows selected
     
    
  • use of query rewriting

    is there a way to connect the materialized views how often are accessible in general or by the query rewriting enabled option?

    I would like to know what materialized views are useless, because they are never used by query rewrite.

    You can follow with select audit, good example here

    http://www.Oracle-base.com/articles/10G/auditing-10gR2.php

    If you want to in retrospect you may need something cludge together by hitting the v$ sql and plans to even see who has several SQL identifiers have a plan that rewrite. not good enough.

  • Merge no SQL using analytical functions

    Hi, the Sql tuning specialists:
    I have a question about the merger of view inline.

    I have a simple vision with the analytical functions inside. When questioning him, he does not index.


    VIEW to CREATE or REPLACE ttt
    AS
    SELECT EmpNo, deptno,
    ROW_NUMBER() over (PARTITION BY deptno ORDER BY deptno desc NULLS last) part_seq
    EMP AAA

    -That will do full table for emp scan
    Select * from TT
    WHERE empno = 7369


    -If I do not view use, I use the query directly, the index is used
    SELECT EmpNo, deptno,
    ROW_NUMBER() over (PARTITION BY deptno ORDER BY deptno desc NULLS last) part_seq
    EMP aaa
    WHERE empno = 7369


    question is: How can I force the first query to use indexes?

    Thank you

    MScallion wrote:
    What happens if you use the push_pred flag:

    Nothing will happen. And it would be a bug if he would.

    select * from ttt
    WHERE empno=7369
    

    and

    SELECT empno,deptno,
    row_number() OVER (PARTITION BY deptno ORDER BY deptno desc NULLS last) part_seq
    FROM emp aaa
    WHERE empno=7369
    

    are two logically different queries. Analytical functions are applied after + * resultset is common. So first select query all rows in the emp table then assign ROW_NUMBER() to recovered lines and only then select a line with empno = 7369 her. Second query will select the table emp with empno = 7369 line and only then apply ROW_NUMBER() - so since emp.empno is unique ROW_NUMBER returned by second query will always be equal to 1:

    SQL> select * from ttt
      2  WHERE empno=7369
      3  /
    
         EMPNO     DEPTNO   PART_SEQ
    ---------- ---------- ----------
          7369         20          4
    
    SQL> SELECT empno,deptno,
      2  row_number() OVER (PARTITION BY deptno ORDER BY deptno desc NULLS last) part_seq
      3  FROM emp aaa
      4  WHERE empno=7369
      5  /
    
         EMPNO     DEPTNO   PART_SEQ
    ---------- ---------- ----------
          7369         20          1
    
    SQL> 
    

    SY.

  • PL/SQL using bind variable to delete records

    Hello

    I'm currently implementing PL/SQL using bind variables to remove records from the "item_progress" table in the simple join query where I'm passing itemName, itemLoc and orderLoc in the delete query in pl/sql block.

    Please suggest, it should be easy for oracle experts...

    (a) I need first records in the item_progress table by using the join query and then update of status in the renew_item table.
    (b) it works fine if I use the simple removal with a condition that is ("DELETE from item_progress where itemname =: 1' using itemname1").

    (c) but it gives an error when I run it using delete with join:
    ---------------------------------------
    * Invalid relational operator ORA-00920:
    ORA-06512: at "SE", line 14 (it's the deletion with the join... "DELETE FROM item_progress WHERE item_id IN (SELECT ip.item_id'...)" ....'
    ORA-06512: at line 10
    Process exited.*
    ---------------------------------------

    create or replace PROCEDURE PUT (itemName IN VARCHAR2,
    itemLoc IN VARCHAR2,
    orderLoc IN VARCHAR2) is
    itemName1 varchar2 (30);
    itemLoc1 varchar2 (30);
    orderLoc1 varchar2 (30);
    BEGIN
    orderLoc1: = ' C: test/local /';
    itemLoc1: = ' / / L123/R;
    itemName1: = 'AAA ';

    immediate execution

    "DELETE FROM item_progress WHERE item_id IN (SELECT ip.item_id FROM ip, item_order io item_progress WHERE io.orderlocation: = 1 AND ip.order_id io.order_id UNION SELECT item_id FROM item_progress WHERE ITEMLOCATION =: = 2) AND itemname: = 3' using orderloc1, itemloc1, itemname1;"

    -"DELETE from item_progress where itemname =: 1' using itemname1; -IT WORKS FINE
    -Once the above query is updated to success, the status in another table
    -Renew_item update the Status value = "RENEWED" where ITEMNAME =: 1, ITEMLOCATION =: 2 using itemname1, itemloc1;

    commit;
    END OPERATIONS;

    user10828299 wrote:
    Please suggest, it should be easy for oracle experts...

    You have made a typo. bind variables are preceded by two points, while you put a colon in front of the equality operator that he listens to it in the PL/SQL assignment operator. Change:

    WHERE io.orderlocation : = 1

    TO

    IO.orderlocation WHERE =:1

    Change:

    WHERE ITEMLOCATION : = 2

    TO:

    WHERE ITEMLOCATION =:2

    Change

    AND itemname : = 3

    TO:

    AND itemname =:3

    SY.

  • Developer SQL vs TOAD - query performance issue

    Someone pointed out the same queries are run slower in SQL Developer and TOAD. I'm curious on this issue, since I understand Java is 'slow', but I can't find another thread on this point. I do not use TOAD, so I can't compare...

    Can it be linked to the amount of data returned by the query? What could be the other reasons for the SQL Dev works more slowly with a similar query?

    Thank you
    Attila

    It occurs to me also that TOAD always uses the equivalent of the 'thick' JDBC driver Developer SQL can use 'thin' driver or the 'thick' driver, but the connections are usually configured with the pilot "thin", since you need an Oracle client to use the 'thick' driver

    The difference is that the 'thin' drivers are written entirely in Java, but 'thick' drivers are written with only a small Java that calls the native executable (that's why you need an Oracle client) to do most of the work. In theory, a thick driver is faster because the code of the object should not be interpreted by the JAVA virtual machine. However, I heard that the performance difference is not that big. The only way to know for sure is to set up a connection with SQL Developer to use thick driver and see if it is faster (I would use a stopwatch).

    Correct me if I'm wrong, but I think that if you use 'TNS' as your type of connection, Developer SQL use thick driver, while someone is using the default value, the type of ' basic' connection the thin driver. Otherwise, you need to use the connection type 'Advanced' and type in the JDBC URL custom for the thick driver.

  • SQL +-PROBLEM OF QUERY IN MULTI TABLE

    HAI ALL,

    ANY SUGGESTION PLEASE?

    SUP: SQL +-PROBLEM OF QUERY IN MULTI TABLE


    SQL + QUERY DATA:
    -----------
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,

    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,

    PATIENTS_MASTER1 DLC_POLYMORPHS_NORMAL_VALUE, HAEMATOLOGY1,

    DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM AND PATIENT_NUM = DLC_PATIENT_NUM AND PATIENT_NUM

    = & PATIENT_NUM;
    -----------
    RESULT:

    & PATIENT_NUM = 1
    no selected line
    ---------
    & PATIENT_NUM = 2
    no selected line
    ------------
    & PATIENT_NUM = 3
    PATIENT_NUM 3

    PATIENT_NAME KKKK

    HMTLY_TEST_NAME HEMATOLOGY

    HMTLY_RBC_VALUE 4
    4.6 - 6.0 HMTLY_RBC_NORMAL

    DLC_TEST_NAME LEUKOCYTE COUNT PREMIUM

    DLC_POLYMORPHS_VALUE 60

    DLC_POLYMORPHS_NORMAL_VALUE 40-65

    -------------
    -------------

    REAL WILL BE:

    & PATIENT_NUM = 1

    PATIENT_NUM 1

    PATIENT_NAME BBBB

    HMTLY_TEST_NAME HEMATOLOGY

    HMTLY_RBC_VALUE 5
    4.6 - 6.0 HMTLY_RBC_NORMAL

    -----------

    & PATIENT_NUM = 2

    PATIENT_NUM 2

    PATIENT_NAME GEORGE

    DLC_TEST_NAME LEUKOCYTE COUNT PREMIUM

    DLC_POLYMORPHS_VALUE 42

    DLC_POLYMORPHS_NORMAL_VALUE 40-65
    ---------------
    & PATIENT_NUM = 3
    PATIENT_NUM 3

    PATIENT_NAME KKKK

    HMTLY_TEST_NAME HEMATOLOGY

    HMTLY_RBC_VALUE 4
    4.6 - 6.0 HMTLY_RBC_NORMAL

    DLC_TEST_NAME LEUKOCYTE COUNT PREMIUM

    DLC_POLYMORPHS_VALUE 60

    DLC_POLYMORPHS_NORMAL_VALUE 40-65
    ----------------------------

    4 TABLES OF LABORATORY CLINIC FOR DATA ENTRY AND GET REPORT ONLY FOR THE TESTS CARRIED OUT FOR PARTICULAR

    PATIENT.

    TABLE1:PATIENTS_MASTER1
    COLUMNS: PATIENT_NUM, PATIENT_NAME,

    VALUES:
    PATIENT_NUM
    1
    2
    3
    4
    PATIENT_NAME
    BENAMER
    GIROT
    KKKK
    PPPP
    ---------------
    TABLE2:TESTS_MASTER1
    COLUMNS: TEST_NUM, TEST_NAME

    VALUES:
    TEST_NUM
    1
    2
    TEST_NAME
    HEMATOLOGY
    DIFFERENTIAL LEUKOCYTE COUNT
    -------------

    TABLE3:HAEMATOLOGY1
    COLUMNS:
    HMTLY_NUM, HMTLY_PATIENT_NUM, HMTLY_TEST_NAME, HMTLY_RBC_VALUE, HMTLY_RBC_NORMAL_VALUE

    VALUES:
    HMTLY_NUM
    1
    2
    HMTLY_PATIENT_NUM
    1
    3
    MTLY_TEST_NAME
    HEMATOLOGY
    HEMATOLOGY
    HMTLY_RBC_VALUE
    5
    4
    HMTLY_RBC_NORMAL_VALUE
    4.6 - 6.0
    4.6 - 6.0
    ------------

    TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
    COLUMNS: DLC_NUM, DLC_PATIENT_NUM, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE, DLC_POLYMORPHS_

    NORMAL_VALUE,

    VALUES:
    DLC_NUM
    1
    2
    DLC_PATIENT_NUM
    2
    3
    DLC_TEST_NAME
    DIFFERENTIAL LEUKOCYTE COUNT
    DIFFERENTIAL LEUKOCYTE COUNT
    DLC_POLYMORPHS_VALUE
    42
    60
    DLC_POLYMORPHS_NORMAL_VALUE
    40-65
    40-65
    -----------------


    Thank you
    RCS
    E-mail:[email protected]
    --------

    I think you want an OUTER JOIN

    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
     HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
     DLC_POLYMORPHS_NORMAL_VALUE
    FROM PATIENTS_MASTER1, HAEMATOLOGY1,  DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM (+)
    AND PATIENT_NUM = DLC_PATIENT_NUM (+)
    AND PATIENT_NUM = &PATIENT_NUM;
    

    Published by: shoblock on November 5, 2008 12:17
    the outer join brands became stupid emoticons or something. try hard

  • How to contact with SQL using LabVIEW 7.1... ?

    Hello...

    I want to create a system that deals with the database and stores the database to the server through SQL... Can someone guide me please how to contact SQL using LabVIEW 7.1... ?

    Thanks for any help on your part...

    You can either use the LabVIEW Database Connectivity Toolkit or LabSQL to communicate with the SQL data bases. Take a look at those and after if you have other questions.

  • using reg query

    Hello

    I'm trying to use Reg Query to review the contents of a registry key.  More precisely

    • HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify

    I just want to know what are the subkeys.  I expect to be

    • IconStreams and
      PastIconsStream

    Since they are both of type reg_binary, when I do this query I have also all binary data as well, make very large output.

    Is there a way to simply retrieve/request which is in the field/column name and not the column/field data ?  I tried the /k options and /v who gave me errors, which I interpreted in the sense I was their use either wrong or they are not used in this instance.

    There is not a lot of examples out there and most of repeat them what you find when you use /?.

    Thank you.

    Hello

    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums.

    http://social.msdn.Microsoft.com/forums/en-us/windowsgeneraldevelopmentissues

  • Inserting data by using the query

    Hello

    In a book, I read the Sub statement:

    Inserting data by using the query (DML)

    If the user wants to transfer data from a table to another table in the insert statement are used independently of data that can be processed or not processed form.

    Can someone clarify what is the significance of this (processed or unprocessed form).


    Thank you.

    Why don't you ask the author of the book.

    How can we know what the author means when you take a quote out of context and don't provide any reference so that we can see exactly what is shown to you.

    I can only imagine that they are referring to data that are queried directly, "like what", another table, or who was interrogated and manipulated before be inserted.

  • Call Shell Script from within PL/SQL - using DBMS_PIPE

    Hi all

    I'm trying to run a shell script inside my PL/SQL using DBMS_PIPE block (not sure if this is the right way or not)

    Pl Sql script

    ==========

    Set serveroutput size 100000

    declare

    cursor c1 is select * from mag_images

    where nom_image like '% comp2.

    v_path varchar2 (100): = ' / home/maguzzi/DOCUMENTS_DIR / ";

    v_result number: = 0;

    v_in_filename varchar2 (100): = v_path | ' test_file.jpg';

    v_out_filename varchar2 (100): = v_path | ' test_file_out.jpg';

    v_script varchar2 (100): = "tst_convert.sh";

    v_command varchar2 (200): = 'sh'. v_path | v_script | » '|| v_in_filename | » '|| v_out_filename;

    Start

    A1 to c1 loop

    dbms_output.put_line ('v_command: ' | v_command);

    write_to_file ('test_file.jpg', 'DOCUMENTS_DIR', a1. Content);

    dbms_output.put_line (' file write result: ' | v_result);

    v_result: = exec_host_command (v_command);

    dbms_output.put_line (' resize result :'|| file v_result);

    end loop;

    end;

    Result DBMS_OUTPUT

    ====================

    v_command: /home/maguzzi/DOCUMENTS_DIR/tst_convert.sh test_file.jpg test_file_out.jpg

    Result of the entry of the file: 0

    Result of resizing the file: 0

    PL/SQL procedure successfully completed.

    Function exec_host_command

    =======================

    FUNCTION to CREATE or REPLACE exec_host_command (lc_cmd IN VARCHAR2)

    RETURN INTEGER IS

    ln_status NUMBER;

    lc_errormsg VARCHAR2 (80);

    lc_pipe_name VARCHAR2 (30);

    BEGIN

    lc_pipe_name: = 'Maguzzi_PIPE ';

    DBMS_PIPE. PACK_MESSAGE (lc_cmd);

    ln_status: = dbms_pipe.send_message (lc_pipe_name);

    RETURN ln_status;

    END;

    /

    The Image of the BLOB is written to the correct location on the server "test_file.jpg", and although the exec_host_command function returns a value of 0, the shell script (tst_convert.sh) is not executed (i.e. no output file is created - outfile.txt and the image is not copied/converted to a new file name "" test_file_out.jpg" )

    Shell script

    ========

    tst_convert.sh

    echo 'Here' > outfile.txt

    Echo $1 > > outfile.txt

    Echo $2 > > outfile.txt

    resizing to convert $1 - $200 2

    Could this be problems with permissions on files?

    test_file1.jpg has permission - rw-rw-r-

    test_convert.sh a permission rwxrwxrwx

    When I run the script manually and pass in 2 parameters ($1 = infilename and $2 = outfilename), it works...

    I'd appreciate if someone can point out my mistake or suggest another method that works.

    Thanks in advance

    How long does it take to create the converted file? Remember that the external Scheduler is running asynchronously, so it is possible that the converted file does not exist yet when the PL/SQL block subsequently tries to open it.

    Try to add some delay seconds to the routine to ensure that the external task is completed:

        begin
          dbms_scheduler.create_job(
              job_name => 'MAG_IMAGE_CONVERT2'
            , job_type => 'EXECUTABLE'
            , job_action => '/home/oracle/DOCUMENTS_DIR/tst_convert2.sh' );--  '/home/oracle/DOCUMENTS_DIR/tst_convert.sh');
          dbms_scheduler.enable('MAG_IMAGE_CONVERT2');
          dbms_lock.sleep(3);
        end;
    

    This probably isn't really a viable solution in the long term if it turns out that this is really the problem.

  • the search for empty cells by using the query designer

    Hello

    I'm trying to exclude empty cells in a field (by using the Query Builder), and I did:

    xDocumentSource < match > "CDL".

    < AND >

    < NOT > (xRelatedMsgid < match > "" "")

    but it does not work. I tried "NULL", but it does not work either. Could someone tell me how to do it (or where I can find examples of queries).

    Kind regards

    Iwona

    https://blogs.Oracle.com/Kyle/entry/searching_for_null_values_ucm

  • Where can I download use-counter-300 - update.zip?

    Notes for version found at https://my.VMware.com/group/VMware/get-download?downloadGroup=UMSV3 , we should be able to update the counter use 2.3.2 3.0 using a file called use-counter-300 - update.zip, but there is no URL provided, only the complete OVA file download. The file will appear on the site any time soon?

    I just checked the update zip appears now.  Please confirm that you are able to download.

    Please see the release notes especially the part about removing the password by e-mail before moving because of the new encryption mechanism.

Maybe you are looking for