Two variables in the name of a table in the FROM clause.

Hello,
I ve got a problem making this work:
SELECT *
FROM tablename_YY_MM
(This is part of the script I need to use YY and MM in various tables)
I need to find a way so the script will ask me every time about the YY and MM
For example the current table name is "tablename_09_08" next month it will be "tablename_09_09"
It looks simple but I can't make it work. It seems to be a problem with concatanation || and the underscore _
Looks like it should be done with PL/SQL ?
If anyone can help it will be much appreciated.
Thank you.
Edited by: user1067236 on Aug 11, 2009 2:21 AM
Edited by: user1067236 on Aug 11, 2009 2:23 AM

Hi,
That's easy to do using substitution variables in SQL*Plus:
SELECT  *
FROM    tablename_&year_num._&month_num;Note the . after &year_num; it is necessary to indicate that the next _ is not part of the preceding name.
You can also use the SQL*Plus ACCEPT command to prompt the user for values, with a detailed message.
ACCEPT  year_num  PROMPT "Please enter year number (2 digits only, such as 09): "Edited by: Frank Kulash on Aug 11, 2009 5:29 AM

Similar Messages

  • How to find out the name of a table?

    Hi
    How can I find out the name of a table which doesn't have a record history?
    Regards
    Rahman

    No direct way to know the tables. What you will find on the ABout this page link are the View Object (similar to record sets), Entity objects, controller and Application module. Generally EO is based on a table or the VO can be based on the query which you can find the corresponding xml file. But a button action might be calling a method in AM or CO which in turn call some wrapper method to interact with database. So nothing straight forward. You will have to analyze the all page related code objects.
    They are specific to OA framework and if you are not aware about them, better go through the initial chapters of OAF dev guide.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Passing the name of a table to a procedure

    Can anyone tell me how you can pass the name of a table to a procedure ?
    I am trying to write a generic procedure that will have the table name and the fieldname passed to it :-
    as in :-
    Select Fieldname FROM Tablename;
    null

    Refere to the documentation of
    built in package dbms_sql.

  • Obtaining the name of a table from it's data

    Hello,
    i have a strange need ... i would like to obtain the name of a table from it 's data !!!!
    Thank's in advance.

    ALTER TABLE t
    ADD (table_name VARCHAR2(30));
    then
    SELECT table_name FROM T;Though, as Martin said, I don't know how you get the data if you don't know the name of the table.

  • Get the names of all tables

    First I want to tell you: I'm a amateur concerning Java Programming.
    My task is to write a java program - using JCO -, which retrieves the names of all tables (a user can access).
    Can anybody help me, please?

    Hi Michael,
    i can't help you because i don't know anything about JCO!
    It's simply funny and i'm happy to see a "known face" here!
    Perhaps this will help you:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/tips and tricks for sap java connector client programming.pdf
    And don't be so decent...you're not so bad in Java at all
    Greetings
    Florian

  • Who can give me all the name of system table or organization table in sap?

    Who can give me all the name of system table or organization table in sap? such as the table stores the client,company code ,plant,transaction code ,sap menu,purchase organization along with the relation between organizations such as
    the relation between company code and plant, the relation between company and purchase organization and so on.Pls supply the list of table name or the url where I can see these information.
    Thank you in advance.

    Hi YuLin
    refer this link you will get all tables in SAP with description and relation.
    http://www.erpgenie.com/abap/tables.htm
    regards
    Yogesh

  • The wifi has been lost or disconnected on my iPad. It's the iPad 2 and has not been updated yet. It's IOS 6.1.3 .. how do I add a network back onto it? I have typed in the name and chosen each of the securities and still hasn't connected!

    The wifi has been lost or disconnected on my iPad. It's the iPad 2 and has not been updated yet. It's IOS 6.1.3 .. how do I add a network back onto it? I have typed in the name and chosen each of the securities and still hasn't connected!

    Hey there Luba_kalstad,
    It sounds like you are unable to join your network and cannot see it in the Wi-Fi list in Settings. I would try the troubleshooting outlined in this article named:
    iOS: Troubleshooting Wi-Fi networks and connections
    http://support.apple.com/kb/ts1398
    Be sure you're in range of your Wi-Fi router (access point).
    Tap Settings > Wi-Fi and turn Wi-Fi off and on. If your Wi-Fi setting is dimmed, follow these steps.
    Confirm that your Wi-Fi router and cable or DSL modem are connected to power, turned on, and connected to the Internet. If not, refer to your network administrator or Internet service provider (ISP) for assistance.
    Restart your iOS device.
    Tap Settings > Wi-Fi and locate the Wi-Fi network to which you're connected.
    Tap and Forget this Network.
    Try to connect to your desired Wi-Fi network.
    Note: You may need to enter your Wi-Fi password again if your network requires one.
    Turn your Wi-Fi router off and on2. If your ISP also provides cable or phone service, check with them before attempting this step to avoid interruption of service.
    Update your device to the latest version of software.
    Update your Wi-Fi router to the latest firmware2. For AirPort Base Stations, install updates using the AirPort Utility.
    And this section down toward the bottom if needed:
    Unable to locate a Wi-Fi network
    Verify that the network is available by tapping Settings > Wi-Fi and choosing from the available networks.Note: It may take a few seconds for the Wi-Fi network name to appear.
    Move closer to your wireless router (access point) and attempt to locate the Wi-Fi network.
    If you do not see the network you would like to join, you may be attempting to connect to a hidden network. Learn how to join a hidden network.
    Supported Wi-Fi configurations vary by iOS device model. Find out which standards your device supports3.
    Reset network settings by tapping Settings > General > Reset > Reset Network Settings. Note: This will reset all network settings including:
    previously connected Wi-Fi networks and passwords
    recently used Bluetooth accessories
    VPN and APN settings
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • I name each photo buy replacing the jpeg number with the name. when I burn to disk and open disk the name is not shown. how do I get the name given to show on the burn disk?.

    after I burn the files to dvd and load to view the name does not appear. How do I get the name listed to appear on the burn disk instead of the file number?

    Naming the Photo - or giving it a title - is not the same as naming  file.
    How are you burning to dvd? With iPhoto? If so then the Title will be available in any app that understands basic metadata.
    If you want the title available in the Finder - which does not understand photo metadata  - then you'll need to export the file
    File -> Export
    In the resulting dialogue you'll see a heading for 'File Name'. Choose 'Use Title' from the drop down.
    Regards
    TD

  • HT2513 How do you change the name of a reminder in the reminder list.  I right click and then choose "get information"  I can change the colour of the reminder but when I type in the name that I want and then press enter the name stays as "untitled".

    How do you change the name of a reminder in the reminder list.  I right click and then choose "get information"  I can change the colour of the reminder but when I type in the name that I want and then press enter the name stays as "untitled"

    Jerry,
    Thanks for replying again. I've got a little bit further thanks to you. I tried the US keyboard layout as you seemed pretty definte that it should work. This time I applied the setting and also started the language toolbar and selected it from there.
    Hey presto, I've got the @ where it should be. Excellent.
    However the single quote ' works in a weird way. When I press it, it doesn't show up on the screen. But when I press another key, I get the single quote plus the next key I press. When I press the single quote twice, I get 2 of them. This is also the same with the SHIFT ' key. i.e. for the double quotes.
    Very strange. I'll look at other keyboards and see where that gets me.
    Thanks,  Maz

  • A process by the name of avgcmgr is loading the CPUs by up to 100 percent. At least 5 of them have appeared on the activity monitor. I've removed them with forced quit but they return! How do I permanently get rid of them? CPUA temp is now 194F.

    A process by the name of avgcmgr is loading the CPUs by up to 100 percent. At least 5 of them have appeared on the activity monitor. I've removed them with forced quit but they return! How do I permanently get rid of them? Three of these processes has now driven the CPUA temp to 194F.
    Ray

    Hi Ray-
    I'm having the exact same problem and have searched the web for hours looking for a solution (multiple spawned avgcmgr processes that consume cpu).
    Did you find any solution?
    Thanks so much!
    Steve

  • How can I change the name of a PDF in the bookcase

    How can I change the name of a PDF in the bookcase

    Hi,
    It is possible to edit the dictionary, but not recommended.
    It is recommended to use exp/imp to "rename" a schema
    HTH
    Laurent

  • How do I change the name of my iTouch?   The one visible when you sync in iTunes

    How do I change the name of my iTouch ?   The one visible when you sync the device in iTunes, same as for iPhones, etc

    I just discovered the answer  (first time trying to search the Q&A)    It works - thanks anyway    https://discussions.apple.com/message/10839258#10839258

  • How do you change the name of a PDF in the iPad app?

    How do you change the name of a PDF in the iPad app?

    In the file browser view, navigate to Help > Handbook > Copy, edit, delete, manage.
    Please take a look at a section titled "Renaming files".
    Hopefully, the Help > Handbook and What's New are informative for you to get started on Reader for iOS.  If not, let us know what's missing.

  • Newbie ques : How to get the list of all tables in the database

    Hi,
    I'm very new to Oracle (using Oracle8i currently). I wanted to know if there is a way to get the list of all tables in the database. Like in mySQL you can use the command " show tables" to get the list of all the tables.
    Any help will e greatly appreciated. Please "cc" any reply to [email protected] also.
    thanks
    Deven

    Hi
    Select table_name, owner from all_tables;
    will give u all the tables in the database.
    all_tables, dba_tables, user_tables
    all_objects, dba_objects, dba_objects
    there are many, more tables. login as system and query the tab and try to describe the tables.
    Thanks
    Malar

  • When I try to convert my .pdf to Word, I get a sidebar that has fields for: the name of my pdf file, the type of file I want to convert to (In my case, Word), and a button that says "Convert".  My problem is that the "convert to" field isn't active.  I ca

    When I try to convert my .pdf to Word, I get a sidebar that has fields for: the name of my pdf file, the type of file I want to convert to (In my case, Word), and a button that says "Convert".  My problem is that the "convert to" field isn't active.  I can see the words "Microsoft Word" in pale gray, but when I click on the field, nothing happens.

    You have posted in the wrong forum.  Try posting in the forum for the product you are trying to use.
    Here is a link to a page that has links to all Adobe forums... use the drop down list to see all.
    Forum links page:
    https://forums.adobe.com/welcome

