How to place a collar from pl/sql tab to set cursor?

Hello
I constantly get this error:
**************************************
Error on line 1
declare
--------------------------------------------
number of j: = 1;

cursor f

ORA-06550: line 9, column 20:
PLS-00103: encountered the symbol "TABLE" when the expected in the following way:

constant exception < an ID >
< a between double quote delimited identifiers > double Ref table Fedya
char time timestamp interval date binary national character
NCHAR
*************************************************
Code snippet:


declare
--------------------------------------------
number of j: = 1;

cursor firstquery (c_item in varchar2) is
SELECT SEARCH, the NAME, ID OF tablename
WHERE name LIKE c_item.

first_rec_tbl_type is the firstquery % rowtype directory index table;
first_rec_tbl first_rec_tbl_type;

type act_str_tbl_type is table of the varchar2 (50) index directory.
act_put_str_tbl act_str_tbl_type;

Start

It's the fine workmanship that I performed as a stand-alone script also

a table of act_put_str_tbl here.passing of values to below:

-I guess the problem lies here-
Start

dbms_output.put_line (' second reached start ');
I'm in act_put_str_tbl.first... act_put_str_tbl. Last
loop
dbms_output.put_line (' inside the second loop start ');
Open firstquery (act_put_str_tbl (i));
loop
extract the firstquery in first_rec_tbl (j);
j: = j + 1;
released in firstquery % notfound or firstquery is null;
end loop;
close firstquery;
end loop;


How to use parameterized cursor with PL/SQL table, any help is appreciated in the snippet above.

Thank you

user540130 wrote:
In the two above you are beating the objective by the way
Open firstquery ('S%'); Why you can not spend the type of array here is also of type varchar.

Oops. Check my edited answer now.

SY.

Tags: Database

