Unable to display in the select query status

Dear all,

I have the case. I want to select data in difficult condition. I have three table follow:
CREATE TABLE "TABLE1" ("vID" CHAR(2)
,"vDesc" varchar2(500)
,CONSTRAINT "PK_TEST_RTK1" PRIMARY KEY ("varID"));

CREATE TABLE "TABLE2" ("varID" CHAR(2),"vID" CHAR(2)
,"varContent" varchar2(500)
,CONSTRAINT "PK_TEST_RTK2" PRIMARY KEY ("varID"));

CREATE TABLE "TABLE3" ("variableID" CHAR(2)
,"variableDesc" varchar2(500)
,CONSTRAINT "PK_TEST_RTK3" PRIMARY KEY ("varID"));

select * from TABLE1;
vID | vDesc
A1 | JAKARTA
A2 | BANDUNG

select * from TABLE2;
varID | vID | vContent
B1 | A1 | 121,222
B2 | A2 | 444,334

select * from TABLE3;
variableID | variableDesc
121 | goods1
222 | goods2
334 | goods3
444 | goods4
Then, I was query as below:
select a.vID,a.vDesc,c.variableDesc,''''||replace(b.vContent,',',''',''')||'''' xxx
from TABLE1 a 
inner join TABLE2 b on a.vID=b.vID
left join TABLE3 c on c.variableID in (''''||replace(b.vContent,',',''',''')||'''')
the result is:
vID | a.vDesc | c.variableDesc | xxx
A1 | JAKARTA | | 121,222
A2 | BANDUNG | | 444,334
Why the c.variableDesc is null?
What is the query assumes that the result only 1 as parameter below?
c.variableID in (''''||replace(b.vContent,',',''',''')||'''') --> c.variableID in ( {'121','222'} )
c.variableID in (''''||replace(b.vContent,',',''',''')||'''') --> not c.variableID in ( {'121'},{'222'} )
Please please need your help. Thnks a lot.

Published by: BluShadow on August 23, 2011 13:47
applied {noformat}
{noformat} tags.  Please read {message:id=9360002} to learn to format you code/data yourself.


sorry correct

CREATE TABLE "TABLE1" ("vID" CHAR(2)
,"vDesc" varchar2(500)
,CONSTRAINT "PK_TEST_RTK1" PRIMARY KEY ("vID"));

CREATE TABLE "TABLE2" ("varID" CHAR(2),"vID" CHAR(2)
,"varContent" varchar2(500)
,CONSTRAINT "PK_TEST_RTK2" PRIMARY KEY ("varID"));

CREATE TABLE "TABLE3" ("variableID" CHAR(2)
,"variableDesc" varchar2(500)
,CONSTRAINT "PK_TEST_RTK3" PRIMARY KEY ("variableID"));

Edited by: Rahardi Trisna on Aug 23, 2011 7:15 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

Hello

You need something like this:

select  a.vID
,     a.vDesc
,     c.variableDesc
,     '''' || replace (b.vContent,',',''',''') || ''''     xxx
from          TABLE1  a
inner join  TABLE2  b  on   a.vID  = b.vID
left join   TABLE3  c  on   0        < INSTR ( ',' || b.vcontent   || ','
                                                     , ',' || c.variableid || ','
                            )
;

If you would care to post CREATE TABLE and INSERT instructions for the sample data, and then I could test it.

Do not forget how TO MARKET:

x to (y1, y2,..., yn)

Returns TRUE if x is equal to one of the ys (there may be 1 to 50 points in the list). In your case, x is perhaps a 3 shot characters like "222", and there is only 1 point in the list, a long string such as

'121','222'

This string contains 11 characters, it will not equal to any string that contains only 3 characters.

Tags: Database

Similar Questions

  • The select query-based search page...

    I want to create a basic search page at the base on a select query.

    The select query will not be based on Table.Its based on functions.

    I created a view like this object

    Select xx_test_accruals(:p_date) of ACCUMULATION: p_date double DT

    I created a search page

    In the area of provision of Home Page, I added a region of the query. In this region of request I created a result based research Table.

    When I run the page opens with the field

    DT

    When I get back the date and click go, I get the error message like this...

    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: 27122 Houston: SQL error in the preparation of the statement. Statement: SELECT * FROM (select xx_test_accruals(:p_date) of ACCUMULATION: p_date double DT) QRSLT WHERE ((UPPER (DT) like: 1 AND (DT as: 2 OR DT as: 3 OR DT as: 4 OR DT as: 5)))



    Help, please

    Published by: [email protected] on October 4, 2009 14:04

    Hello

    I tried it on my machine... There is a little change on the approach.

    See we have a display object: XxAccrualsSummaryVO

    the query is

    Select xx_test_accruals (to_date (: 1, 'YYYY-MM-DD')) DT ACCRUAL, double to_date(:2,'YYYY-MM-DD')

    Create a view property object: say DateTestPVO and create a transitional DATE type attribute say dated. MinValue. How to create the View Object(read in dev guide) property.

    Link the date to DateTestPVO text entry and the date attribute. MinValue.

    Now that the page will load in process request initialize the PVO not XxAccrualsSummaryVO.

    Public Sub initialisePVO()
    {

    OAViewObject vo = (OAViewObject) getDatePVO1 ();
    If (! vo.isPreparedForExecution ())
    {
    vo.setMaxFetchSize (0);
    }
    Line = vo.createRow ();
    vo.insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    And when you press the Go button and then enter the date entered and set the location where the XxAccrualsSummaryVO clause.

    If (PageContext.GetParameter ("Go")! = null)
    {
    Get the value entered by the user in the date field.

    DateField OAMessageDateFieldBean = (OAMessageDateFieldBean) webBean.findIndexedChildRecursive ("text");
    String datetest = (String) dateField.getValue (pageContext) m:System.NET.SocketAddress.ToString ();
    Now set the where clause VO settings.
    OAViewObject vodate = (OAViewObject) am.findViewObject ("invoicetestVO1");
    vodate.setWhereClauseParams (null);
    vodate.setWhereClauseParam(0,datetest);
    vodate.setWhereClauseParam(1,datetest);
    vodate.executeQuery ();
    }

    It works perfectly... I tested it.

    Thank you
    Gerard

  • Dell Inspiron 2650-system of operating Windows XP. I am unable to connect to the internet. Status: Network cable unplugged. Where did this cable located on the laptop?

    I have a Dell Inspiron 2650-system of operating Windows XP.  I am unable to connect to the internet.  Status: Network cable unplugged.  Where did this cable located on the laptop?

    I have a Dell Inspiron 2650-system of operating Windows XP.  I am unable to connect to the internet.  Status: Network cable unplugged.  Where did this cable located on the laptop?

    The network port is the port on the laptop (it is not that large - look around) that looks like a large phone connection.

    You have a router/network to connect to and a cable network to connect with?

    Look at the 'Network option' part of the poster:
    http://support.Dell.com/support/eDOCS/systems/ins2600/placemat1.PDF

  • BB Simulator, get: "unable to connect to the selected Mobile Data Service, please try again later."

    I run MDS firstly, it seems well, window is open. But when I run the Simulator, in my case 8300. I get error when you try to access any web resource: unable to connect to the selected Mobile Data Service, please try again later.

    I've initially tried to do this on win7 and moved to xp, which solved my problem of MDS, but I still can't get networking funciton on the Simulator. All that I'm missing? Need to make

    Had, it works with the help of Michael on StackOverflow.

    On Win7.

    (1) uninstalled java and things bb.

    (2) fresh installed JDK 6 with the SDK

    (3) path added to jdk/bin to the path environment variable

    (4) downloaded Simulator runing 4.2 os No 4.5

    (5) installed MDS and Simulator in folder BlackBarry under C: /, runing administrator installation

    (6) powershell started as an administrator

    (7) sailed to MDS folder via powershell run.bat and executed

    8) sailed to BB Simulator via powershell folder and run 8300.bat (downloaded 8300 simulator)

  • Unable to connect to the selected mobile data Simulator service

    First of all, let me say that I am a newbie with BlackBerry and simulators.

    I just downloaded 9630_Verizon and 9630_Sprint simulators as well as the MDS Simulator package. I start the MDS Simulator and the DOS window opens and seems to work very well. I start be 9630 simulators and while it seems to work, when I click on the button of the browser and try to go to any web page, I get:

    Unable to connect to the selected Mobile Data Service, please try again later.

    The version of the 9630 Simulator is 2.12.0.47

    The MDS Simulator version is ' SCM 4.1.4.19 19 2007/07/10»

    I can connect to the MDS Simulator using my browser of desktop connection to localhost: 8080. Statistics show all values of zero, so it seems that the 9630 is not yet connect to the Simulator. Is there a configuration file somewhere that I have to change to make it work?

    After that I posted this, I continued to search the forums of possible solutions. One recommendation, I found was to delete the files ".dmp" and restart the device Simulator. That did the trick, things work now.

  • Unable to connect to the selected Mobile Data Service, please try again later.

    Dear all,

    I downloaded Blackberry email and MDS Services 4.1.4 and the Blackberry 9630 Simulator Simulator. I'm testing a blackberry asp.net application I have running on a test server using the blackberry Simulator.

    I have windows XP box. When I try to run the SDM Service, it runs without error, but acquire it on the site - http://www.blackberry.com/go/mobile - error saying above message - unable to connect to the selected Mobile Data Service, please try again later. How can I solve this problem, I tried to use full qualified names in the config file.

    Any ideas?

    NAV.

    Hi Nav, thanks for your message.

    When you use the BlackBerry 9630 Smartphone Simulator, you may need to change its default connection settings in order to provide network connectivity.  The reason why because the 9630, being a world phone, supports different types of network technologies and a configuration change may be needed to make it work with the MDS Simulator - CS.

    1. from the home screen, click the 'manage connections '.

    2. a popup window opens, select "Mobile Network Options '.

    3. in the options screen, ensure that the following field values are defined:

    • Data services = 'On '.
    • Network selection mode = "auto".
    • Technology network = "1XEV".

    4. close the 'mobile network options' screen to save the changes

    9630 smartphone Simulator should now have network connectivity.

    Sincerely,

    Adam

  • How to store results of the select query in the tables.

    I created a variable varray type and now want to assign some data of output of the select query in pl/SQL, as well as in reports 6i.

    You are in the wrong forum (this is for problems with the SQL Developer tool). You were the one where you have published first on the right, but not to reuse independent threads as you did.

    Kind regards
    K.

  • How to optimize the select query executed in a cursor for loop?

    Hi friends,

    I run the code below and clocked at the same time for each line of code using DBMS_PROFILER.
    CREATE OR REPLACE PROCEDURE TEST
    AS
       p_file_id              NUMBER                                   := 151;
       v_shipper_ind          ah_item.shipper_ind%TYPE;
       v_sales_reserve_ind    ah_item.special_sales_reserve_ind%TYPE;
       v_location_indicator   ah_item.exe_location_ind%TYPE;
    
       CURSOR activity_c
       IS
          SELECT *
            FROM ah_activity_internal
           WHERE status_id = 30
             AND file_id = p_file_id;
    BEGIN
       DBMS_PROFILER.start_profiler ('TEST');
    
       FOR rec IN activity_c
       LOOP
          SELECT DISTINCT shipper_ind, special_sales_reserve_ind, exe_location_ind
                     INTO v_shipper_ind, v_sales_reserve_ind, v_location_indicator
                     FROM ah_item --464000 rows in this table
                    WHERE item_id_edw IN (
                             SELECT item_id_edw
                               FROM ah_item_xref --700000 rows in this table
                              WHERE item_code_cust = rec.item_code_cust
                                AND facility_num IN (
                                       SELECT facility_code
                                         FROM ah_chain_div_facility --17 rows in this table
                                        WHERE chain_id = ah_internal_data_pkg.get_chain_id (p_file_id)
                                          AND div_id = (SELECT div_id
                                                          FROM ah_div --8 rows in this table 
                                                         WHERE division = rec.division)));
       END LOOP;
    
       DBMS_PROFILER.stop_profiler;
    EXCEPTION
       WHEN NO_DATA_FOUND
       THEN
          NULL;
       WHEN TOO_MANY_ROWS
       THEN
          NULL;
    END TEST;
    The SELECT inside the LOOP FOR cursor query took 773 seconds.
    I tried to use COLLECT in BULK instead of a cursor for loop, but it did not help.
    When I took the select query separately and executed with a value of the sample, and then he gave the results in a Flash of a second.

    All tables have primary key index.
    Any ideas what can be done to make this code more efficient?

    Thank you
    Raj.
    DECLARE
      v_chain_id ah_chain_div_facility.chain_id%TYPE := ah_internal_data_pkg.get_chain_id (p_file_id);
    
      CURSOR cur_loop IS
      SELECT * -- better off explicitly specifying columns
      FROM ah_activity_internal aai,
      (SELECT DISTINCT aix.item_code_cust, ad.division, ai.shipper_ind, ai.special_sales_reserve_ind, ai.exe_location_ind
         INTO v_shipper_ind, v_sales_reserve_ind, v_location_indicator
         FROM ah_item ai, ah_item_xref aix, ah_chain_div_facility acdf, ah_div ad
        WHERE ai.item_id_edw = aix.item_id_edw
          AND aix.facility_num = acdf.facility_code
          AND acdf.chain_id = v_chain_id
          AND acdf.div_id = ad.div_id) d
      WHERE aai.status_id = 30
        AND aai.file_id = p_file_id
        AND d.item_code_cust = aai.item_code_cust
        AND d.division = aai.division;         
    
    BEGIN
      FOR rec IN cur_loop LOOP
        ... DO your stuff ...
      END LOOP;
    END;  
    

    Published by: Dave hemming on December 4, 2008 09:17

  • passing parameters to the select query in DB link to call him...

    I have a DB link that executes the select query based on user specified parameter.

    Now, I created an invoke activity and specified input [which must be passed to the query] and output parameters [it is the result of the query]. That invoke link activity DB calls in which a parameter was created to be used in the select query. So my question is, DB link partner take the input parameter of call activity automatically or do we need to specify a mapping for this?

    When you create a partnerlink db the setting that you create for your chosen matches the entry and when you create the variable entry in the invoke for this partnerlink is created with the type of the parameter.

    Create an assignment before your invoke and assign a value to the input variable that you created in the invoke. This value will be passed and used as a parameter in the selection.

    Heidi.

  • Formatting of the Select query

    The following select query returns the data in green.  How do I format to return the path that it is formatted in red?

    Basically, if FIELD1 is "Customer A" and FIELD2 is "Gas" then I back to 'New customer' Field1 and Field2 'gas '.  If 'Customer E' FIELD1 and FIELD2 is 'Total' then it should return 'E rejection' in Field1 and 'Prod_Discharge' in the Field2.

    Please let me know if my question is not sensible or need to be clarified.

    SELECT

    DECODE (Field1, 'Nine', ' A', 'Old', 'E', 'Term', 'F', Field1)

    DECODE (Field2, 'Prod', 'Gas', Field2)

    Customers

    FIELD1 FIELD2

    Customer A gas

    Customer has oil

    Total customers E

    Customer F Total

    Need to format as follows:

    Field1 Field2       

    New gas customer          

    New customer oil      

    E Prod_Discharged releases          

    F Prod_Discharged releases

    Try this:

    SELECT CustomerID

    , CASE WHEN field1 = 'Customer A' THEN 'new customer '.

    WHEN field1 = 'Customer E' AND field2 = 'Total' THEN 'E releases '.

    WHEN field1 = ' customer F ' AND field2 = 'Total' THEN 'F performs ".

    Of ANOTHER Field1

    FIELD1 AS END

    , CASE WHEN Field1 IN ('E of customer', ' customer F ') AND field2 = 'Total' THEN 'Prod_Discharged '.

    Of OTHER Field2

    END AS FIELD2

    Status

    Customers

    ;

  • create the single text field to display in the select list

    Hello, I will through in circles with what I have to achieve. I have this on a previous post, but do not know if what I was asking, it was OK

    what I need to do, is to have a list of selection of size for the end user, BUT in the backend, I need to have a text field or text fields which can be manually changed. the db has a prod table with

    ID

    / / DESC

    Price

    Size

    fields, so I thought that if it was a field of single line text that could store all sizes in the db, a field and can be edited in the backend

    OR

    paypal buttons how it where the backend has a function of size to add you can add one set

    Mount of sizes and can manually change them is necessarily, because I have the backend show if a product has sold out and I wanted to be able to type "sold out" so that in the selection list

    Thanks in advance for any help

    Not much needs to change.

    You can always display the same result as you would if a product is available.

    The only difference would be the item would show "sold out". In this case, add a conditional event listener to listen to 'Sold Out' in the status of product on your front-end server. A hyperlink to 'request form' echo here.

    Basically, a 'form' link would appear if the product is "sold out".

  • JPEG image is displayed in the selected image files folder

    When the discovery of the computer and selecting the image file folder - I use to get the small real individual images of each image in the folder without having to enter in the Windows Photo Gallery.  Now, I have only an icon, the same as that for each of the images and the only way I can see that the actual image is to select a specific icon and hope that is the image I'm looking for.  Can someone tell me how I can get all the individual photos in the folder of image file to display when I select that folder?

    Hi looking, advanced

    Thank you for visiting Microsoft Answers.

    I first suggest you to change the display of the photo icons folder type medium or large icons and check if that helps.

    To do this, follow these steps:

    Open the photo folder. Click view > select icons medium or large icons.

    Make sure that default programs > associate a file or protocol type with a program, file types .bmp, .ico, DIBs, .jfif, .jpeg, .jpe, .png, .png, .tiff, .tif, .wdp file names must have the default program like Windows Photo Gallery.

    Otherwise, select the type of file name, click on change program and browse to choose as default Windows Photo Gallery.

    Additionally, set the global folder options

    To specify the global settings that apply to all folders, follow these steps:

    1. Click Start, click Control Panel, and then double-click Folder Options.
    2. On the general tab, click the options you want.
    3. In the view tab, click the options you want.
    4. Click OK.

    Note To restore the default settings for all folders, click restore defaults on the general tab or on the view tab.

    Use the same display settings for all folders

    You can apply the same view settings to all folders on your computer. You cannot apply the same view settings for all folders, images icons, toolbar settings or tasks folder. To apply the same view settings to all folders, follow these steps:

    1. Locate and open the folder which includes the display setting you want to use for all folders.
    2. On the Tools menu, click Folder Options.
    3. On the view tab, click apply to all folders.
    4. Click Yes, and then click OK.

    Note To reset all folders to the default display settings, repeat these steps, but click reset all folders in step 3.

    Hope the helps of information. Please post back and we do know.

    Concerning
    Joel S
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • When I pull the select query, but therefore cannot get the data that you check?

    Hello

    When I raised this query without get data then can you help me it's ok?

    DataSource {
                            id: durgSearch_dataSource
                            source: "sql/durg.db"
                            query: "select * from durg_detail where durg_name =" + "\"" + searchTextField.text + "\""
                            onDataLoaded: {
                                durgSearch_dataModel.insertList(data);
                            }
                        }
    

    Glance. I just tested your app and it works correctly. I entered Rock and search button and it returns a Rock record. If you want to get all records that contain a particular letter or Word, you can use the following query:

    "select * from medicin_detail where PharmacyName LIKE '%" + searchTextField.text + "%'"
    
  • Error in the SELECT query

    Hello

    Oracle version: 11g R2 (11.2.0.2)

    I get the following error message (I'm using TOAD for Oracle last version 12.1):

    ORA-12801: error reported in the parallel query P032 Server

    ORA-01114: block write IO file error (block #)

    ORA-01114: IO error to the file 201 (block # 2165248) writing block

    ORA-27072: IO file error

    Linux-x86_64 error: 28: no space is available on the device

    Additional information: 4

    When you run a SELECT query:

    SELECT field1, Field2...

    OF (REVENUE_SOURCE b

    INNER JOIN ACCOUNTS_CLASSIFICATION one

    WE b.SUB_ACCOUNT = a.SUB_ACCOUNT)

    INNER JOIN REPORT_PRODUCT_ID c

    ON b.REPORT_PRODUCT_ID = c.REPORT_PRODUCT_ID

    WHERE a.UC_BUSINESS_UNIT = 'ANX.

    AND b.report_mm > =.

    (SELECT ADD_MONTHS (MAX (report_mm),-13))

    OF REVENUE_SOURCE)

    AND b.REVENUE_FLAG = - 1

    AND (b.CALLS <>0 b.MINUTES <>0 b.CHARGE_AMOUNT GOLD <>GOLD 0);

    Please notify.

    NOTE: the query worked well for a while, no errors, then all suddenly it became much accentsr and then I started to get the error message above.

    Kind regards

    M.R.

    Hello

    ORA-27072: IO file error

    Linux-x86_64 error: 28: no space is available on the device

    Looks like a system or OS, no SQL or PL/SQL problem problem.  I think you will answer sooner if you check this issue as 'Response' and start a new question in the forum of "General Question":

    https://forums.Oracle.com/community/Developer/English/oracle_database/general_questions/content

    My guess is that Oracle tries to allocate space in the tablespace temp, but cannot because the disk is full.  If you have a full disk, then create the space to this topic.

    I see nothing wrong with your code; Certainly, nothing which would cause an error like that.  The fact that the query has worked well for some time confirms that there is noting wrong with the request itself; It is just triggering a mistake elsewhere.

  • as with the select query

    Hello

    I have a query something like...

    Select...

    ....

    where

    b.ProdName as 'GEAR of the TREE %' or b.prodname like '% FRONT GEAR %' or b.prodname like '% BREAK 4 %k '.

    and

    b.ProdName as

    (select the name of the society of companyms

    where < some comdition >

    )

    order of 3.6

    I have blocked in:

    b.ProdName as

    (select the name of the society of companyms

    where < some comdition >

    )

    How to give a select query with like operator.

    In above query I want to b.prodname as above and the name of the company for which I give condition.  Company names are stored in another table and I want to select and use them with like operator.

    Thank you.

    Hello

    It is not clear what you want to do.

    One possibility is an EXISTS subquery, like this:

    ...

    WHERE (b.prodname LIKE "% of the CYCLE of the TREE" - begins with this text

    OR b.prodname LIKE '% FRONT GEAR %' - contains this text

    OR b.prodname LIKE '% BREAK 4 %k' - contains this text

    )

    AND THERE ARE)

    SELECT 1

    OF companynms

    WHERE--a condition

    AND b.prodname AS business

    )

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

Maybe you are looking for

  • How to manage iphone applications

    How can I manage my iPhone apps in iTunes? When I select the iPhone in iTunes list is empty, but to the right, the home screens display correctly the apps. I know that I did it before, but for some reason that I can't move applications around now. My

  • A problem occurred during extraction of files.

    When I go to run the program, I downloaded and choose the location of the folder I get an error that says: "this is a problem when extracting the files. Check the amount of space available on your computer and the rights to write to the destination f

  • Message 'Media pending' on CC 2015.13

    Updated for first 2015.3 (10.3) and oh dear. It is slow and buggy.Whenever I double click on an item in the bin, we need to think for a few seconds (sometimes more) and I get the dreaded "Media Pending" message. On a project I was working on the prev

  • Unable to connect Acrobat 11 trial

    Hi, I am trying to open a trial version of acrobat 11 but I can't after the sign in guest of activation. Telling me that my computer cannot access the internet. Ive tried turning off line but unable to generate a claim code. Don't know how I activate

  • "Adobe Application Manager quit" error message when you try to install on mac with El Capitan 10.11.2 14

    also get the message "unable to write to the location/users/username/library/Application Support / Adobe.