Connect statement with input string in a script

I would like to enter a password for each connect statement after I start my.sql
my.sql
connect scott/&p_password@orcl;
grant SELECT to peter on table_1;
SQL>@my.sql
SQL> connect scott/&p_password@orcl;
Please enter a value for p_password: grant SELECT to peter on table_1;
invalid option.
using: CONNECT <username> [AS SYSDBA|SYSOPER]
SQL> ...
Sql accept the grant statement after the connect statement as an input value.
What must I change in my script???
Best regards,
Tom Rakete
Message was edited by:
Tom Rakete

Are you trying to start your script from within SQL*Plus?
Afraid no. Because the prompt "Please enter a value for ..." sounds suspicious.
C:\my.sql
conn max/&p_password@pdoxora
grant select on test to public;Copy-paste from SQL*Plus:
SQL> @C:\my.sql
Enter value for p_password: *******
Connected.
Grant succeeded.In other words, SQL*Plus prompts "Enter value", not "Please enter a value".
So what tool are you using?
Regards,
Andrew.

Similar Messages

  • Call a Graphical Calc view with input Parameters from a Script Based Calc View

    Hi All.
    I am trying to call a graphical calculation view with input parameters from a script based calculation view as below but getting syntax error:
    SESSION_SAMPLE = SELECT SESSION_CREATE_DATE,SHA256,CA_MEASURE
                                 FROM "_SYS_BIC"."WILDFIRE/CV_SESSION_SAMPLE"
                                 WITH PARAMETERS  ('PLACEHOLDER' = ('$$IP_START_DATE$$',:START_DATE),
                                     'PLACEHOLDER' = ('$$IP_END_DATE$$',:END_DATE));
    START_DATE  and END_DATE are input parameters of the script based calculation view.
    Can anyone please help me with the correct syntax for accomplishing this?
    Thanks,
    Goutham

    Hi Gautham,
    One more option  what i would like you to try is the below option , here i have just changed the order of passing nothing else.
    SESSION_SAMPLE = SELECT SESSION_CREATE_DATE,SHA256,CA_MEASURE
                                 FROM "_SYS_BIC"."WILDFIRE/CV_SESSION_SAMPLE"
                                   ('PLACEHOLDER' = ('$$IP_END_DATE$$','$$END_DATE$$'),
                                  'PLACEHOLDER' = ('$$IP_START_DATE$$','$$START_DATE$$'))
    Regards,
    Vinoth

  • Audio SFX not in sync with input string playback

    The audio 'key clicking' sound that occurs during playback as an input string is animated on the screen is not in sync with the characters... Its about .5 seconds late.
    Is there a way to adjust this?
    Thanks,
    Peter

    While the posted solution to my sync issue could very well correct my problem, the poster presumes I am computer literate, which I am not. lol
    could the solution provider please explain the solution as is it were being given to a 6 year old? Although most 6 year old's are possibly more computer literate than I. lol
    Thank you for your time.
    I will be checking back for any response.

  • If statements with a String  ????

    hi, im using a JSP page which takes in a username and password and that info is then sent to a servlet which connects to the database and checks to see which type of user they are. the servlet then redirects them to the page that corresponds to the typ of user they are. everything works fine except for it keeps going to the LoginError page. heres my code for the if statement:
    if (acType=="TournamentOwner")
    response.sendRedirect("http://localhost:8080/TournamentOwnerPage.jsp");
    else if (acType=="TeamManager")
    response.sendRedirect("http://localhost:8080/TeamManagerPage.jsp");
    else if (acType=="Operator")
    response.sendRedirect("http://localhost:8080/OperatorPage.jsp");
    else
    response.sendRedirect("http://localhost:8080/LoginError.jsp");
    ive also tried
    if (acType == ' TournamentOwner ' )
    if (acType.equals( "TournamentOwner" ))
    if(acType.length( ) == 15)
    ive also tried it with comparing it to a variable with the same name...
    String tour = "TournamentOwner";
    if (acType == tour )
    the whole thing works fine except it keeps going to the LoginError jsp page.
    the acType variable successfully stores the value of the account type so thats working fine.
    the problem must be in the if statement. can anyone help me out?

    [snip]
    the whole thing works fine except it keeps going to
    the LoginError jsp page. That seems to be a significant issue!
    the acType variable successfully stores the value of
    the account type so thats working fine.
    the problem must be in the if statement. can anyone
    help me out?Aye - use the equals() method to compare String values.
    Good Luck
    Lee

  • IF Statement with multiple ORs in Calc Script

    Hello,
    May I know what is the best way to script the following statement in a Member formula, not calc script (can't use Fix statements)
    If (A->B->C == 1, 3 or 5 AND X->B->C == Value1)
    returnvalue1
    ELSE
    #Missing.
    Basically I am looking for syntax for an IF statement where IF one condition is equal to multiple values as mentioned, then the result is this...
    Help is much appreciated.  Thanks.
    Adi

    You won't be able to use a comma separated list, you'll have to repeat the combination. A->B->C == 1 or A->B->C == 3 so on and so forth
    If you can give a use case scenario or the logic behind it then there are more chances that you might end up with a nicer solution.
    Regards
    Celvin

  • SQL Prepared Statement with a string parameter including a colon

    Hello everybody,
    I'm recently experiencing a problem using Prepared SQL Statements if one of the parameter is a string containing a ":" (colon).
    I'm able to insert a date (as a string) record using the format "hh:mm" into a MySQL database table but when I execute the query I cannot retrieve the record.
    Does anyone know any problem with ":" character?
    Replacing ":" with "." solves the problem...
    Thanks a lot.
    Edited by: 798883 on 29/09/2010 17:25

    Huh?
    One of the points in using PreparedStatements is that they handle the formatting for you. You shouldn't be setting dates with String values at all. Create a java.sql.Date (or timestamp or time as the case may be) and use the appropriate setXXX method of PreparedStatement. If you have String values then you can use SimpleDateFormat to parse them into dates.

  • CSM connection stats missing?

    Hi
    I have a policy-map to insert an Ip address into the http header. I am also binding this to a sticky group using src ip address(See policy ICHAIN1-INSERT).
    When I initiate a connection within the policy, although the connection is successful, when I try to view the connection stats (show mod csm 3 conns) my client is not listed in the connection table.
    When I remove the "sticky-group 10" command then show the connection table, I see my client listed.
    Is this normal behaviour?
    Also when I issue the show sticky command the real ip's are garbled as shown:-
    10 ip 143.52.208.19 D^OI^TD^Z^P!KP 65282
    10 ip 10.6.1.14 P2^hD^Z^D^B*^X 79985
    Config;
    module ContentSwitchingModule 2
    ft group 1 vlan 107
    priority 20 alt 10
    preempt
    vlan 105 client
    ip address 10.14.105.6 255.255.255.0
    gateway 10.14.105.1
    natpool CSM-PR1-USERS 10.14.105.10 10.14.105.18 netmask 255.255.255.0
    probe ICHAIN-HTTP1 tcp
    interval 10
    failed 60
    port 80
    probe ZEN-APPS1-PRB tcp
    interval 10
    failed 60
    port 524
    probe ZEN-LDAP1-PRB tcp
    interval 10
    failed 60
    port 636
    probe ZEN-SERVER1-PRB tcp
    interval 10
    failed 60
    port 524
    map ICHAIN1-X-FOR header
    insert protocol http header X-Forwarded-For header-value %is
    real BONG
    address 143.52.2.120
    inservice
    real HUORN
    address 10.11.33.44
    inservice
    real ICHAIN101
    address 10.14.72.21
    inservice
    real ICHAIN202
    address 10.14.72.70
    inservice
    real JOSHUA
    address 143.52.2.121
    inservice
    real KARAKA
    address 143.52.2.42
    inservice
    real KARO
    address 10.11.33.30
    inservice
    real PATE
    address 10.11.33.32
    inservice
    serverfarm ICHAIN-BB1
    nat server
    nat client CSM-PR1-USERS
    predictor leastconns
    real name ICHAIN1
    inservice
    real name ICHAIN2
    inservice
    probe ICHAIN-HTTP1
    serverfarm ZEN-APPS1
    nat server
    nat client CSM-PR1-USERS
    predictor leastconns
    real name BONG
    inservice
    real name JOSHUA
    inservice
    real name KARO
    inservice
    real name PATE
    inservice
    probe ZEN-APPS1-PRB
    serverfarm ZEN-LDAP1
    nat server
    nat client CSM-PR1-USERS
    predictor leastconns
    real name HUORN
    inservice
    real name KARAKA
    inservice
    probe ZEN-LDAP1-PRB
    serverfarm ZEN-SERVER1
    nat server
    nat client CSM-PR1-USERS
    predictor leastconns
    real name HUORN
    inservice
    real name KARAKA
    inservice
    probe ZEN-SERVER1-PRB
    sticky 10 netmask 255.255.255.255 timeout 2880
    policy ICHAIN1-INSERT
    header-map ICHAIN1-X-FOR
    sticky-group 10
    serverfarm ICHAIN-BB1
    vserver VIP-ICHAIN1
    virtual 10.14.105.20 tcp www
    serverfarm ICHAIN-BB1
    sticky 2880 group 10
    replicate csrp sticky
    replicate csrp connection
    persistent rebalance
    slb-policy ICHAIN1-INSERT
    inservice
    vserver VIP-ICHAIN1-SSL
    virtual 10.14.105.20 tcp https
    serverfarm ICHAIN-BB1
    sticky 1440 group 10
    replicate csrp sticky
    replicate csrp connection
    persistent rebalance
    inservice
    vserver ZEN-APPS1-VIP
    virtual 10.14.105.21 tcp 0
    serverfarm ZEN-APPS1
    replicate csrp connection
    persistent rebalance
    inservice
    vserver ZEN-LDAP1-VIP
    virtual 10.14.105.22 tcp 0
    serverfarm ZEN-LDAP1
    replicate csrp connection
    persistent rebalance
    inservice
    vserver ZEN-SERVER1-VIP
    virtual 10.14.105.23 tcp 0
    serverfarm ZEN-SERVER1
    replicate csrp connection
    persistent rebalance
    inservice
    Many Thanks
    Scott

    Hello, I have the same problem running CSM Ver 4.1(7)
    Showing connection stats with any of
    show module csm 4 conn
    show module csm 4 real
    do not show any connections nor does it matter if I specify vserver or client or detail as the options
    I am using cookie-based sticky and the show mod csm 4 sticky command seems to give correct info so that is not an issue for me

  • Help with Oracle Connection- "Input string was not in a correct format"

    Hello, can some one, anyone please help me. I have a simple VS 2005 C# application that connects to oracle. I've set it up to take the username, password and tnsname as arguments. I am using Client 9i, version 9.2.0.401 of Oracle.DataAccess.dll, and .NET Framework 2.0.
    It works fine when I run it from VS 2005, I have also set up a test machine w/o VS 2005 and ran my install package and it runs fine. I sent it to one of my co-workers and when he tries it the OracleConnection obect fails with the error.
    "Input string was not in a correct format"
    strange in that it is not an ORA error, just the identifed text!?
    Here is the code:
    ## begin code
    OracleConnection dbc = new OracleConnection();
    string sConnectString = "User Id=" + username.ToString() + ";Password=" + password.ToString() + ";Data Source=" + tnsname.ToString();
    dbc.ConnectionString = sConnectString.ToString();
    MessageBox.Show("Attempting to Connect to Oracle");
    dbc.Open();
    MessageBox.Show("Connected to Oracle: " + dbc.ServerVersion);
    ## end code
    Pretty basic, what could be going on?
    Since this only happens with an installation, I put in the message boxes to verify exactly where it chokes. I get the first message box, then an error with the identified text. I've seen a number of posts regarding input string format problems, but not a one dealing with OracleConnection.Open(). I added all the ToString() calls just to make sure everything was a string but it did not change the end result.
    Anyone? Thanks In advance!
    Eric S.

    Hello,
    well, i got a message "...string not wellformed format...", too.
    If you have defined the parameters as string, you don't need the additonal "ToString()". Please ckeck your tnsnames -string. Try to debug this. I believe you have copy the format from the tnsnames.ora and there you have much brackets.
    For example, two code snippets:
    As datasource i use <Server>:<Port>/<Instance>
    try
    string FDsn ="User Id="+FDbUser+";Password="+FDbPwd;
    FDsn +=";Data Source=wth5:1521/Ora9.wth5";
    FConn = new OracleConnection(FDsn);
    FConn.Open();
    if (FConn.State == ConnectionState.Open )
         FConn.Close();
    catch (Exception ex)
         FStateMsg = "Connection to database failed. Check Configuration in parameter: ConnectionString. " + ex.Message;
    Above i connect to a Ora 9.2.0.1
    by using
    FDsn +=";Data Source=wth5:1522/XE";
    i connect to an OraExpress database on the same machine.
    My Oracle.dataAccess.dll ist the newest, 10.2.... and it runs under Framework 1.1.x and Framework 2.x
    I'll hope it will help you. Best regards!

  • How to get input  string with resolved '?' of PreparedStatement?

    Is there a way to retrieve the input string of a PreparedStatement?
    Example:
    ps = connection.prepareStatement("update t1 set name=?");
    ps.setString(1, "test");Now, can I get the input string "update t1 set name=?" back from the PreparedStatement object with the '?' resolved? In this case:
    update t1 set name='test'
    ?

    Sir,
    Thank you first for responding. I appreciate your time in dicussing things here. Just saying.
    I see that you suggested and that is sort of agood
    tool for this but I think I would want to do more
    testing with the actual driver no?
    Not sure what you mean by "testing with the actual
    driver". The suggestion that I made is a proxy, not
    a substitute.
    Right. Never mind. I got myself confused.
    Actually I would like to ask a serious question
    here... can you give an example of why you don'tknow
    what the SQL will look like? I'm just trying to
    understand why you don't know and I'm strugglingwith
    that.1. Dynamic creation of SQLUgh. Okay. But still ugh.
    2. Unknown input of parameters.I still don't understand why they would be unknown if it is your app inputting them.
    Sincerely,
    Slappy

  • How to connect input string value to numerical values

    Hello,
    I am trying to figure out how to connect a single user's input string value to numerical values. Basically I want the user to input the name of a gas that I have a list for (I believe i put the list of gasses in an array>). Then I want to match 2 numerical values "a" and "b" depending on which gas name the user has put in. These "a" and "b" values will be automatically matched with the gas name from a list I put. For example the gas hydrogen has a value of 3 for "a" and 4 for "b. so when the user puts the name "hydrogen" in a string constant, automatically  "a" and "b" should be outputted. I will be connecting a and b to a formula
    Thanks for any help
    Solved!
    Go to Solution.

    student11 wrote:  These "a" and "b" values will be automatically matched with the gas name from a list I put. For example the gas hydrogen has a value of 3 for "a" and 4 for "b".
    This sounds a lot like an Enum to me.  Make sure you type def the enum to make sure updates quickly and easily make it to all copies of the enums.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Java Switch Statement with Strings

    Apparently you cant make a switch statement with strings in java. What is the most efficient way to rewrite this code to make it function similar to a swtich statement with strings?
    switch (type){
                   case "pounds":
                        type = "weight";
                        break;
                   case "ounces":
                        type = "weight";
                        break;
                   case "grams":
                        type = "weight";
                        break;
                   case "fluid ounces":
                        type = "liquid";
                        break;
                   case "liters":
                        type = "liquid";
                        break;
                   case "gallons":
                        type = "liquid";
                        break;
                   case "cups":
                        type = "liquid";
                        break;
                   case "teaspoons":
                        type = "liquid";
                        break;
                   case "tablespoons":
                        type = "liquid";
                        break;
              }

    I'd create a Map somewhere with entries "liquid", "weight", etc.
    public class Converter {
        private static Map<String, List<String>> unitMap = new HashMap<String, List<String>>();
        private static String[] LIQUID_UNITS = { "pints", "gallons", "quarts", "millilitres" };
        private static String[] WEIGHT_UNITS = { "pounds", "ounces", "grams" };
        static {
            List<String> liquidUnits = new ArrayList<String>();
            for (int i = 0; i < LIQUID_UNITS.length; i++) liquidUnits.add(LIQUID_UNITS));
    unitMap.put("liquid", liquidUnits);
    ... // other unit types here
    public String findUnitType(String unit) {
    for (String unitType : unitMap.keySet()) {
    List<String> unitList = unitMap.get(unitType);
    if (unitList.contains(unit))
    return unitType;
    return null;
    It might not be more "efficient", but it's certainly quite readable, and supports adding new units quite easily. And it's a lot shorter than the series of if/else-ifs that you would have to do otherwise. You'll probably want to include a distinction between imperial/metric units, but maybe you don't need it.
    Brian

  • How to encrypt with a string as input,but not a key object

    As far as I know,when encrypt or decrypt ,a key must first be got,and the key is first generate by a tool or from SecurityRandom,that means I can not generate the same key with the same input.Does there is a method which can generate a same with the same input string?
    There is a need to transfer file between to site,and the customer wish to encrypt these files during transfering,and they want to store a string into each database at each site,when sending and receiving files,get the string from the database to encrypt or decrypt the file,they alse want to have a control of the string,they can change the string randomly if they wish as long as long keep each string is equal,how to realize this?

    I think what you are looking for is a password based encryption (PBE). An example of using the same is mentioned in JCE reference guide. Below is the relevant code/docs from the rference guide.
    Using Password-Based Encryption
    In this example, we prompt the user for a password from which we derive an encryption key.
    It would seem logical to collect and store the password in an object of type java.lang.String. However, here's the caveat: Objects of type String are immutable, i.e., there are no methods defined that allow you to change (overwrite) or zero out the contents of a String after usage. This feature makes String objects unsuitable for storing security sensitive information such as user passwords. You should always collect and store security sensitive information in a char array instead.
    For that reason, the javax.crypto.spec.PBEKeySpec class takes (and returns) a password as a char array.
    The following method is an example of how to collect a user password as a char array:
         * Reads user password from given input stream.
        public char[] readPasswd(InputStream in) throws IOException {
            char[] lineBuffer;
            char[] buf;
            int i;
            buf = lineBuffer = new char[128];
            int room = buf.length;
            int offset = 0;
            int c;
    loop:   while (true) {
                switch (c = in.read()) {
                  case -1:
                  case '\n':
                    break loop;
                  case '\r':
                    int c2 = in.read();
                    if ((c2 != '\n') && (c2 != -1)) {
                        if (!(in instanceof PushbackInputStream)) {
                            in = new PushbackInputStream(in);
                        ((PushbackInputStream)in).unread(c2);
                    } else
                        break loop;
                  default:
                    if (--room < 0) {
                        buf = new char[offset + 128];
                        room = buf.length - offset - 1;
                        System.arraycopy(lineBuffer, 0, buf, 0, offset);
                        Arrays.fill(lineBuffer, ' ');
                        lineBuffer = buf;
                    buf[offset++] = (char) c;
                    break;
            if (offset == 0) {
                return null;
            char[] ret = new char[offset];
            System.arraycopy(buf, 0, ret, 0, offset);
            Arrays.fill(buf, ' ');
            return ret;
        }In order to use Password-Based Encryption (PBE) as defined in PKCS #5, we have to specify a salt and an iteration count. The same salt and iteration count that are used for encryption must be used for decryption:
        PBEKeySpec pbeKeySpec;
        PBEParameterSpec pbeParamSpec;
        SecretKeyFactory keyFac;
        // Salt
        byte[] salt = {
            (byte)0xc7, (byte)0x73, (byte)0x21, (byte)0x8c,
            (byte)0x7e, (byte)0xc8, (byte)0xee, (byte)0x99
        // Iteration count
        int count = 20;
        // Create PBE parameter set
        pbeParamSpec = new PBEParameterSpec(salt, count);
        // Prompt user for encryption password.
        // Collect user password as char array (using the
        // "readPasswd" method from above), and convert
        // it into a SecretKey object, using a PBE key
        // factory.
        System.out.print("Enter encryption password:  ");
        System.out.flush();
        pbeKeySpec = new PBEKeySpec(readPasswd(System.in));
        keyFac = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
        SecretKey pbeKey = keyFac.generateSecret(pbeKeySpec);
        // Create PBE Cipher
        Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
        // Initialize PBE Cipher with key and parameters
        pbeCipher.init(Cipher.ENCRYPT_MODE, pbeKey, pbeParamSpec);
        // Our cleartext
        byte[] cleartext = "This is another example".getBytes();
        // Encrypt the cleartext
        byte[] ciphertext = pbeCipher.doFinal(cleartext);Hope this helps
    Sai Pullabhotla

  • While downloading the latest IOS update to my iPhone 4, my phone went into a frozen state with the update 2/3's complete. It's remained like this for the past 12 hours. I can't turn the phone off, and I can't connect it to iTunes. Anyone know what to do?

    While downloading the latest IOS update to my iPhone 4S, my phone went into a frozen state with the update 2/3's complete. It's remained like this for the past 12 hours. I can't turn the phone off, and I can't connect it to iTunes. Anyone know what to do?

    If the place of purchase does not have a 'Lemon' policy (three replacements = refund or complete exchange), sadly you are out of luck.
    And Apple themselves do not have any power over what policy a reseller uses. You can call Apple Care and have them replace it, but the odds are you would probably get a standard replacement again like has previously happened. I'm pretty sure Apple holds their own sort of 'Lemon' polocy where if it's been replaced three times through them they'll swap it out for a brand new phone. Not 100% sure though, best bet is too call them again.
    And it ***** getting a response like that from their support personel, but hey, they can't all be that bad can they? I'm sure if you plead your case they'll try and help out. I've dealt with them in the past and had one or two people that rubbed me the wrong way, but most of them have been a great help and kept me a happy customer, haha.
    Regards,
    ThatGuy

  • Regular expression breaks with \00 in input string

    I wrote the following code to illustrate the problem.
    Clearly the match should occur in both cases, but it does not occur if \00 is in the input string (within the < > ).
    I am not even searching for \00 or \01. This makes the regular expression match rather useless if you have text that contains data in hex form. I am using Labview 8.2. Is this a known bug? Is there a work around?
    Tammo
    Message Edited by Tammo on 03-06-2008 12:26 PM
    Message Edited by Tammo on 03-06-2008 12:26 PM
    Attachments:
    RegEx1.vi ‏56 KB
    BlockDiagram1.jpg ‏18 KB
    FrontPanel1.jpg ‏18 KB

    There was a brief discussion on this not too long ago.

  • CRC-16 CCITT with Hex input string

    Hiya
    I am new to Labview and CRCs, I am trying to create a program that performs a CRC-16 CCITT check. I have searched the forums and found a few examples but my input string that is entered into the CRC is hex and the examples I have found the input string should be in ASCII. Apologies if the answer to this question is simple! I am very new too all this so please be nice!!
    Thanks
    Nicola

    http://forums.ni.com/t5/LabVIEW/crc16-ccitt/m-p/232411?requireLogin=False
    - James
    Using LV 2012 on Windows 7 64 bit

Maybe you are looking for

  • AT SELECTION SCREEN

    HI ALL am using the code below but am getting an "ERROR CALLED ON VALUE REQUEST FOR" should be followed by <parameter> or <select-option>-LOW / <select-option>-HIGH.please help and also please mention the changes if needed with regards vijay at selec

  • How to change tree colors? example inside.

    Hello, I was looking on the Internet to find the way to change background tree to specific colors, not the same color. Here is an example...: and here's another one: Thank you'll.

  • How do I control pop ups after installation

    I just started a company in Orange City,Fl, we have older windows XP on our computers, i have had latest versions of Adobe installed on all computers, but even after updating to latest versions still recieve messages stating that we need to install l

  • Screen exit in iq02 screen

    Hi , I need to add two custom fields in iq02 screen. in user data tab or whereever possible. Any enhancement available? Steps would be appreciated. Thanks Regards, Kashyap Moderator message: please do some research before asking. Edited by: Thomas Zl

  • Safari keeps crashing in some sites

    So every time I click some sites my safari automaticaly crashes, giving me this report: Process:         WebProcess [5169] Path:            /System/Library/StagedFrameworks/Safari/WebKit2.framework/WebProcess.app/Conten ts/MacOS/WebProcess Identifier