Results is not the same

I have this problem:
steeve@JUK_PROD> create table t1 as select object_name, owner, object_type from all_objects where 1=0;
Table created.
steeve@JUK_PROD>
steeve@JUK_PROD> declare
2 begin
3 INSERT INTO t1 (object_name, owner, object_type)
4 SELECT object_name, owner, object_type FROM all_objects;
5 end;
6 /
PL/SQL procedure successfully completed.
steeve@JUK_PROD>
steeve@JUK_PROD> select count(1) from t1;
COUNT(1)
39459
steeve@JUK_PROD> select count(1) from all_objects;
COUNT(1)
39459
You can see here that the number of rows is the same, no problem here.
steeve@JUK_PROD>
steeve@JUK_PROD> create table t2 as select object_name, owner, object_type from all_objects where 1=0;
Table created.
steeve@JUK_PROD>
steeve@JUK_PROD> create procedure p is
2 begin
3 INSERT INTO t2 (object_name, owner, object_type)
4 SELECT object_name, owner, object_type FROM all_objects;
5 end p;
6 /
Procedure created.
steeve@JUK_PROD>
steeve@JUK_PROD> execute p;
PL/SQL procedure successfully completed.
steeve@JUK_PROD>
steeve@JUK_PROD> select count(1) from t2;
COUNT(1)
39441
steeve@JUK_PROD> select count(1) from all_objects;
COUNT(1)
39461
Why then, when i execute the same code in a procedure, the results is not the same?
Here is the script to reproduce if you want to troubleshoot:
rem connected as sys user
create user steeve identified by steeve default tablespace users;
ALTER USER STEEVE QUOTA UNLIMITED ON USERS;
grant create session to steeve;
grant create procedure to steeve;
grant create table to steeve;
rem connect as steeve user
create table t1 as select object_name, owner, object_type from all_objects where 1=0;
declare
begin
INSERT INTO t1 (object_name, owner, object_type)
SELECT object_name, owner, object_type FROM all_objects;
end;
select count(1) from t1;
select count(1) from all_objects;
create table t2 as select object_name, owner, object_type from all_objects where 1=0;
create procedure p is
begin
INSERT INTO t2 (object_name, owner, object_type)
SELECT object_name, owner, object_type FROM all_objects;
end p;
execute p;
select count(1) from t2;
select count(1) from all_objects;
i just want to add, that i dont have that problem when i run the same example connected with the user sys.
Why this happen?
what rights the user steeve is missing?
Message was edited by:
Steeve

