Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2006
    Posts
    19

    Unanswered: Inserting Data to Tables on another user

    I would like to know how can I insert data into tables on another user. They both are in the same tablespace.

    I tried:

    PHP Code:
    INSERT INTO USERNAME.TABLENAME VALUES (1'TEST');
    INSERT INTO USERNAME(TABLENAMEVALUES (1'TEST'); 
    Didn't work...
    Please help me.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    I tried to make my car go.
    Didn't work...

    Tell me how to fix it.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Sep 2006
    Posts
    19
    uhh??

    Can you give me some light on this?

    I have searched all over google and couldn't find anything either.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You should try GOOGLING the Oracle ERROR CODES which you have refused to post.
    Do you have any idea how many DOZENS of different ways an INSERT could fail??????????????????????????????????
    My crystal ball is broken & I am not able to look over your shouldler to actually see how Oracle is responding.
    & stop be coy, cute or otherwise obnoxious by obfuscating your code.
    "USERNAME" is a reserved word and can not be used as a schema name.
    You're On Your Own. (YOYO)!
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Did you GRANT INSERT on this 'tablename' to the user which is trying to insert a record into it?

  6. #6
    Join Date
    Sep 2006
    Posts
    19
    Quote Originally Posted by Littlefoot
    Did you GRANT INSERT on this 'tablename' to the user which is trying to insert a record into it?
    Thank you very much! just what I needed!

    Also, is there a way to GRANT him INSERT on ALL my tables without having to go one by one?

  7. #7
    Join Date
    Dec 2003
    Posts
    1,074
    No. You could consider granting all of the necessary priveleges to a role, and then granting that role to your user. That would simplify the process for other similar users in the future.

    There is another alternative, although I don't know which versions prior to 10g support it: GRANT INSERT ANY TABLE TO <user>. This may be considered bad practice within your organization, though, as it opens up all tables to that user. We grant it to our "power-analysts" who support or serve as backups to all of our data systems.

    -Chuck

  8. #8
    Join Date
    Nov 2003
    Posts
    2,932
    Provided Answers: 12
    Quote Originally Posted by XDC
    Also, is there a way to GRANT him INSERT on ALL my tables without having to go one by one?
    To be run with SQL*Plus
    Code:
    set heading off
    set feedback off
    set timing off
    spool grant_all.sql
    SELECT 'GRANT SELECT, INSERT ON '||table_name||' TO the_user;' FROM user_tables;
    spool off
    @grant_all.sql
    Untested.
    You might need to play around with the SET ... OFF commands to create a valid SQL file.

Posting Permissions

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