How to connect as different user in SQL Plus Worksheet in SQL Developer

This is driving me nuts! I have a script with different "CONNECT" commands to different schemas. What is the right synatx when using SQL Worksheet in SQL Developer when connecting to a different user? Greatly appreciate help on this. Thanks!

Which version of SQL Developer are you using? What syntax are you using?
Using SQL Developer 2.1.0.63.73, running selected statements as a script, I could get connect to work fine with the following examples:
connect
select user, global_name from global_name;
connect;
select user, global_name from global_name;
connect user/password@tnsalias
select user, global_name from global_name;
connect user/password@tnsalias;
select user, global_name from global_name;Unfortunately, even though the connect on it's own prompts for user, password and tns alias (and says a blank tns alias is the current connection), the following don't work:
connect user/password
select user, global_name from global_name;
connect user/password;
select user, global_name from global_name;Also note that the connection performed by this only exists while the script is being executed - only the script stops/ends the connection is disconnected.
theFurryOne

Similar Messages

  • How to see the content of stored prodecure in sql plus worksheet or sql.plu

    Hi
    i want to see the content of the stored procedure on sql worksheet or sql plus. is there any command for this ?
    please let me know
    thanks

    Hi Anil:
    Following is for SQL*Plus
    If you are logged on to the schema that owns the stored procedure you can issue the following query:
    select text from user_source where name = 'MY_PROG_NAME'
    ORDER BY TYPE, LINE ASC;
    Where MY_PROG_NAME could be the name of a package, procedure or function. Note that when you look at a package source you'll get the specfification and the body listing, in that case you may want to split them into two with following queries:
    spool MY_PROG_NAME.spec
    select text from user_source
    where name = 'MY_PROG_NAME'
    AND TYPE = 'PACKAGE'
    ORDER BY TYPE, LINE ASC;
    SPOOL OFF
    spool MY_PROG_NAME.body
    select text from user_source
    where name = 'MY_PROG_NAME'
    AND TYPE = 'PACKAGE BODY'
    ORDER BY TYPE, LINE ASC;
    SPOOL OFF
    If you are logged on as SYSTEm, you can substitute USER with DBA and look at code for all schemas, however you may need to add OWNER to your query.
    DESC USER_SOURCE
    Name Null? Type
    NAME NOT NULL VARCHAR2(30)
    TYPE VARCHAR2(12)
    LINE NOT NULL NUMBER
    TEXT VARCHAR2(2000)
    DESC DBA_SOURCE
    Name Null? Type
    OWNER NOT NULL VARCHAR2(30)
    NAME NOT NULL VARCHAR2(30)
    TYPE VARCHAR2(12)
    LINE NOT NULL NUMBER
    TEXT VARCHAR2(2000)
    Hope this helps,
    Thomas

  • SQL Plus Worksheet OR SQL Worksheet

    Hello Everybody,
    i have a problem. I need the SQL Worksheet, can anybody tell me, where can i find the SQL Worksheet as freeware version. Do anybody know the URL?
    Pls help me!
    Send me the URL to: [email protected]
    Kind Regards
    Ilyas

    Hello Krystian,
    thanks for the quick answer!
    What do you mean with database clients download?
    I dont found the SQL Worksheet....

  • How to connect to different data sources in  XI 3.1 UNIVERSE?

    hi experts,
    We are going to migrate from BO 6.5 to  BO XI3.1.
    and we have different data sources to extract and generate the reports using various tools like Webi,Crystal Reports, Deski etc.
    1         How to connect to different data sources like SAP BI query, DB2, Oracle etc,, provide me the step by step solution.
    2     We need to migrate the universes and reports from BO 6.5 to BO XI 3.1 using the Report Conversion Tool.
    can we directly convert from the deski reports to Webi or do we need to migrate first through Import Wizard?
    3    Scheduling the Reports through Infoview
    4    Various issues and how to resolve those issues, we generally face while scheduling, and while creating the queries like for example time out errors etc..
    5    BO Security
    6    Universe creation with best practices and the loops,contexts,aliases etc..
    please provide me the step by step solution documents and links.
    thans in advance
    venuscm

    I would recommend to take a look at the official documentation. YOu can find this here
    http://help.sap.com
    NAvugate to SAP BusinessObjects->All products and the select the product you want eg. BusinessObjects ENterprise or Universe designer and the appropriate version XI 3.1. Take a look at the admin and the user guides.
    Currently the Data FEderator will allow you to buid a universe that access data from various data sources. Another option is to merge queries from different universes at report level.
    Regards,
    Stratos

  • HOW to connect to a user in the postgresql

    Hi,
    Can any one please help me how to connect to a postgresql and information on postgresql
    Than & Regards
    Poorna Prasad

    Not sure about the help but fail to understand though why would one ask about Postgresql over Oracle's forums?
    http://www.google.co.in/search?q=HOW+to+connect+to+a+user+in+the+postgresql++&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
    HTH
    Aman....

  • How to invoke multiple sessions of sql*plus thru pl/sql program

    Hi
    How to invoke multiple sessions of sql*plus thru pl/sql program.
    Thanks

    How to invoke sql*plus in a procedure?????
    I have to invoke more pl/sql sessions?????No you don't "have to".
    Look at what you are trying to do.
    You have a program running inside the PL/SQL engine. This is running nicely inside the Oracle database and is perfectly capable of issuing other SQL statements, PL/SQL programs etc. inside it's nice cosy Oracle environment.
    You are asking for this PL/SQL to shell out to the operating system, run an external application, for which it will have to supply a username and password (are you planning on hard coding those into your PL/SQL?), and then that external application is supposed to run more SQL or PL/SQL against the database.
    a) Why hold all this code external to the database when it can quite happily reside on the database itself and be executed through jobs or whatever.
    b) Consider what would happen if someone were to replace the external application with their own program of the same file name... they'd be able to capture the username and password for connecting to the database, therefore a major security flaw.
    The whole idea of doing what you want through external calls to SQL*Plus is ridiculous.

  • Connection Via SQL*Plus Worksheet

    Dear Friends,
    I have a peculiar problem. I am connecting via 9i client to a oracle 8i server.
    I could manage to access the database via 9i client's EM and SQL scratch pad. But I am unable to connect via SQL*plus worksheet.
    I got this error
    ERROR:
    ORA-12154: TNS:could not resolve service name
    While I test the service name via Oracle Net manager, it is successful.
    Anybody could shed some light.
    Regards
    Kumar

    Enterprise Manager still has SQL*Plus Worksheet. See:
    http://download-west.oracle.com/docs/cd/B10501_01/em.920/a96670/ch_alone.htm#1015179
    -- CJ

  • SQL*Plus Worksheet DEFINE command

    **I hope this is the correct place to put this, I don't see a forum for SQL*Plus Worksheet.**
    I am having some trouble with SQL*Plus Worksheet. The following call to a package works fine,
    EXECUTE package_name.procedure_name ('string_name');where it is required that my argument passed to the procedure needs the quotes as part of the string. However, when I try to use a variable instead of hardcoding the 'string_name' value, ie
    DEFINE string_name = 'string_name';
    EXECUTE package_name.procedure_name (&string_name);I get an error message saying that my variable needs to be defined (the call was made passing the string w/o the quotes). How can I pass the entire string, quotes and all, to the package call? I've tried concatenating them to the variable in the DEFINE and EXECUTE commands but I can't seem to come up with the correct syntax.
    Does anybody know how to do this?

    Here is the current SQL*Plus Worksheet command, and output (works):
    EXECUTE amanda.role_executor.drop_role ('read_only');
    PL/SQL procedure successfully completed.So, now I try to pass the argument as a variable, instead of hardcoding the value to the call:
    DEFINE role_name = 'read_only';
    EXECUTE amanda.role_executor.drop_role (&read_only);
    BEGIN amanda.role_executor.drop_role (read_only); END;
    ERROR at line 1:
    ORA-06550: line 1, column 39:
    PLS-00201: identifier 'READ_ONLY' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredAs you can see when I try to pass the string as a variable the single quotes get lost. How can I concatenate the single quotes to the string? I've tried everything I can think of but apparently Worksheet doesn't like the || symbols.

  • SQL*PLUS Worksheet Width

    I'm (bery) new to Oracle. I'm trying to figure out how to make the output results of a select statement in SQL*Plus Worksheet not wrap. Is there a way to do this?
    Thank you
    JohnD

    hi friends,
    I have used SET LINESIZE 1000 to increase width and display all column details in a row.
    But now it is not scrolling till the last column details displayed on screen.Suppose there are 12 columns in my table and i could see only 8 which are displayed on my screen.
    How can i scroll to right till the last column?
    Thank you,
    Regards,
    Raghv

  • Giving parameter to spreport.sql in Sql plus worksheet

    can any one please tell me how can we give value for the begining snap and ending snap to spreport in sql plus worksheet
    best regards
    asif

    define begin_snap=10
    define end_snap=66
    @ C:\oracle\ora92\rdbms\admin\spreport.sql
    Best Regards
    Krystian Zieja / mob

  • SQL*Plus Worksheet SuSE 8.2

    I'am unable to login over SQL*Plus worksheet (Oracle 9.0.1) under SuSE 8.2. I get error messages "SQL*Plus worksheet exited" or "write error". oemapp dbastudio is working properly.

    I have the exact same problem. Have you had any luck yet? Did you apply any kernel parameter changes/tuning yet? How much physical memory do you have on you oralce box? I have 128M. Please let me know if you solve this one.
    Thanks,
    Doug
    [email protected]

  • Using variables in SQL Plus Worksheet

    I'm new to Oracle. I've developed in MS SQL for some time. I'm trying to debug a query we're using in an application. I paste it into SQL Plus Worksheet and get the message:
    SP2-0552: Bind variable "COUNTYPK" not declared.
    I could paste in a value, but I would like to define a variable before the query so that it will work the same way as it would in production.
    SELECT rsiplate.OWNER.work_area_code || '-' || SUBSTR(rsiplate.OWNER.work_phone_number, 1, 3) || '-' || SUBSTR(rsiplate.OWNER.work_phone_number, 4, 4) AS BUSINESSPHONE, trim(rsiplate.OWNER.first_name||' '||rsiplate.OWNER.middle_name||' '||rsiplate.OWNER.last_name) AS BUSINESSNAME, rsiplate.ADDRESS.address_line1 AS ADDRESSLINE1, rsiplate.ADDRESS.address_line2 AS ADDRESSLINE2, rsiplate.ADDRESS.city_name AS CITY, rsiplate.ADDRESS.state_code AS STATE, SUBSTR(rsiplate.ADDRESS.zip_code, 1, 5) AS POSTALCODE FROM rsiplate.WATERCRAFT_MASTER, rsiplate.WATERCRAFT_CURRENT, rsiplate.WATERCRAFT_REGIST_CURRENT, rsiplate.OWNER, rsiplate.WATERCRAFT_OWNER_CURRENT, rsiplate.ADDRESS WHERE rsiplate.WATERCRAFT_MASTER.WATERCRAFT_ID = rsiplate.WATERCRAFT_CURRENT.WATERCRAFT_ID AND rsiplate.WATERCRAFT_MASTER.LF_WATERCRAFT_REGIST_ORDER = rsiplate.WATERCRAFT_REGIST_CURRENT.WATERCRAFT_REGIST_ORDER AND rsiplate.WATERCRAFT_MASTER.LF_WATERCRAFT_ORDER = rsiplate.WATERCRAFT_CURRENT.WATERCRAFT_ORDER AND rsiplate.WATERCRAFT_MASTER.watercraft_id = rsiplate.WATERCRAFT_REGIST_CURRENT.watercraft_id and rsiplate.WATERCRAFT_MASTER.watercraft_id = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_id and rsiplate.WATERCRAFT_OWNER_CURRENT.owner_id = rsiplate.OWNER.owner_id and rsiplate.WATERCRAFT_MASTER.watercraft_owner_group = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_group and rsiplate.ADDRESS.address_set_id = rsiplate.OWNER.address_set_id and rsiplate.WATERCRAFT_MASTER.data_status_code = 1 and rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_order = 1 and rsiplate.WATERCRAFT_REGIST_CURRENT.REGIST_EXPIRATION_DATE >= SYSDATE AND rsiplate.WATERCRAFT_CURRENT.WATERCRAFT_USE_CODE = 3 AND rsiplate.ADDRESS.COUNTY_NUMBER = :CountyPK GROUP BY rsiplate.OWNER.work_area_code, rsiplate.OWNER.work_phone_number, rsiplate.OWNER.first_name, rsiplate.OWNER.middle_name, rsiplate.OWNER.last_name, rsiplate.ADDRESS.address_line1, rsiplate.ADDRESS.address_line2, rsiplate.ADDRESS.city_name, rsiplate.ADDRESS.state_code, rsiplate.ADDRESS.zip_code;

    Okay, I made some adjustements:
    SET DEFINE :
    DEFINE :COUNTYPK = '01'
    SELECT rsiplate.OWNER.work_area_code||'-'||SUBSTR(rsiplate.OWNER.work_phone_number, 1, 3)||'-'||SUBSTR(rsiplate.OWNER.work_phone_number, 4, 4) AS BUSINESSPHONE, trim(rsiplate.OWNER.first_name||' '||rsiplate.OWNER.middle_name||' '||rsiplate.OWNER.last_name) AS BUSINESSNAME, rsiplate.ADDRESS.address_line1 AS ADDRESSLINE1, rsiplate.ADDRESS.address_line2 AS ADDRESSLINE2, rsiplate.ADDRESS.city_name AS CITY, rsiplate.ADDRESS.state_code AS STATE, SUBSTR(rsiplate.ADDRESS.zip_code, 1, 5) AS POSTALCODE FROM rsiplate.WATERCRAFT_MASTER, rsiplate.WATERCRAFT_CURRENT, rsiplate.WATERCRAFT_REGIST_CURRENT, rsiplate.OWNER, rsiplate.WATERCRAFT_OWNER_CURRENT, rsiplate.ADDRESS WHERE rsiplate.WATERCRAFT_MASTER.WATERCRAFT_ID = rsiplate.WATERCRAFT_CURRENT.WATERCRAFT_ID AND rsiplate.WATERCRAFT_MASTER.LF_WATERCRAFT_REGIST_ORDER = rsiplate.WATERCRAFT_REGIST_CURRENT.WATERCRAFT_REGIST_ORDER AND rsiplate.WATERCRAFT_MASTER.LF_WATERCRAFT_ORDER = rsiplate.WATERCRAFT_CURRENT.WATERCRAFT_ORDER AND rsiplate.WATERCRAFT_MASTER.watercraft_id = rsiplate.WATERCRAFT_REGIST_CURRENT.watercraft_id and rsiplate.WATERCRAFT_MASTER.watercraft_id = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_id and rsiplate.WATERCRAFT_OWNER_CURRENT.owner_id = rsiplate.OWNER.owner_id and rsiplate.WATERCRAFT_MASTER.watercraft_owner_group = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_group and rsiplate.ADDRESS.address_set_id = rsiplate.OWNER.address_set_id and rsiplate.WATERCRAFT_MASTER.data_status_code = 1 and rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_order = 1 and rsiplate.WATERCRAFT_REGIST_CURRENT.REGIST_EXPIRATION_DATE >= SYSDATE AND rsiplate.WATERCRAFT_CURRENT.WATERCRAFT_USE_CODE = 3 AND rsiplate.ADDRESS.COUNTY_NUMBER = :CountyPK GROUP BY rsiplate.OWNER.work_area_code, rsiplate.OWNER.work_phone_number, rsiplate.OWNER.first_name, rsiplate.OWNER.middle_name, rsiplate.OWNER.last_name, rsiplate.ADDRESS.address_line1, rsiplate.ADDRESS.address_line2, rsiplate.ADDRESS.city_name, rsiplate.ADDRESS.state_code, rsiplate.ADDRESS.zip_code;
    But I still get this:
    SP2-0317: expected symbol name is missing
    old 2: iplate.WATERCRAFT_REGIST_CURRENT.watercraft_id and rsiplate.WATERCRAFT_MASTER.watercraft_id = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_id and rsiplate.WATERCRAFT_OWNER_CURRENT.owner_id = rsiplate.OWNER.owner_id and rsiplate.WATERCRAFT_MASTER.watercraft_owner_group = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_group and rsiplate.ADDRESS.address_set_id = rsiplate.OWNER.address_set_id and rsiplate.WATERCRAFT_MASTER.data_status_code = 1 and rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_order = 1 and rsiplate.WATERCRAFT_REGIST_CURRENT.REGIST_EXPIRATION_DATE >= SYSDATE AND rsiplate.WATERCRAFT_CURRENT.WATERCRAFT_USE_CODE = 3 AND rsiplate.ADDRESS.COUNTY_NUMBER = :CountyPK GROUP BY rsiplate.OWNER.work_area_code, rsiplate.OWNER.work_phone_number, rsiplate.OWNER.first_name, rsiplate.OWNER.middle_name, rsiplate.OWNER.last_name, rsiplate.ADDRESS.address_line1, rsiplate.ADDRESS.address_line2, rsiplate.ADDRESS.city_name, rsiplate.ADDRESS.state_code, rsiplate.ADDRESS.zip_code
    new 2: iplate.WATERCRAFT_REGIST_CURRENT.watercraft_id and rsiplate.WATERCRAFT_MASTER.watercraft_id = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_id and rsiplate.WATERCRAFT_OWNER_CURRENT.owner_id = rsiplate.OWNER.owner_id and rsiplate.WATERCRAFT_MASTER.watercraft_owner_group = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_group and rsiplate.ADDRESS.address_set_id = rsiplate.OWNER.address_set_id and rsiplate.WATERCRAFT_MASTER.data_status_code = 1 and rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_order = 1 and rsiplate.WATERCRAFT_REGIST_CURRENT.REGIST_EXPIRATION_DATE >= SYSDATE AND rsiplate.WATERCRAFT_CURRENT.WATERCRAFT_USE_CODE = 3 AND rsiplate.ADDRESS.COUNTY_NUMBER = 01 GROUP BY rsiplate.OWNER.work_area_code, rsiplate.OWNER.work_phone_number, rsiplate.OWNER.first_name, rsiplate.OWNER.middle_name, rsiplate.OWNER.last_name, rsiplate.ADDRESS.address_line1, rsiplate.ADDRESS.address_line2, rsiplate.ADDRESS.city_name, rsiplate.ADDRESS.state_code, rsiplate.ADDRESS.zip_code
    iplate.WATERCRAFT_REGIST_CURRENT.watercraft_id and rsiplate.WATERCRAFT_MASTER.watercraft_id = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_id and rsiplate.WATERCRAFT_OWNER_CURRENT.owner_id = rsiplate.OWNER.owner_id and rsiplate.WATERCRAFT_MASTER.watercraft_owner_group = rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_group and rsiplate.ADDRESS.address_set_id = rsiplate.OWNER.address_set_id and rsiplate.WATERCRAFT_MASTER.data_status_code = 1 and rsiplate.WATERCRAFT_OWNER_CURRENT.watercraft_owner_order = 1 and rsiplate.WATERCRAFT_REGIST_CURRENT.REGIST_EXPIRATION_DATE >= SYSDATE AND rsiplate.WATERCRAFT_CURRENT.WATERCRAFT_USE_CODE = 3 AND rsiplate.ADDRESS.COUNTY_NUMBER = 01 GROUP BY rsiplate.OWNER.work_area_code, rsiplate.OWNER.work_phone_number, rsiplate.OWNER.first_name, rsiplate.OWNER.middle_name, rsiplate.OWNER.last_name, rsiplate.ADDRESS.address_line1, rsiplate.ADDRESS.address_line2, rsiplate.ADDRESS.city_name, rsiplate.ADDRESS.state_code, rsiplate.ADDRESS.zip_code
    ERROR at line 2:
    ORA-00933: SQL command not properly ended

  • Is the SQL * Plus Worksheet included in the Oracle 10g Express Edition?

    Hello All,
    I need to install Oracle 10g for a SQL class that I will be taking this year. I will be installing it in my laptop (Pentium 4, 1GB RAM). I was told by the Professor that I needed to have the SQL*Plus Worksheet. I would like to know which version of Oracle do I need to install, and If it includes the SQL*Plus Worksheet.
    This is my first time working & installing Oracle, so I would appreciate if anyone could guide me thru this process.
    Thanks a lot,
    Ed

    No, it is not included.
    However, the same functionality, and more, is in Oracle SQL Developer - also available free and download-able from the same area as Oracle Express Edition.
    Ask your prof why he want Worksheet. If it's only for the ability to scroll and correct previous SQL (eg: easier time correcting mistakes), and loading scripts, ask if SQL Developer would be allowed. It's much superior and allows you to use XE, which will not sink your laptop like the EE version will.

  • SQL*Plus Worksheet formating

    I have Oracle Client 8.1.7 installed in my computer, and I can't
    seem to have the desired output format with the SQL*Plus
    worksheet.
    I have a database where the tables have several column, and most
    of these columns are text with 1024 characters length. I set the
    linesize to a huge number (say 3000), the trim and trimspool on,
    and I get the results ok.
    But, when I want to do a select from a table which is much
    smaller, the worksheet is always writing the complete linesize...
    Is there a way to display the columns according to the size they
    actually have (e.g. defined by the longest element) that is
    always valid. I mean without having to set column options for
    each table.
    Thank you in advance.
    Ana

    The column width sizing rules are a little opaque. The column size is a function of things like the width that the DB thinks the column is (could be huge if a SQL function is being selected), the column name or heading width, the linesize (for very wide columns), any global format (e.g. SET NUMWIDTH), or the explicit COLUMN FORMAT.
    For consistency and portability I'd always recommend using an explicit COLUMN FORMAT. You can never tell if someone is going to run your report after previously setting a COLUMN FORMAT of the same name. Or a new database version may come out where the default datatype of a SQL function has changed. In the past this has happened when CHARs became the longer VARCHAR2s.
    I don't think Enterprise Manager's SQL Worksheet (a simplistic interface that just calls SQL*Plus in the background) is doing anything special for formatting. So COLUMN FORMAT will work fine.
    -- CJ

  • SQL*Plus Worksheet in Personal Oracle 8.1.6

    Why does a select query in SQL*Plus Worksheet not return any results, but the same query in SQLPLUS or TOAD does?
    I am using the version that comes with Personal Oracle8i for NT (Oracle 8.1.6). Version of Enterprise Manager is 2.1.0.1.0.
    Database is Oracle8i Enterprise 8.1.5.

    What is the query you have given?
    Is it happening for all the queries or only for this one.
    Please reply.
    Regards
    Ravi

