+ Reply to Thread
Results 1 to 4 of 4

Trying to write a DB2 grant statement. Trouble with double-quotes

  1. #1
    Registered User
    Join Date
    03-18-2014
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    2

    Trying to write a DB2 grant statement. Trouble with double-quotes

    Hello,

    I'm trying to write a grant statement for a few hundred tables in DB2. I love doing this in Excel as it's so easy once you get the formula. Although I am having trouble with the double quotes that DB2 uses since Excel uses that to break out of a Concatenate.

    Here is a sample statement: GRANT SELECT, INSERT, UPDATE, ALTER, DELETE ON TABLE "schemaname"."tablename" TO USER "JohnDoe" WITH GRANT OPTION;

    schema name will be A1 and tablename will be A2. JohnDoe will be hard-coded/constant.

    Any help would be greatly appreciated.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Trying to write a DB2 grant statement. Trouble with double-quotes

    ="GRANT SELECT, INSERT, UPDATE, ALTER, DELETE ON TABLE """&A1&"""."""&A2&""" TO USER ""JohnDoe"" WITH GRANT OPTION;"

    I write similar formulas often when trying to use brute force to manage all possible outcomes of a complicated IF statement.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    03-18-2014
    Location
    Iowa
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Trying to write a DB2 grant statement. Trouble with double-quotes

    That did it! Thanks so much!

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Trying to write a DB2 grant statement. Trouble with double-quotes

    No problem. Concatenation in conjunction with standardizing formula writing is such a timesaver.

    I can't even imagine what it would have been like to write the formula in S60 of this spreadsheet. -sweat-

    holy concatenation batman.xlsx


    Good times.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Save to a CSV with Double Quotes EXCEPT the Second Column with NO Quotes
    By tkuy2k in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-16-2013, 09:54 AM
  2. Save to a CSV with Double Quotes EXCEPT the First Column with NO Quotes
    By justforthis1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-13-2013, 07:02 PM
  3. [SOLVED] Double Quotes using Chr(34) and Extra Quotes when saving as text file
    By vamosj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2013, 12:26 PM
  4. Export to CSV with double quotes but ignore items that have quotes
    By capnhud in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2010, 03:13 PM
  5. Setting a cell's value as a formula containing quotes or double quotes using vba
    By Metshrine in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2006, 04:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1