Maybe you are looking for

  • How to import a class from a package at the same level

    Hello friends, i have a class as Plaf.java as package org.vaibhav.swing.plaf; import java.awt.*; import javax.swing.*; public class Plaf { other code }as you see, this is in org.vaibhav.swing.plaf package. I have one more class as package org.vaibhav

  • External Table which can handle appending multiple csv files dynamic

    I need an external table which can handle appending multiple csv files' values. But the problem I am having is : the number of csv files are not fixed. I can have between 2 to 6-7 files with the suffix as current_date. Lets say it will be like my_fil

  • Pin it button not working on all pages!

    I have created a personal website using muse, its been published but not pushed live yet, but only three of the buttons works when you hit the pin button on three pages and the others don't work. I have tried this on safari, chrome and firefox. This

  • Why is Firefox now wiping my profile with each update?

    When I upgraded to Firefox 30.0, all of my data was wiped: history, add-ons, bookmarks etc. It's not just that Firefox is using a different profile - my Profiles folder had nothing in it. Exactly the same thing has now happened in upgrading to 31.0.

  • IPhone Apps with advertisement in update

    I'm finding that some iPhone Apps add advertising with "updates." Today I updated one of my favorite games -- iMahjong, only to find it now has a persistent advertisement at the top of the playing screen. A couple of weeks ago I updated ScoreMobile -