Maybe you are looking for

  • My phone won't download apps it says waiting loading and then it says it cannot be installed

    My phone will not let me download apps anymore I have logged out of iTunes and logged in again but that didn't work. When I try to download apps it will say waiting, installing, then it will start over like 3 times, then it will say unable to downloa

  • How can I see the bitrate while playing a DVD?

    (I posted that also on the DVD Studio Pro page, but there I got an advice that points to a professional and expensive tool - Digigami's 'Mpressionist'. Maybe here someone can help me with a simpler sollution. I will post on both sides potential sollu

  • Problem in finding iOS 6.1.4 on hard drive

    I am using iPhone 5,i just downloaded iOS 6.1.4 on my iPhone but with a great difficulty as there is no resuming option and if the internet connection is lost for a moment the download disrupts and will always start from the beggining.. I am currentl

  • Mozilla Firefox Hotfix can not be downloaded. Why is this so?

    At all times I tried to download, I get an error-message "Error downloading".

  • Format Date question as VARCHAR

    Using Oracle 10g: I have a varchar field that is holding a date like: 2010-08-28 14:40:21 I'm trying to format the date so I can check if it's greater than the sysdate. I'm trying to do: TO_CHAR(end_date, 'YYYYMMDD' ) > to_char(sysdate,'YYYYMMDD'); I