Check the DDL of all_objects will help understand why some objects are missing.
Here's a cut out of partial all_objects DDL
and
       exists (select null from v$enabledprivs
               where priv_number in (
                                      -144 /* EXECUTE ANY PROCEDURE */,
                                      -141 /* CREATE ANY PROCEDURE */
    or
       o.type# in (12) /* trigger */
       and
       exists (select null from v$enabledprivs
               where priv_number in (
                                      -152 /* CREATE ANY TRIGGER */
...

Similar Messages

  • AES encrypt and decrypt not the same

    I use aes to encrypt and decrypt a file. Why is the resulting file not the same as the input?
    package mybeans;
    import java.io.*;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Hashtable;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    public class Encrypt {
         public static void main(String args[]) throws Exception {
              Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
              SecretKeySpec keySpec = new SecretKeySpec(
                        "05468345670abcde".getBytes(), "AES");
              IvParameterSpec ivSpec = new IvParameterSpec("f45gt7g83sd56210"
                        .getBytes());
              cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);
              FileInputStream fis = new FileInputStream(new File("C:\\text.txt"));
              CipherInputStream cis = new CipherInputStream(fis, cipher);
              FileOutputStream fos = new FileOutputStream(new File(
                        "C:\\encrypted.txt"));
              byte[] b = new byte[8];
              int i;
              while ((i = cis.read(b)) != -1) {
                   fos.write(b, 0, i);
              fos.flush();
              fos.close();
    package mybeans;
    import java.io.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    public class Decrypt {
         public static void main(String args[]) throws Exception {
              Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
              SecretKeySpec keySpec = new SecretKeySpec(
                        "05468345670abcde".getBytes(), "AES");
              IvParameterSpec ivSpec = new IvParameterSpec("f45gt7g83sd56210"
                        .getBytes());
              cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
              FileInputStream fis = new FileInputStream(new File("C:\\encrypted.txt"));
              CipherInputStream cis = new CipherInputStream(fis, cipher);
              FileOutputStream fos = new FileOutputStream(new File(
                        "C:\\decrypted.txt"));
              byte[] b = new byte[8];
              int i;
              while ((i = cis.read(b)) != -1) {
                   fos.write(b, 0, i);
              fos.flush();
              fos.close();
              cis.close();
              fis.close();
    }Here is the data in the file:
    James,"smith",007
    mike,"smith",001
    the result is this:
    James,"smith",007
    mike,"smith",
    Edited by: iketurna on Jun 3, 2008 1:47 PM

    Thanks sabre!
    Very insightful.
    I used PKCS5Padding and the file has all of the data, but there are extra padding at the end of the second line
    Also,
    how would you store your key and iv?
    Currently I using this to create the iv and key:
    public class KeyClass {
    private SecretKeySpec keygeneration() {
    SecretKeySpec skeySpec=null;
    try {
      KeyGenerator kgen = KeyGenerator.getInstance("AES");
      kgen.init(128);
      SecretKey skey = kgen.generateKey();
      byte[] key = skey.getEncoded();
      skeySpec = new SecretKeySpec(key,"AES");
    }catch(Exception e) {
      System.out.println("error in keygen = "+e);
    return skeySpec;
    public void keyFile() {
    try{
    FileOutputStream fos=new FileOutputStream("c:\\keyFile.txt");
    DataOutputStream dos=new DataOutputStream(fos);
    SecretKeySpec skeySpec=keygeneration();
    byte[] key=skeySpec.getEncoded();
    BASE64Encoder base64 = new BASE64Encoder();
    String encodedString = base64.encodeBuffer(key);
    dos.write(encodedString.getBytes());
    }catch(Exception e1){
      System.out.println("error file write "+e1);
    public static void main(String args[]){
      KeyClass cKey = new KeyClass();
      cKey.keyFile();
    }Edited by: iketurna on Jun 5, 2008 7:29 AM

  • Load from Source-Destination=?Table structure not the same.

    Hi
    I have to copy data from source table to destination table. The structure of the 2 are not the same. Number of records in destination table should be half number of records in source. The reason being in the source a column named (e.g.) c_type = 'Up' - one row or 'Down' - in another row. The same is reprsented in the destination as 1 row since the number of columns is more. Example up_name, down_name, up_dep, down_dep.
    How can I insert into the destination depending on the c_type column in the source?
    Example:
    I want to insert into destination.up_name where c_type = 'Up' and destination.down_name where c_type = 'Down'...
    and so onHow can I write my sql query such that I have to write one insert statement and put the right data in the right column?

    Mass25 wrote:
    Number of records in destination table should be half number of records in source. The reason being in the source a >column named (e.g.) c_type = 'Up' - one row or 'Down' - in another row. The same is reprsented in the destination >as 1 row since the number of columns is more. Example up_name, down_name, up_dep, down_dep. Hope this is what you are looking for:
    SQL> WITH SOURCE AS
      2       (SELECT 1 id_col, 'UP' c_type, 'up_name_1' name_col,
      3               'up_dept_1' dept_name
      4          FROM DUAL
      5        UNION ALL
      6        SELECT 1 id_col, 'DOWN' c_type, 'down_name_1' name_col,
      7               'down_dept_1' dept_name
      8          FROM DUAL
      9        UNION ALL
    10        SELECT 2 id_col, 'UP' c_type, 'up_name_2' name_col,
    11               'up_dept_2' dept_name
    12          FROM DUAL
    13        UNION ALL
    14        SELECT 2 id_col, 'DOWN' c_type, 'down_name_2' name_col,
    15               'down_dept_2' dept_name
    16          FROM DUAL
    17        UNION ALL
    18        SELECT 3 id_col, 'UP' c_type, 'up_name_3' name_col,
    19               'up_dept_3' dept_name
    20          FROM DUAL
    21        UNION ALL
    22        SELECT 3 id_col, 'DOWN' c_type, 'down_name_3' name_col,
    23               'down_dept_3' dept_name
    24          FROM DUAL)
    25  SELECT * FROM SOURCE
    26  /
        ID_COL C_TY NAME_COL    DEPT_NAME
             1 UP   up_name_1   up_dept_1
             1 DOWN down_name_1 down_dept_1
             2 UP   up_name_2   up_dept_2
             2 DOWN down_name_2 down_dept_2
             3 UP   up_name_3   up_dept_3
             3 DOWN down_name_3 down_dept_3
    6 rows selected.
    SQL> WITH SOURCE AS
      2       (SELECT 1 id_col, 'UP' c_type, 'up_name_1' name_col,
      3               'up_dept_1' dept_name
      4          FROM DUAL
      5        UNION ALL
      6        SELECT 1 id_col, 'DOWN' c_type, 'down_name_1' name_col,
      7               'down_dept_1' dept_name
      8          FROM DUAL
      9        UNION ALL
    10        SELECT 2 id_col, 'UP' c_type, 'up_name_2' name_col,
    11               'up_dept_2' dept_name
    12          FROM DUAL
    13        UNION ALL
    14        SELECT 2 id_col, 'DOWN' c_type, 'down_name_2' name_col,
    15               'down_dept_2' dept_name
    16          FROM DUAL
    17        UNION ALL
    18        SELECT 3 id_col, 'UP' c_type, 'up_name_3' name_col,
    19               'up_dept_3' dept_name
    20          FROM DUAL
    21        UNION ALL
    22        SELECT 3 id_col, 'DOWN' c_type, 'down_name_3' name_col,
    23               'down_dept_3' dept_name
    24          FROM DUAL)
    25  SELECT s1.id_col, s1.name_col up_name, s1.dept_name up_dept,
    26         s2.name_col down_name, s2.dept_name down_dept
    27    FROM SOURCE s1 JOIN SOURCE s2
    28         ON (s1.id_col = s2.id_col AND s1.c_type = 'UP' AND s2.c_type = 'DOWN
    29  /
        ID_COL UP_NAME     UP_DEPT     DOWN_NAME   DOWN_DEPT
             1 up_name_1   up_dept_1   down_name_1 down_dept_1
             2 up_name_2   up_dept_2   down_name_2 down_dept_2
             3 up_name_3   up_dept_3   down_name_3 down_dept_3
    3 rows selected.
    SQL>Source had 6 records and it was self joined to give 3 records which can be populated in Destination Table.
    Always post some sample data with desired result. That will get you quick responses.
    Regards,
    Jo
    Edited: Added Quote Tags

  • Log-on client 200 is not the same as BI clients "600"

    Hi Experts,
    My data load got failed and when i checked the error message, it says " Log-on client 200 is not the same as BI clients "600"".
    Diagnosis
    You are using client-dependent BI functions in client 200. However, the standard BI client is 600.
    System Response
    The function is terminated.
    Procedure
    Maintain a destination in the BI standard client. For information, see SAP Note 522569.
    I went through the sap note and checked the maintenance of  rfc desination. But not able to uderstand this issue. Do anyone have good idea about this issue.
    Thanks in advance.
    Anand

    Hi,
    In BW, you must work on only client. As the error said, you log on to client 200, but using 600 client as the connected one. Please check the source system conncection whether it is given for the default client in RSADMINA table BWMANDT field or not. if not change that.

  • Line item Ship-to Info is not the same in Header Ship-to Party During Sales Order Creation via IDOC

    We have observed that during creation of sales order using idoc, the line item ship-to party is not the same with header ship-to. The ship-to party info in line item is equivalent to the header's sold to party. To give you a quick background, Sold to party info is given in idoc and ship to party is being determined using table EDPAR. In this specific scenario, sold to customer is not the same with ship to customer.
    Initial checking on the code leads us in function module VIEW_KUAGV. This FM populates partner details of sales order header and line item in program LVEDAF1Z
    Below is the code for Sales order Header. Notice that WE_INPUT parameter which contains Ship to party is passed as exporting parameter in FM VIEW_KUAGV. This is the reason why Ship to Party is populated correctly in sales order header but not in sales order item.
    Initially, it first set to Sold-To Party. However, if WE_INPUT is given or provided, partner details is set to Ship-To Party.
    Please advise on how we can make the ship to party info in header and line item be consistent. This is SAP Standard program which why we are hesitant to make change on the program. If there is a configuration to make this happen, kindly advise.
    Regards,
    Rommel

    Hi Jayesh,
    If I understand you correctly, you want that when creating SO from Quoatation
    the Ship to Party also follow/copy Ship to Party from Quotation, right?
    Just to confirm with you, when you creating SO reference from Quotation, you
    use copy/follow-up function, am I right?
    You can do this by setting in configuration of Copy Control (like mentioned by Hui).
    Step as follow :
    1. Go to IMG->CRM->Transactions->Basic Settings->Copying Control for
        Business Transactions
    2. Create your BAdi (Business Add-In for Copying Control), such as get Ship to
        Party value from source document and use it in current document
    3. Use this Rule you have created in BAdi (no. 2), in copy control transaction type
        IMG->CRM->Transactions->Basic Settings->Copying Control for
        Business Transactions-> Define Copying Control for Transaction Types
    4. Here you set Copying Routine for your transaction types (put name of your Badi
        created in step no. 2)
    Or alternatively, you can set it on access sequence in Partner Function
    Ship to Party in configuration. You can define access sequence the Ship
    to Party is taken from Preceeding Document -> Ship To Party
    1. Go to Partner Function access sequence :
        IMG->CRM->Basic Functions->Partner Processing->Define Access Sequence
    2. Create new access sequence with following entry :
        - Source COM_PARTNER_A (PrecedingPartner)
        - Check Mapping for Partner Being search
        - Partner Function in Source  = Ship To Party
    3. Assign this Access Sequence in you Partner Function used in Sales Order Transaction
       Type.
    Tell me if this is what you looking for
    Gun.

  • With iTunes match, order of the songs in my playlist of mobile devices is not the same as on my computer

    In my iTunes on computer, I have several smart play lists. Within each playlist, songs are set to a certain order. Some playlist songs order are organized by name, some playlists are organized by Album, some playlists are organized by artist etc.
    When I was syncing my iPhone and iPad directly with my computer, the playlists on my mobile device had same order of songs as on my itunes in computer.
    Now, I signed up for iTunes match. With iCloud sync, order of the songs in my playlist of mobile devices is not the same as on my computer. In fact, order of songs within a playlist appears to be completely random. Moreover, order of songs are different in my iPhone 4s and iPad 2
    How can I change the order of songs on my mobile devices or how do I make iTunes match to sync my songs such that within a playlist, my songs are in the same order as that of iTunes on my computer.

    Thanks mracole. I assume this means order of songs will work with regular play lists I iTunes match. Will try it this afternoon and report.
    Please let me know if my understanding is not correct.
    Best regards and thanks once again.

  • I'm trying to reinstall Mavericks on used Macbook Pro. When I log in to my Apple ID, it says it was not the same ID used to purchase Mountain Lion. I need to change user/admin as a lot of the folders and apps are in Chinese!

    I'm trying to reinstall Mavericks on used Macbook Pro. When I log in to my Apple ID, it says it was not the same ID used to purchase Mountain Lion. I need to change user/admin as a lot of the folders and apps are in Chinese!

    The first thing you should do with a second-hand computer is to erase the internal drive and install a clean copy of OS X. How you do that depends on the model. Look it up on this page to see what version was originally installed.
    If the machine shipped with OS X 10.4 or 10.5, you need a boxed and shrink-wrapped retail Snow Leopard (OS X 10.6) installation disc, which you can get from the Apple Store or a reputable reseller — not from eBay or anything of the kind. If the machine has less than 1 GB of memory, you'll need to add more in order to install 10.6. I suggest you install as much memory as it can take, according to the technical specifications.
    If the machine shipped with OS X 10.6, you need the installation media that came with it: gray installation discs, or a USB flash drive for some MacBook Air models. If you don't have the media, order replacements from Apple. A retail disc, or the gray discs from another model, will not work.
    To boot from an optical disc or a flash drive, insert it, then reboot and hold down the C key at the startup chime. Release the key when you see the gray Apple logo on the screen.
    If the machine shipped with OS X 10.7 or later, you don't need media. It should boot into Internet Recovery mode when you hold down the key combination option-command-R at the startup chime. Release the keys when you see a spinning globe.
    Once booted from the disc or in Internet Recovery, launch Disk Utility and select the icon of the internal drive — not any of the volume icons nested beneath it. In the Partition tab, select the default options: a GUID partition table with one data volume in Mac OS Extended (Journaled) format. This operation will permanently remove all existing data on the drive, which is what you should do.
    After partitioning, quit Disk Utility and run the OS X Installer. When the installation is done, the system will automatically reboot into the Setup Assistant, which will prompt you to transfer the data from another Mac, its backups, or from a Windows computer. If you have any data to transfer, this is usually the best time to do it.
    You should then run Software Update and install all available system updates from Apple. If you want to upgrade to a major version of OS X newer than 10.6, buy it from the Mac App Store. Note that you can't keep an upgraded version that was installed by the previous owner. He or she can't legally transfer it to you, and without the Apple ID you won't be able to update it in Software Update or reinstall, if that becomes necessary. The same goes for any App Store products that the previous owner installed — you have to repurchase them.
    If the previous owner "accepted" the bundled iLife applications (iPhoto, iMovie, and Garage Band) in the App Store so that he or she could update them, then they're linked to that Apple ID and you won't be able to download them without buying them. Reportedly, Apple customer service has sometimes issued redemption codes for these apps to second owners who asked.
    If the previous owner didn't deauthorize the computer in the iTunes Store under his Apple ID, you wont be able toauthorize it under your ID. In that case, contact iTunes Support.

  • HT5312 how do i reset my admin password, my apple iD password is NOT the same as my admin login password

    all ive been seeing is that i can reset my password with my apple iD, but its not the same. and it doesnt do the command R thing or the terminal/utilities thing. so what do i do??

    Phil,
    First of all, to log in as the HTML DB administrator, you want to use a different page, one that ends in /pls/htmldb/htmldb_admin Try logging in there. If that doesn't work, see this thread about creating a new admin account:
    stupid password tricks
    Sergio

  • My iPhone serial number and IMEI is not the same as Apple server

    Hello,
    My problem started when I want to unlock my iphone 3gs via Imei.
    My old iphone broke about a month after i bought it (it was 2 years ago), so i sent it to Movistar to change it (i think that they sent it to appleCare). Now Movistar told me that i have to send the old iphone imei in order to unlock the iphone i have now, i ask apple for the repair order receipt, then i received an email and i could see the information about the 2 iphones: the old broken one and the new one.
    Then I realized that the iphone they sent me as a replacement (the new one) is not the same iphone i have. The serial number and the Imei are different, so, should apple change this data in their server in order to unlock my iphone or what can i do to solve it?
    There is any formal way to perform this data change?
    Thank you in advance,
    Francisco Marzabal

    Here we work with repairs for devices that does not have waranty (expired or other issue). In this case, I did the screen replacement. No other ipad was on my station, the ipad arrives, i took it change the glass, put everithing back, give to customer. Thats it. The job was done by me, the customer test his ipad in front on me, works fine, everything ok. Few days pass and he came back saying that it wasn't his ipad, he brings the box that the ipad came and ask me why the serial number does not match the serial number in the box (sorry NOT in the back of the ipad).
    There were no other part changed only glass. After 7 years working on this, thats the first customer complaining about a work done here. After this I was curious and look for more information and some forums, also one port here is claiming that the serial number on the device is not the same as the box where it came.
    I just want to make sure that there are possibilities that there could be such mistake during the packaging process.
    Thanks for the replies

  • HT204053 My Icloud account number is not the same as my Apple Account  how can I change my I cloud account  to match my apple . None of my photos  are going over to my I cloud

    My Icloud ID is not the same as my Apple ID how can I chamge my Icloud ID to match.  Non of my photos are streaming over to my Icloud  and I have been paying extra for additional storage space.

    Start here, change your country if necessary and go to manage your account and request another email.

  • My UI is not the same as that shown in the Mozilla website..why? (i.e home button still on left hand side of screen and no bookmark icon)

    I was using FF 4 Beta and applied the update ... I noticed that my final version was not the same as shown on the website so I removed the beta setup file and took off all versions of FF cleaned adn restarted my laptop and then reinstalled a clean version of FF 4.. however my final* version is not the same as shown still. Is this right or do I need to do something else :(
    Examples of what is different is the home icon remains on the left hand side of the screen next to the back button and I do not have the bookmarks icons which from the website should appear on the right hand side next to the new location of the home button.

    Look you can customize it very easily.
    Press Alt+V to have the View Menu -> Select Toolbars -> Click on Customize -> Now drag the Home Button to anywhere on the toolbar and pick the Bookmarks Button from the available icons and put it in the toolbar.

  • Apple ID is not the same as iCloud ID and I need to activate my phone.

    So my phone pooed itself and I had to reset it. That did not help and so I had to erase all of my settings. Upon getting to the activation page, it says that  my apple ID is not the same as my iCloud ID....although that is the only ID that I have ever used for my phone.
    Is there any way that I can remove my phone off of the iCloud and then proceed through activation a different way?
    Thank you very much for the help!

    No.  In order to reactivate your device have to provide the ID and password that were used to activate it originally.  If you are not the original owner, you will have to contact the original owner to either get the ID and password, or have him/her erase the device and remove it from their account as explained here: Find My iPhone Activation Lock: Removing a device from a previous owner’s account.  If you cannot contact the original owner you will not be able to activate and use your device.  No one else can help you with this and there is no way around it.

  • I just upgraded to iOS5.  I did not receive the info in my email to activate the icloud account.  My email adress is not the same as my Apple id, but my correct email adress is indicated in my account and in the msg indicating to check...

    i just upgraded to iOS5.  I did not receive the info in my email to activate the icloud account. My email adress is not the same as my Apple id, but my correct email adress is indicated in my account and in the msg indicating to check...

    Start here, change your country if necessary and go to manage your account and request another email.

  • HT204053 Seems my iCloud password is not the same as my iTunes.  Where do I go to reset my iCloud password?  I cannot access anything when prompted to put in my iCloud password because I do NOT KNOW it.  Thanks!

    Seems my iCloud password is not the same as my iTunes.  Where do I go to reset my iCloud password?  I cannot access anything when prompted to put in my iCloud password because I do NOT know it.  Thanks!  I've used my iTunes password for everything else Apple does and would like to use the same one for my iCloud.

    Do the following:
    Make sure you are signed into iMessage and FaceTime with your current ID.  If they are signed into the old ID, go to Settings>Messages>Send & Receive and Settings>FaceTime, tap the ID, sign out, then sign back in with your current ID.
    Then temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  (You should not have to verify the old email account so it doesn’t matter if you no longer have access to it.)  Now go to Settings>iCloud, turn off Find My iDevice and enter your current password when prompted (even though it prompts you for the password for your old ID).  Then go to Settings>iCloud, tap Sign Out (or Delete Account if you are not running iOS 8) and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address back to the way it was.  Now you can go to Settings>iCloud and sign back in with your current iCloud ID and password (your data will download back to your device).

  • The MAC signature found in the HTTP request '***' is not the same as any computed signature. Server used following string to sign: 'POST

    Hi,
    When trying with Postman sending a REST call to Azure Storage Queues I get:
    The MAC signature found in the HTTP request '***' is not the same as any computed signature. Server used following string to sign: 'POST.
    The code I have for creating the Authorization Header:
    var accountName = "my_account";
    string key = ConfigurationManager.AppSettings["my_access_key"];
    DateTime dt = DateTime.Now;
    string formattedDate = String.Format("{0:r}", dt);
    var canonicalizedHeaders = "x-ms-date:" + formattedDate + "\n" + "x-ms-version:2009-09-19" + "\n" ;
    var canonicalizedResource = "/my_account/myqueue/messages";
    var stringToSign = String.Format("POST,\n\n\n\n\n\n\n\n\n\n\n{0}{1}", canonicalizedHeaders, canonicalizedResource);
    stringToSign = HttpUtility.UrlEncode(stringToSign);
    HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(key));
    var signature = Convert.ToBase64String(hmac.ComputeHash(Encoding.UTF8.GetBytes(stringToSign)));
    var authorizationHeader = String.Format(CultureInfo.InvariantCulture, "SharedKey {0}:{1}", accountName, signature);
    return authorizationHeader;
    Anyone any idea what I'm missing/doing wrong?
    Additional question: do i have to create for every message I want to send a new Authorization header? Or is there an option (as with Service Bus Topics) to create a header that can be used for a certain timeframe?
    Thanks.

    One issue is with this line of code:
    HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(key));
    Please use the following:
    HMACSHA256 hmac = new HMACSHA256(Convert.FromBase64String(key));
    and that should take care of the problem.
    Regarding your question, "do i have to create for every message I want to send a new Authorization header? Or is there an option (as with Service Bus Topics) to create a header that can be used for a certain timeframe?"
    With your current approach, the answer is yes. What you can do is create a Shared Access Signature on the queue which will be valid for certain duration and then use that for posting messages to a queue using simple HttpWebRequest/HttpWebResponse.
    Hope this helps.

Maybe you are looking for