How to insert some strings in a query with the clausule 'in' in a procedure

Hello fellows.
Do you know how to insert some strings in a query with the clausule 'in' in a procedure (with a variable)?.
I tell us my problem with an example:
I want to use this select but introducing a variable instead the 'value1', 'value2':
select * from table1 where field1 in ('value1', 'value2');
if I declare the variable var1 as:
TC_VAR1 CONSTANT VARCHAR2(50) := '''value1'',''value2'''
and I use it as:
select * from table1 where field1 in (TC_VAR1);
It doesn't work because Oracle takes TC_VAR1 as an all string. I think Oracle takes it as this:
select * from table1 where field1 in ('value1, value2');
If I use the data type TABLE, I don't know how to use well:
TYPE varchar2_table IS TABLE OF VARCHAR2(10);
tb_var varchar2_table;
select * from table1 where field1 in (tb_var);->It returns an error and there ins't an method that it returns all values.
A curious case is that if I have a sql script (for example script1.sh) with this query:
select * fromt able1 where field1 in (&1)
and I invoke this script as
script1.sh "'''value1'',''value2'''". It works
Can anybody helps me?.
Thanks.

Thanks to all. Really.
First, sorry for my English. It's horrible. Thank to all for understand it (my English).
I've resolved my problem with these links:
ORA-22905: cannot access rows from a non-nested table item
and
http://stackoverflow.com/questions/896356/oracle-error-ora-22905-cannot-access-rows-from-a-non-nested-table-item
At last, I have used someting like this:
DECLARE
number_table_tmp NUM_ARRAY:=NUM_ARRAY(410673, 414303, 414454, 413977, 414042, 414115, 413972, 414104, 414062);
BEGIN
FOR c1 IN (SELECT par_id, 1 acc_vdo_id FROM SIG_VIS_CAM
WHERE par_id IN (SELECT * FROM TABLE(number_table_tmp))
UNION ALL
SELECT par_id, 2 acc_vdo_id FROM SIG_ACCAO a
WHERE par_id IN (SELECT * FROM TABLE(number_table_tmp))) LOOP
NULL;
END LOOP;
END;
but first I had to create the type NUM_ARRAY like this:
CREATE TYPE subjectid_tab AS TABLE OF NUMBER INDEX BY binary_integer;
THANK YOU, GUYS. YOU ARE THE BESTS. ;-)
Edited by: user12249099 on 08-sep-2011 7:37
Edited by: user12249099 on 08-sep-2011 7:37