Similar Questions

  • How to operate my function from PL/SQL?

    I have 4 table

    1st is EMPLOYEE (E #, ENAME), the primary key is E #.

    2nd is DRIVER(E#,L#), the primary key is E # ID EMPLOYEE

    3. is TRIP(T#,L#), the primary key is T #, foreign key L # driver

    4th is the primary key TRIPPT(T#,PT#) T # travel

    I create a function that finds the length (total number of pt #) of the longest point to the driver
    create or replace function LONGPT (DL# in TRIP.L#%type)
       return TRIPPT.PT#%type
    IS
       TRIPPT#   TRIPPT.PT#%type;
    begin
       select max (PT#)
         into TRIPPT# 
         from TRIPPT
        where T# in (select T#
                       from TRIP
                      where L# = DL#);
    
       return nvl (TRIPPT#, 0);
    end LONGPT;
    / 
    How can I do a select query to view the employee NAME, LONGPT. The name of the driver that perform no trigger point must be in the application as well.

    I try
     
    SELECT DRIVER.L# AS License_No, LONGTPT(TRIP.L#) AS "LONGEST POINT" 
    FROM DRIVER 
       LEFT OUTER JOIN TRIP on DRIVER.L# = TRIP.L#;
    This only query the L# and the LONGEST Point.
    Could someone guide me how to do select on screen the ENAME and with my LONGPT function.

    Published by: user4757127 on November 25, 2012 10:11

    Published by: user4757127 on November 25, 2012 10:17

    Published by: user4757127 on November 25, 2012 10:18

    Hello

    Welcome to the forum!

    user4757127 wrote:
    ... How can I do a select query to view the employee NAME, LONGPT. The name of the driver that perform no trigger point must be in the application as well.

    I don't know what you mean by "the employee, LONGPT.

    My best guess is that you need join the employee table in your current query:

    SELECT  driver.l#          AS License_No
    ,     employee.ename                              -- *****  NEW  *****
    ,     longtpt (trip.l#)      AS "LONGEST POINT"
    FROM           driver
    JOIN          employee     ON   driver.e#     = employee.e#     -- *****  NEW  *****
    LEFT OUTER JOIN trip          ON   driver.l#     = trip.l#
    ;
    

    Again, this is just a guess and guess isn't always the best way to solve problems.

    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 {message identifier: = 9360002}

  • How can I call ttOptUpdateStats from PL/SQL

    I would like to: call ttOptUpdateStats from within a PL/SQL block.

    An example of one: run immediately using the input arguments in the PL/SQL Developer's Guide.

    The examples cover only builtin procedures returning data.

    Thanks for the help!  Here's my working version:

    Create procedure UPDATE_STATS as

    type of TblList is the table sys. TBL_STATS. TYPE % TBLID;

    tblids TblList;

    TBL VARCHAR2 (255);

    flag for number: = 1;

    plsql_block VARCHAR2 (255);

    LASTDATE SYS. TBL_STATS. TYPE % LASTSTATSUPDATE;

    Start

    plsql_block: = "call ttOptUpdateStats(:tbl,:flag)";

    Select TBLID bulk collect into SYS tblids. TABLES where the TBLOWNER not in ('SYS', 'TTREP', 'GRID');

    because me in tblids. FIRST... tblids. LAST

    loop

    Select trim (TBLOWNER): '. ' || Trim (TBLNAME) tbl of SYS. TABLES where SYS. TABLES. TBLID = tblids (i);

    execute immediate plsql_block using tbl, flag;

    Select LASTSTATSUPDATE from SYS lastdate. TBL_STATS where SYS. TBL_STATS. TBLID = tblids (i);

    dbms_output.put_line ('< '="" ||="" rpad(tbl,45)="" ||="" '="" '="" ||="" lastdate="" ||="" '="">');

    end loop;

    exception

    while others

    then

    Rollback;

    end UPDATE_STATS;

    /

    Ed...

  • How to call the package from a SQL string function

    I create a SQL string in my c# application. Within the selection, I have a function call to a package in my diagram.

    ex.

    "Select id, package1.fncFormat (text) of tblText".

    If I run this within Oracle it works fine but when I run my application and the SQL runs the use of OracleDataReader I get


    «ORA-00904: "PACKAGE1".» ' FNCFORMAT': invalid identifier.

    Is this possible to do?

    It is a dynamic sql string that is built using many different options.

    Thanks for any help

    Do you run this application and directly on DB package by the same user?
    Check the privileges of the user on the application.

    Kind regards
    Bobin

  • How can I stop firefox from opening a tab in Tools/Options

    Firefox 38.0.1

    Suddenly instead of an open box now I have an open tab when I go in Tools/Options - how can I recover the box and the aperture stop tab, I'd rather be able to see my tab running below the box in Tools/Options, and now I can't. This makes things very difficult.

    Hi, FredMcD advice is what you need: you can return to the old window Options by: Type Subject: config in the address bar, press ENTER, accept the warning, scroll to browser.preferences.inContent and double-click on it to change the "value" from true to False, taking care to not to change what anyone else. You will then need to restart Firefox.

    If your question is resolved by this or another answer, please take a minute to let us know. Thank you.

  • How can I stop Firefox from closing of tabs or sessions automatically?

    If I have one session open Firefox invites you to recover the previous session but with 2 windows, which sometimes happens with some tabs from infinity that I don't care, the last window is saved (the one with 5 tabs instead of one with 165 tabs) and I lose my entire browsing history. This question actually forced me to swap browsers repeatedly by pure frustration about the loss of research. I use TooManyTabs to save some but it becomes so tedious to manage in this elsewhere, even with tab groups, my navigation is non-linear and does not always follow a set of rules, you can group easily to do its usually the pages more valuable I lose links to. He must really be a solution for this.

    ~ FireMonkey

    Good to hear you get this window.

    I do not envy the UI designers, trying to make things more and more visible with less space. And when they create Adaptive UIS that seems to read your mind, it's scary.

    It might be a good idea after the restoration of a session the first time to open a help page explaining how to use the history menu to restore more windows and tabs. The problem with single pages is that no one seems to remember them when they need it. Sigh.

  • How to remove common locations from the file tab in the file Explorer?

    When I open file Explorer and tap the file it displays a list of frequent places invading my privacy

    When I open file Explorer and tap the file it displays a list of frequent places invading my privacy

    Hello

    I don't know what you mean by "invading my privacy?

    Frequent sites display only the folders and files that you opened in the file Explorer. Each user account displays only frequent places for this specific account. No other account can see the frequent locations for your user account.

    The frequent places are associated with the taskbar Jump Lists for applications that are pinned to the taskbar.

    You can right-click on the taskbar and select Properties.

    Select the tab lists Jump and remove the check from the 2 options you see here.

    This will disable the list of common places in the file Explorer and lists of shortcuts on the taskbar.

    Concerning

  • How to remove the flash from dreamweaver site and use the cursor to images instead of flash - what is the code?

    Our site has been built in dreamweaver and used 2 flash.  I don't know flash.  I want to delete and simply add images to cursor with the previous buttons and following.

    Dreamweaver has no built-in cursors.

    You will need to find a plugin that can do this.

    Look at jQuery Cycle2 or WOW: jQuery Slider without coding: jQuery Slideshow

    A Google search will reveal others...

    Nancy O.

  • Place an asset from a library

    I used to put a little more time trying to find the answer on my own, but I am under a lack of light time.

    Does anyone know how to place an asset from a library to an exact position?

    Thank you!

    Just move it in place after you place it.

    See this thread: How to position an asset from the library on the document?

  • How to move the FILE from one place to another and keep "Indexing" have to move to the unknown location so you can't discover its full file path? Windows instructions provide information wrong re: how to do this!

    Make a bunch of audio files, placed in a folder on my desktop. Files initially sent to RealPlayer to burn, but when finished burning CD and went to read a CD, folder got seized by Media Player, 'Indexed' and disappeared from the office. I'm a relatively new computer user, and I need to learn more about file paths, how to view the path FULL of a file on my computer and how to type (create) full path when I need to. The "Indexing" feature seems to erase this lesson for me, and after having spent four hours trying to find Vista instructions on "How to move the file from one place to another", I gave up! Windows 'Help and Support' on my computer gives wrong directions. It states that if I right click on a folder > properties, a dialog box opens with a tab by which I can move my account. There is no tab location here. I found locations tab when right click on the "Mobile" folder, but still no option to "move file". No idea what is the folder "Roaming" or why it's on my computer. I want my audio files in the My Music folder, but this place is "access denied." Don't know how to get the audio file it in any case, but if anyone has any advice, I would be very happy! Thank you. PS - I had no problem moving folders in XP. I don't like the idea that a computer is to decide where to put my files. I want to control where I put my files. I don't like the way search works under Vista. I liked the XP search companion better because, for a computer fool like me, it was really easy to organize and find files and folders and had an option specific to find audio and video file TYPES.

    Here is an article on how to move your personal folders in Vista: http://www.howtogeek.com/howto/windows-vista/moving-your-personal-data-folders-in-windows-vista-the-easy-way/.  If you're talking about the special folders (such as photos, Documents, office...), then here is an article on how to move: http://www.winhelponline.com/articles/95/1/How-to-move-the-special-folders-in-Windows-Vista.html.

    If you have trouble with the search after you move the files, then rebuild the index: http://www.tech-recipes.com/rx/2103/vista_rebuilding_the_search_index/.  Here is an article on how to use Indexing Options in Vista that may be useful for you: http://www.vistax64.com/tutorials/69581-indexing-options.html.

    If the above does not help, your problem seems to relate to the image of the files/folders and their interactions with Media Center (which operate on different other folders).  Please repost your question in images and video Forum at: http://social.answers.microsoft.com/Forums/en-US/vistapictures/threads where the people who specialize in issues of the image will be more than happy to help you with your quesitons.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How good my trigger &amp; Create Sequence are written review my excerpt from PL/SQL

    I have a CustomerHistory table.

    Here's a sequence I created for the table:
    CREATE SEQUENCE customerhistory_id_seq
    START WITH 90
    INCREMENT BY 10
    MAXVALUE 90000
    NOCYCLE
    NOCACHE;
    I created a trigger example the primary key of the history table:

    CREATE OR REPLACE TRIGGER cushistory_bef_insert
    BEFORE INSERT ON CustomerHistory
    FOR EACH ROW
    BEGIN
          SELECT customerhistory_id_seq.NEXTVAL INTO :NEW.CustomerHistoryID
          FROM DUAL;
    END;
    /
    After each update, or delete, insert the old record in the history table:
    CREATE OR REPLACE TRIGGER cushistory_aft_upddel
    AFTER UPDATE OR DELETE ON CUSTOMER
    FOR EACH ROW
    BEGIN
          IF UPDATING THEN
                INSERT INTO CustomerHistory
                         *
                (
                     SELECT
                             :OLD.c.customerID,
                             :OLD.c.firstname,
                           :OLD.c.lastname,
                           :OLD.c.email,
                             .
                             .
                             .
                             :OLD.mr.roomtype,
                             .
                             .
                             .
                             :OLD.b.checkout,
                             'UPDATE',
                             SYSDATE
                   FROM Customer c JOIN CustomerFamilyMember cf ON c.customerID = cf.customerID
                         JOIN Phone p ON c.customerID = p.customerID
                         JOIN ThirdParty t ON c.thirdpartyid = t.thirdpartyID
                         JOIN BookedRoom b ON c.customerID = b.CustomerID
                         JOIN MotelRoom mr ON b.roomID = mr.roomID
                         JOIN Motel m ON mr.motelID = m.motelID
              );
         
          ELSIF DELETING THEN
          
                INSERT INTO CustomerHistory
                         *
                (
                     SELECT
                             :OLD.c.customerID,
                             :OLD.c.firstname,
                           :OLD.c.lastname,
                           :OLD.c.email,
                             .
                             .
                             .
                             :OLD.mr.roomtype,
                             .
                             .
                             .
                             :OLD.b.checkout,
                             'DELETE',
                             SYSDATE
                   FROM Customer c JOIN CustomerFamilyMember cf ON c.customerID = cf.customerID
                         JOIN Phone p ON c.customerID = p.customerID
                         JOIN ThirdParty t ON c.thirdpartyid = t.thirdpartyID
                         JOIN BookedRoom b ON c.customerID = b.CustomerID
                         JOIN MotelRoom mr ON b.roomID = mr.roomID
                         JOIN Motel m ON mr.motelID = m.motelID
              );
         
          END IF;
    END;
    /
    1 are structured correctly 3 pl/sql code snippets?
    2. in the last example, which is an alternative using the JOIN? If know join 5 tables is not a good
    long term solution. Any idea?

    Hello

    Here are the bugs I find in your code.
    Please view the description of test table and features for more information.

    1 cushistory_aft_upddel is a level trigger line on client.
    Querying the table inside the trigger would give the error table mutation.

    ERROR at line 1:
    ORA-04091: table XXXXX.CUSTOMER is mutating, trigger/function may not see it
    ORA-06512: at "XXXXX.TEST_TRG", line 2
    ORA-04088: error during execution of trigger 'XXXXX.TEST_TRG'
    

    The only way you can acccess them using: old.col_name and: new.col_name.

    2 table the customer is the only updated and so the new and the old mke sense only for the customer table. the old.b.col_name and old. XXX.col_name for all other tables mean nothing and will result in error;

    Here is an excerpt of small test with tahe customer table and another table called check_in. You can extend the same thing for your problem.

    sql> create table customer(
      2    cust_id number,
      3    cust_name varchar2(20));
    
    Table created.
    
    sql> create table check_in(
      2    cust_id number,
      3    check_in date,
      4    check_out date
      5  );
    
    Table created.
    
    sql> create table cust_history(
      2    cust_id number,
      3    cust_name varchar2(20),
      4    check_in  date,
      5    check_out date);
    
    sql> insert into customer values (100, 'Rajesh');
    
    1 row created.
    
    sql> insert into customer values (200, 'kumar');
    
    1 row created.
    
    sql> insert into check_in values (100, sysdate-2, null);
    
    1 row created.
    
    sql> insert into check_in values (200, sysdate-3, null);
    
    1 row created.
    
    sql> commit;
    
    Commit complete.
    
     create or replace trigger test_trg
     after update on customer for each row
     begin
       insert into cust_history
       select :old.cust_id,
              :old.cust_name,
              ci.check_in,
              ci.check_out
         from check_in ci
         where ci.cust_id = :old.cust_id;
     end;
     /
    
    sql> select * from customer;
    
       CUST_ID CUST_NAME
    ---------- --------------------
           100 Rajesh
           200 kumar
    
    sql> select * from check_in;
    
       CUST_ID CHECK_IN  CHECK_OUT
    ---------- --------- ---------
           100 25-DEC-09
           200 24-DEC-09
    
    sql> select * from cust_history;
    
    no rows selected
    
    sql> update customer set cust_name = 'Rajesh2' where cust_id = 100;
    
    1 row updated.
    
    sql> commit;
    
    Commit complete.
    
    sql> select * from customer;
    
       CUST_ID CUST_NAME
    ---------- --------------------
           100 Rajesh2
           200 kumar
    
    sql> select * from cust_history;
    
       CUST_ID CUST_NAME            CHECK_IN  CHECK_OUT
    ---------- -------------------- --------- ---------
           100 Rajesh               25-DEC-09
    

    You can use the other tables to select as I used the check_in above. You don't need to access the customer table that you have values in the: old. and: new. variables for them.

    Thank you
    Rajesh.

    Published by: Rajesh Chamarthi on December 26, 2009 21:30 added example.

  • How can I copy files from project Waveburner to another internal drive?

    How can I copy files from project Waveburner to another internal drive without losing the connection to the files audio orig.?

    Thank you for your time,

    Since no one answered my call, I sat and researched and studied WaveBurner behavior and I can myself answer my question and solve. Since there were a lot of people asking similar questions on WaveBurner files I will post what I learned.

    Whenever you drop your audio files in the list window to make your WaveBurner CD copy not copy your audio files, but relies on the original audio file, where they are located. So whenever you move the files orig. and you open WaveBurner, it can't find those and displays an error window to suggest it will search for the missing file or if you know where he is now lets you find manually. WaveBurner usually place the .wb3 project file that contains everything including your home folder.

    For this reason, I reserve now an audio file WaveBurner also folder in my home folder. In order to save themselves from WaveBurner cannot find the audio file, all audio files that I do, I put in my folder of audio files WaveBurner first, then copy them in WaveBurner from there.

    When I need to use a bigger hard drive I copy .wb3-WaveBurner projects based, but also my

    Sound folder WaveBurner for the home folder on the new hard drive.

    WaveBurner is now all audio files without problem.

    I hope that this will be a unique problem to someone else. Happy WaveBurning.

    W.W.

  • How better to import everything from WaveBurner a reader to one empty WaveBurner on another drive?

    I have a large amount of CD I put together in WaveBurner on an internal drive which is full. I know there is an import button to import audio files.

    But I want not just audio files, but all projects, so I can still work on them.

    How better to import everything from WaveBurner a reader to one empty WaveBurner on another drive?

    I thank very you much for your time and patience.

    Since no one answered my call, I sat and researched and studied WaveBurner behavior and I can myself answer my question and solve. Since there were a lot of people asking similar questions on WaveBurner files I will post what I learned.

    Whenever you drop your audio files in the list window to make your WaveBurner CD copy not copy your audio files, but relies on the original audio file, where they are located. So whenever you move the files orig. and you open WaveBurner, it can't find those and displays an error window to suggest it will search for the missing file or if you know where he is now lets you find manually. WaveBurner usually place the .wb3 project file that contains everything including your home folder.

    For this reason, I reserve now an audio file WaveBurner also folder in my home folder. In order to save themselves from WaveBurner cannot find the audio file, all audio files that I do, I put in my folder of audio files WaveBurner first, then copy them in WaveBurner from there.

    When I need to use a bigger hard drive I copy .wb3-WaveBurner projects based, but also my

    Sound folder WaveBurner for the home folder on the new hard drive.

    WaveBurner is now all audio files without problem.

    I hope that this will be a unique problem to someone else. Happy WaveBurning.

    W.W.

  • How can I move notes from one folder to another?

    I thought that some of my notes were missing, but it seems that some are stored in icloud and the other in different files associated with my personal email address.  How can I make sure that they are all on the icloud (in case I lose my phone, when I update my phone, etc.)?  How can I move them from one folder to another?  I not create separate records in the first place. I guess it happened when I updated to the current IOS.  Thanks for your help!

    Slide left on each note you want to move to your iCloud folder. Move and delete option is available. The rest is simple.

  • How do I transfer songs from my smart phone to my computer?

    ORIoriginal title: transfer music

    How do I transfer songs from my smart phone to my computer?

    Hello

    1. what operating system is installed on the computer?

    2. What is the brand and model of the smart phone?

    Most of the phones will appear as a "disk" on your computer, and you can browse the files on them by simply opening them.

    If you can do this, you should be able to copy / delete / move files between the phone and the computer.

    See the following steps:

    (a) create a folder (right click on the desktop, go again and click folder) on the desktop.

    (b) to install the latest version of the software or driver on the computer so that the smart phone.

    (c) connect the phone to the computer.

    (d) open the 'work' in the start menu. Your computer will automatically detect the cell phone. Double click the cell phone icon in the opened window.

    (e) right click on the music file or files that you want to place the phone.

    Note: To select multiple files, hold down the CTRL key while you click the files you want to transfer from the mobile phone.

    (f) select 'Copy' from the menu that appears when you right click on the highlighted files.

    (g) click in the folder window open.

    (h) right click in the middle of the window and select "Paste".

    Note: This starts automatically transfer the files on your computer.

Maybe you are looking for