Similar Messages

  • How to insert a String at the CaretPosition without moving the Caret?

    I have a JTextPane wrapped by a JScrollPane. The JTextPane is where chatroom messages appear. When a message is appended at the end, it determines whether to scroll to the bottom based on some conditions (scroll to the bottom only if the user was already viewing somewhere near the bottom). That part is working fine.
    Although the JTextPane is not editable, it allows the user to make selections using a mouse so that blocks of text can be copied from the chatroom. The default caret of JTextPane handles that for me.
    But the problem comes when the caret position is at the end of the document when my program inserts a new message with the following code:
    StyledDocument doc = textPane.getStyledDocument();
    doc.insertString(doc.getLength(), message + "\n", null);The caret was at doc.getLength() to begin with, when the new message is inserted at the end, it "pushes" the caret to a new position. The caret movement is causing JScrollPane to scroll to where the caret is visible (the bottom), therefore interfering with my scrolling algorithm (see above).
    So, when the caret is doc.getLength(), how do I insert a String at doc.getLength() with the caret staying at the original position?
    In other words, how do I insert a String at the caret position without the caret being moved?
    Note:
    1) I don't want to use setCaretPosition() to set the caret to its original position, because calling this method will trigger a CaretEvent, thus causing the JScrollPane to scroll (to the caret) which is not what I want (see above).
    2) I don't want to remove the CaretListener, cause then the JScrollPane won't scroll even when the user wants to make a multiple-page selection using the mouse (dragging the selection off screen).
    3) I want to keep the Caret at the original position so that the user won't lose his/her selection when new messages appear (which can be quite frequent).

    I keep forgetting how difficult it is to do such simple things in the text package. But it's not impossible! Here's a way to replace the relevant listeners, plus a sample implementation. If you know you'll never, ever delete any text from the JTextPane, you may not have to provide a replacement DocumentListener at all; this one just makes sure the caret isn't past the end of the document.
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.text.DefaultCaret;
    import javax.swing.text.Document;
    import javax.swing.text.JTextComponent;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    public class ChatCaret extends DefaultCaret
      private MyHandler newHandler;
      private PropertyChangeListener oldHandler;
      public void install(JTextComponent c)
        super.install(c);
        PropertyChangeListener[] pcls = c.getPropertyChangeListeners();
        for (int i = 0; i < pcls.length; i++)
          if (pcls.getClass().getName().equals(
    "javax.swing.text.DefaultCaret$Handler"))
    oldHandler = pcls[i];
    newHandler = new MyHandler(oldHandler);
    c.removePropertyChangeListener(oldHandler);
    c.addPropertyChangeListener(newHandler);
    break;
    Document doc = c.getDocument();
    if (doc != null)
    doc.removeDocumentListener((DocumentListener)oldHandler);
    doc.addDocumentListener(newHandler);
    public void deinstall(JTextComponent c)
    super.deinstall(c);
    c.removePropertyChangeListener(newHandler);
    Document doc = c.getDocument();
    if (doc != null)
    doc.removeDocumentListener(newHandler);
    class MyHandler implements PropertyChangeListener, DocumentListener
    private PropertyChangeListener oldHandler;
    MyHandler(PropertyChangeListener oldHandler)
    this.oldHandler = oldHandler;
    public void propertyChange(PropertyChangeEvent evt)
    Object oldValue = evt.getOldValue();
    Object newValue = evt.getNewValue();
    if ((oldValue instanceof Document) ||
    (newValue instanceof Document))
    setDot(0);
    if (oldValue != null)
    ((Document)oldValue).removeDocumentListener(this);
    if (newValue != null)
    ((Document)newValue).addDocumentListener(this);
    else
    oldHandler.propertyChange(evt);
    public void removeUpdate(DocumentEvent evt)
    int length = getComponent().getDocument().getLength();
    if (length < getDot())
    setDot(length);
    public void insertUpdate(DocumentEvent evt) { }
    public void changedUpdate(DocumentEvent evt) { }

  • I try to insert some images on a website but the images are not in the right color mode. I do not know what to do? and also I have 1200 images to insert so I can not change one after one. So I need to set up an action, but I donot know how to do it... Tha

    I try to insert some images on a website but the images are not in the right color mode. I do not know what to do? and also I have 1200 images to insert so I can not change one after one. So I need to set up an action, but I donot know how to do it... Thanks

    What is the problem specifiaclly?
    If the images are intended for web use I would recommend converting them to sRGB which could be done with Edit > Convert to Profile or with File > Save for Web, but as including a Save step in Actions and applying them as Batch can sometimes cause problems I would go with regular converting.
    You could also try Image Processor Pro.
    Scripts Page

  • How to insert, as an input variable within formula, the total time window on scope?

    How to insert, as an input variable within formula, the total time window on scope (i.e. 20ms/div x 10 div = 200ms)?
    BELOW IS AN EXAMPLE OF ISSUE:
    FORMULA FOR ACTION INTEGRAL:
    STATISTICS:
    Input variable: DPO4034(CH1);
    Check Box: number of samples.
    FORMULA
    Input variable 0: DPO4034(CH1); alias: x0
    Input variable 1: "Total Time Window on Scope???"; alias: x1
    Input variable 2: Number of Samples (CH1); alias: x2
    Under Operation Setup: Formula
    Y= (x0^2)*(x1/x2)
    Output: Processed Data 1 (CH1)
    THEN USING STATISTICS:
    Input signal: Processed Data 1 (CH1)
    Check Box: SUM
    Output: CH1 Action Integral [A^2s]
    Solved!
    Go to Solution.

    Hi again Catherine,
    I have now added another TekScope (TDS3032B) along with the DPO4034 and run the same work-around on the TDS3032B using CH1 as the "real" signal channel and CH2 as the "burst width" channel. However, the value returned for CH2 is nominally 99E+36 (min 99E+36, max 99E+36) with very few retrievals of correct burst width (~200ms). Seems the SignalExpress program is unable to consistently retrieve from TDS3032B the actual burst width (scope's time scale/window) and defaults to 99E+36 value. Any ideas on what is occurring and how to make it work? Attached are some screen captures to help guide discussion.
    Regards,
    Michael
    Attachments:
    TDS3032B - incorrect burst width.png ‏301 KB
    TDS3032B - correct burst width.png ‏287 KB
    DPO4034 - always correct burst width.png ‏302 KB

  • How to read some images from file system with webdynpro for abap?

    Hi,experts,
    I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
    How to read some images from file system with webdynpro for abap?
    Thanks a lot!

    Hello Tao,
    The parameter
       icm/HTTP/file_access_<xx>
    may help you to access the pictures without any db-access.
    The following two links may help you to understand the other possibilities as well.
    The threads are covering BSP, but it should be useful for WebDynpro as well.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
    Best regards
    Christian

  • I never used LabView but need to generate a RS-233 serial output string that contains an IRIG timestamp based on a contact closure. Is LabView an appropriate tool to do this? How much does it cost to get started with the product?

    I never used LabView but need to generate a RS-233 serial output string that contains an IRIG timestamp based on a contact closure. Is LabView an appropriate tool to do this? How much does it cost to get started with the product?

    Labview isn't cheap, but it would certainly allow you to build a program (set of vi's - virtual instruments) that would do what you describe. Where would the timecode information come from? Your vi, or program, would: Start up, initialize the serial port, loop until a trigger happened, read the timecode (from where?), output that timecode out the serial port in a loop until you pressed the stop button. There is a free evaluation of Labview software available from NI - the base product itself runs about $995.
    - Dave

  • How to insert data into two tables linke with foreign key..

    I have two tables
    1)EMP(emp_ID,username,emp_type_code)
    emp_ID is primary key, emp_type_code is a foreign key references emptype table.
    2)emptype(emp_type_code,emp_type_descripton)
    emp_type_code is primary key
    Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..

    CREATE TABLE "CATDB"."DWDIMUSER"
    "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_ID" NUMBER(10,0),
    "FULLNAME" VARCHAR2(20 BYTE),
    "FNAME" VARCHAR2(20 BYTE),
    "LNAME" VARCHAR2(20 BYTE),
    "USER_SUBTYPE" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE,
    CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
    CREATE TABLE "CATDB"."DIMSPECIALTY"
    "SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_NAME" VARCHAR2(100 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
    SELECT DISTINCT
    Engineer AS FullName,
    regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
    regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
    'Engineer'
    FROM EMPLOYEELOOKUP;
    INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
    SELECT DISTINCT SPECIALITY
    FROM EMPLOYEELOOKUP;
    COMMIT;
    CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
    CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
    "EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
    "ENGINEER" VARCHAR2(25 BYTE),
    "SPECIALTY" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    DATA IN EMPLOYEELOOKUP
    Engineer, Specialty,
    John, Dow, Electronis,
    Dow, Jons, Technician
    Stan Smithers Sales
    Mark, Richards Marketing
    Jenny, Lane Marketing
    John, Lee Sales
    I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
    BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY.

  • How to save SOME time machine Mac backups from the TM disk to other disk WITHOUT formatting the destination disk?

    Hi,
    How to save SOME time machine Mac backups from the TM disk to other disk WITHOUT formatting the destination disk?
    I have a Time Machine disk (A) including the backups of several different Macs (B, C, D & E) generated with an old Mac OS X 10.5.8 (iMac PowerPC) over the years.
    I have transferred the old Mac contents to a new Mac with OS X 10.8.3 using Migration Assitant. All OK.
    Now, I want to erase such TM disk A to use if for other purposes, but first, I would like to RECOVER the backups of some Macs inside it (D and E). Is that possible WITHOUT formatting the destination disk and selecting only some Macs from the TM disk and not the fulll TM disk? How?
    Thanks.

    Thanks for the reply. I do not think that is messy, anway. I simply used the same external disk as Time Machine disk for different Macs. And that worked OK all the time for years.
    The ExternalTimeMachineDisk contains the folder Backups.backupdb
    which contains the following folders (each one corresponding to the Time Machine backup made from each Mac):
    Mac1
    Mac2
    MacBook1
    MacBook2
    In relation to my message above, is it possible to select specific files, folders or full Mac backups from such Time Machine disk and save them to other disk? How?
    Thanks.

  • HT3310 how do i get my headphone to work with the iphone?

    how do i get my headphone to work with the iphone? Are there some settings
    that I need to turn on so I can use my headphone while talking on the phone?

    Are you using the earbuds that came with the iPhone? If you are using other earphones, it's possible that they need an adaptor to work with the iPhone's recessed headphone jack. 

  • Hello guys..does anybody know how to install and use adobe master collection with the new lion?   I need to use Flash and illustratore, but apparently those programmes are incompatible with the new operative sistem...   I am a new mac users and I'd like t

    Hello guys..does anybody know how to install and use adobe master collection with the new lion?
    I need to use Flash and illustratore, but apparently those programmes are incompatible with the new operative sistem...
    I am a new mac users and I'd like to know if there are other similar programmes I can use with lion!

    Lab79 wrote:
    Are you on Apple's payroll?
    well dude I can only let you know that as I work with those programme I don't have to pay for it is my company that pays the programme I whant to use( that's why I was asking if there where other programmes ..that I could use with lion insted that Illustrator and Flash!)..I know Adobe since 2005 and I can say that Adobs products are very good...I think that if it's an Adobe probleme or fault ..they will solve it very soon...but unfortunally I have the impression that after Jobs passed away Appel decided to change politics..and everything started to go very bad! (see FCP X)..
    good luck with apple dude..
    Where is the Apple problem? I have CS4 and CS5 running perfectly fine on my Macbook Pro. Installed 5 after Lion upgrade. Worth every cent. Adobe did have some catching up to do with Lion but with the CS5.5 update all runs fine. But not yours. So it is a problem with the Lion OS? You say you have been with Adobe since 2005. So you would be aware of all the other issues that Adobe had catching up with past Oss in Mac and Windows then. They get it right, but it is up to them. It is not up to Apple, nor Microsoft for that matter, to run around and check that every software developer in the world is running their business properly.
    And what has politics got to do with anything. Some people just have to blame Software for their poor Hardware maintainence of failure of the same.
    <The only think I can really do is to go back on my old windows...give back this orrible lap top and ask for my money back!>
    Great suggestion. You should go with that one, but good luck getting a refund.
    Bye

  • Problem in query with the u0091Document numberu0092

    Hi,
    I got problem in query with the ‘Document number’
    There are three columns in the cube 1) Document number 2) Country 3) Count
    In the cube there are multiple entries for same document number as below.
          Document number            country          Count
         10000               US          1
         10001               US          1
         10002               US          1
         10002               US          1
         10002               US          1
         10003               UK          1
         10004               IN          1
         10004               IN          1
    When I ran the query on this cube for country US it shows count as 5 but I want count as 3 (i.e. it has to take count only once for the same document no’s)
    Similarly for country IN I want count as 1

    Hi,
    You have to create a counter based on the document number (exception aggregation). There is a How-to paper available for this. It is called: How-to...count the occurences of a characteristic.
    Regards,
    P.

  • How do I let local Flash content communicate with the Intranet?

    How do I let local Flash content communicate with the
    Intranet if you don't have intenet access to set it up? you se like
    a host for example with is out of an internet conexion, but the
    flash file use a web service that it's on the intranet but can't
    config the Global security settings.....
    help!!!

    That variable could be simply called... nextSection
    If you plan to use frame labels, than nextSection would be a String, otherwise it would be an Int (integer).  So when you click the button for section X of the site, the nextSection value is assigned either the frame label or the frame number of that button's section.  Then at the end of your outro, you have a line of code.... gotoAndPlay(nextSection)
    The nextSection variable should be declared in an actions layer that only has code in frame one but extends unbroken for the full length of the timeline.  This makes it available to anywhere along the timeline where it needs to be either read or assigned.  I sually use two layers for actions... one to hold such things like this that get shared anywhere along the timeline (function/variables)... and another for frame-specific actions (stop, value assignment, function calls, etc)

  • HT3775 How can i play my avi formatted movies with the new mac OSX 10.9.2 update?

    How can i play my avi formatted movies with the new mac OSX 10.9.2 update?

    Try using VLC or installing both QuickTime 7 and Perian. Nothing will work with all AVIs; some of them require codecs not available for Mac OS X.
    (105507)

  • How can I get "IMAQ Line Fit" stable (with the same points)

    How can I get "IMAQ Line Fit" stable (with the same points)
    I my vision applications I use a lot off times "IMAQ Line Fit"
    some times the results are not Stable.
    See vi and word document attached.
    When I take the same points but in a other order (sort)
    then suddenly all points are used.
    In this case I was looking for a edge in vertical direction (Y).
    I found the points but "IMAQ Line Fit" did not function well.
    I tried changing all settings like pixel radius and minimum score and
    also threshold and so on. But no result.
    Then I sorted the points reversed and that worked. See vi.
    I use labview Labview 8.6.0 and IMAQ machine vision.
    Maybe this problem is solved in a newer version.
    Please let me know.
    Thanks
    Attachments:
    TEST-imaq-line-fit-86.vi ‏169 KB
    IMAQ-Fit-Line-Problem-86.doc ‏230 KB

    Thank You for your reaction Hossein,
    This "one application" uses "Line fit" about 20 000 000 times a day.
    about 200 will go wrong. With your setting the the "Line fit" for this occasion will work but others will go wrong.
    A algorithm should be:
    1e Stable, when using the same points and settings the result MUST be the same. How the points are sorted should not matter.
    2e Accuracy
    3e Speed
    4e Testing. Is very difficult but al least close points and the same points and sorting ... should be done
    NI now as made a " IMAQ Line Fit" Problem CAR (Corrective Action request) 298016.
    so in the future there will be a update.
    In the mean while a made a line fit which uses Bisquare option from Linear Fit.vi :
      from C:\Program Files\National Instruments\LabVIEW 8.6\vi.lib\analysis\6fits.llb
    This is a temporary fix because "IMAQ Fit Line VI" is not so stable.
    Because outliers should be rejected only Bisquare does this reasonable.
    This program does NOT USE "Minimum Score" and "Pixel Radius"
    Valid fit = When there are enough points within Outlier_Distance.
    Algorithm steps:
    - Determine if line is more horizontal then vertical, Compare DeltaX with DeltaY
    - If DeltaX <= DeltaY then SWAP X Y and later Swap back
    - Sort Points at on X value
    - First : Bisquare Linear Fit
    - Calculate distances to the found line for all points
    - Inliers: Points within Outlier_distance
    - Outliers: Points outside Outlier_Distance
    - Only use Inlier Points
    - Check again if DeltaX < DeltaY then SWAP X Y later SWAP back again
    - Second : Bisquare Linear Fit only with the Inlier Points
    - Results are from the second fit
    Warning : This Program is Not so accurate and Not so fast
    See attachments it is in labview 8.6
    If some has a improvement please let me know.
    Thanks
    Attachments:
    svi_fit_line_Bsquare_and_draw.vi ‏18 KB
    Fit_Line_Bisquare_Linear.vi ‏40 KB

  • How do I make a hands free call with the iphone 4s?

    How do I make a hands free call with the iphone 4s?  I have a bluetooth car device and when I try to talk through it (as I did with my old phone) to call someone it does not work.  so far only hte last person called is redialed.

    That is a carrier-based service. So first you have to make sure your service contract includes that feature.
    It usually also includes Call Hold. So you call the first party, put them on hold, call the second, then reactivate the first. But only if your carrier allows you to.

Maybe you are looking for

  • How do I disable the credentials prompt on Lion/ML for common tasks?

    I am a long time PC user and have always used Microsoft operating systems, mainly since that was where I started 20 years ago. Although I know I'll never get away from MS products I have, for various reasons, decided to move to a Mac for my day-to-da

  • IPod touch random crashing

    I just upgraded from a 3G 40GB iPod to a brand spankin' new 16Gb iPod touch, and I'm noticing some random weirdness with it. First a few details: *- At this moment I have 969 songs, 1 video, and 4 photos loaded on my iPod touch, leaving 3.9GB free.*

  • Transfer music from iPod mini to iPod with video

    I'm going to be spending a few nights at my friend's house and they plan on giving me their iPod with video. I currently have the iPod mini and I was just wondering if there's a way (in Windows XP) if I can get my music and playlists from my iPod min

  • Buying music off itunes

    hello please help! when i buy music off itunes it seems to send in straight into the icloud why? i want it to appear in my library so i can add onto my ipod. please help?

  • Messages illegible in Reader XI

    Except for the 'About Reader XI' response, all windows called up in Reader are illegible. The documents are displayed correctly, the menu bar at the top is clear, pull down sub menus are clear. But when a new pane is opened by a menu sellection (eg H