Strings with /' characters after return

I use embedded procedures a fair bit in my database driven web sites programming, so I decided to pre-buld my queries to expedite and simplify the process.
I wrote the following script:
#!/usr/bin/python
import MySQLdb
from uid_gdbm import *
proc_params = ('manage_codes','add',555,'Just a test') <-- test list
def buildquery():
items = len(proc_params)
#print items
prog_name = proc_params[0]
args ="%("
stgcount = ""
for i in range(1, len(proc_params)-1):
args += repr(proc_params[i])
stgcount += "'%s'"
for j in range (1, len(proc_params)-2):
args += ","
stgcount +=","
myquery = "\"call " + prog_name + "(" + stgcount + "'%s'" + ")\" " + args + repr(proc_params[(items -1)]) + ")"
print myquery < -- prints : "call manage_codes('%s','%s','%s')" %('add','555','Just a test')
return myquer <-- but after retuning it I get :"call manage_codes(\'%s\',\'%s\',\'%s\')" %(\'add\',\'555\',\'Just a test\')
as a result I get a MySQL error: ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'"call manage_codes(\'%s\',\'%s\',\'%s\')" %(\'add\',\'555\',\'Just a test\')\' at line 1')
Any ideas as to why this is  happening and more importantly how cay I get read of the \' escape characters?
Thanks.

Just put all the candidate characters in as a String constant, then pick them at random using Random.nextInt() and charAt()

Similar Messages

  • Fill string with characters

    I need to fill string 'ABC' with a character 'K', that string will now have 15 characters. Is that possible with sql?

    senza wrote:
    I need to fill string 'ABC' with a character 'K', that string will now have 15 characters. Is that possible with sql?SQL manual
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/toc.htm
    RPAD
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions157.htm#i78723
    SQL> select rpad('abc',15,'k') from dual;
    RPAD('ABC',15,'
    abckkkkkkkkkkkk
    SQL>

  • Problems with messaging after returning from overseas.

    I recently spent 2wks in Bali and switched to an Indonesian SIM card while there.
    When i returned to Australia i changed back to my Vodafone SIM but i've been having issues since then.
    When I message other people, instead of my name appearing as the "contact title" it has my email address. I am not receiving messages from some people unless they send it to the email address contact.
    For example, my sister has my phone number saved in her phone as "Lyndsey" but now whenever i message her it comes from a contact which is my email address.
    I also can't send messages to certain people. I will type the message and attempt to send it and the sending status bar will run very slowly, and then the whole message will just disappear as if I never typed it out. It doesn't even say "failed to send", it just disappears.
    I've tried turning the phone on and off, switching back an forth from flight mode, turning off iCloud, switching iMessage on and off, i've even reset the network settings.

    After you reset the network settings and switched off iMessage, when you switched it back on, did it activate? If you go in and check your Send & Receive, is your phone number listed there and does it have a checkmark by it? I've read other threads where people changing countries and SIMs having these issues. Also, if reset network settings did not work, try to reset all settings.

  • PL/SQL function to read a string of characters into an array

    I was wondering if there is an easier way than using the substr function multiple times. Here is the example:
    Suppose you have a varchar2 variable that contains the word 'Apple'. The function should take it and produce an array. We would invoke it like this:
    <what data structure?> a := stringunpackerfunction(x);
    // x is the varchar2 containing 'Apple'.
    The resulting a would be such that a[0] is 'A', a[1] is 'p', a[2] is 'p', a[3] is 'l' and a[4] is 'e'.
    If there is no direct function to do this in a single invocation, is there a function to simply read a string of characters and return 'the next character'?
    Thanks,
    Regards,
    Srini

    There is a procedure out there called PS_PARSE which takes a string and converts to an array provided with an identified separator. Works for us pretty well.
    I just grabbed this off of google. I am presuming this should work fine. It has been sometime since we implemented ours that I forget if there were any additional modifications that we made. I think there was one regarding the size of the string that could be handled. I forget precisely. Anyways... take a peek at it. Its makes things easy in that your logic is pretty streamlined.
    Barry C
    http://www.myoracleportal.com
    create or replace PACKAGE PS_Parse
    IS
         || PL/SQL table structures to hold atomics retrieved by parse_string.
         || This includes the table type definition, a table (though you can
         || declare your own as well, and an empty table, which you can use
         || to clear out your table which contains atomics.
         TYPE atoms_tabtype IS TABLE OF VARCHAR2(60) INDEX BY BINARY_INTEGER;
         atoms_table atoms_tabtype;
         empty_atoms_table atoms_tabtype;
         || The standard list of delimiters. You can over-ride these with
         || your own list when you call the procedures and functions below.
         || This list is a pretty standard set of delimiters, though.
         std_delimiters VARCHAR2 (50) := ' !@#$%^&*()-_=+\|`~{{]};:''",<.>/?';
         /* Display contents of table using DBMS_OUTPUT */
         PROCEDURE display_atomics
              (table_in IN atoms_tabtype, num_rows_in IN NUMBER);
         || The parse_string procedure: I provide two, overloaded definitions.
         || The first version puts all atomics into a PL/SQL table and would
         || be used in a PL/SQL Version 2 environment. The second version places
         || all atomics into a string, separating each atomic by a vertical bar.
         || (My code does NOT do any special handling when it finds a "|" in
         || the string. You have to deal with that when you extract the atomics.
         ||
         || See the program definition for more details on other parameters.
         PROCEDURE parse_string
              (string_in IN VARCHAR2,
              atomics_list_out OUT atoms_tabtype,
              num_atomics_out IN OUT NUMBER,
              delimiters_in IN VARCHAR2 := std_delimiters);
         PROCEDURE parse_string
              (string_in IN VARCHAR2,
              atomics_list_out IN OUT VARCHAR2,
              num_atomics_out IN OUT NUMBER,
              delimiters_in IN VARCHAR2 := std_delimiters);
         /* Count the number of atomics in a string */
         FUNCTION number_of_atomics
              (string_in IN VARCHAR2,
              count_type_in IN VARCHAR2 := 'ALL',
              delimiters_in IN VARCHAR2 := std_delimiters)
         RETURN INTEGER;
         /* Return the Nth atomic in the string */
         FUNCTION nth_atomic
              (string_in IN VARCHAR2,
              nth_in IN NUMBER,
              count_type_in IN VARCHAR2 := 'ALL',
              delimiters_in IN VARCHAR2 := std_delimiters)
         RETURN VARCHAR2;
    END PS_Parse;
    create or replace PACKAGE BODY PS_Parse
    IS
    /* Package variables used repeatedly throughout the body. */
    len_string     NUMBER;
    start_loc     NUMBER;
    next_loc     NUMBER;     
    || Since the PUT_LINE procedure regards a string of one or more
    || spaces as NULL, it will not display a space, which is in
    || PS_Parse a valid atomic. So I save a_blank in the PL/SQL
    || table instead of the space itself.
    a_blank CONSTANT VARCHAR2(3) := '" "';
    /*--------------------- Private Modules ---------------------------
    || The following functions are available only to other modules in
    || package. No user of PS_Parse can see or use these functions.
    FUNCTION a_delimiter
    (character_in IN VARCHAR2,
    delimiters_in IN VARCHAR2 := std_delimiters)
    RETURN BOOLEAN
    || Returns TRUE if the character passsed into the function is found
    || in the list of delimiters.
    IS
    BEGIN
    RETURN INSTR (delimiters_in, character_in) > 0;
    END;
    FUNCTION string_length (string_in IN VARCHAR2)
    RETURN INTEGER
    IS
    BEGIN
    RETURN LENGTH (LTRIM (RTRIM (string_in)));
    END;
    FUNCTION next_atom_loc
    (string_in IN VARCHAR2,
    start_loc_in IN NUMBER,
    scan_increment_in IN NUMBER := +1)      
    || The next_atom_loc function returns the location
    || in the string of the starting point of the next atomic (from the
    || start location). The function scans forward if scan_increment_in is
    || +1, otherwise it scans backwards through the string. Here is the
    || logic to determine when the next atomic starts:
    ||
    ||          1. If current atomic is a delimiter (if, that is, the character
    ||               at the start_loc_in of the string is a delimiter), then the
    ||               the next character starts the next atomic since all
    ||               delimiters are a single character in length.
    ||
    ||          2. If current atomic is a word (if, that is, the character
    ||               at the start_loc_in of the string is a delimiter), then the
    ||               next atomic starts at the next delimiter. Any letters or
    ||               numbers in between are part of the current atomic.
    ||
    || So I loop through the string a character at a time and apply these
    || tests. I also have to check for end of string. If I scan forward
    || the end of string comes when the SUBSTR which pulls out the next
    || character returns NULL. If I scan backward, then the end of the
    || string comes when the location is less than 0.
    RETURN NUMBER
    IS
    /* Boolean variable which uses private function to determine
    || if the current character is a delimiter or not.
    was_a_delimiter BOOLEAN :=
    PS_Parse.a_delimiter (SUBSTR (string_in, start_loc_in, 1));     
    /* If not a delimiter, then it was a word. */
    was_a_word BOOLEAN := NOT was_a_delimiter;
    /* The next character scanned in the string */
              next_char VARCHAR2(1);
    || The value returned by the function. This location is the start
    || of the next atomic found. Initialize it to next character,
    || forward or backward depending on increment.
    return_value NUMBER := start_loc_in + scan_increment_in;
    BEGIN
    LOOP
    -- Extract the next character.
    next_char := SUBSTR (string_in, return_value, 1);
    -- Exit the loop if:
    EXIT WHEN
    /* On a delimiter, since that is always an atomic */
    a_delimiter (next_char)
    OR
    /* Was a delimiter, but am now in a word. */
    (was_a_delimiter AND NOT a_delimiter (next_char))
    OR
    /* Reached end of string scanning forward. */
    next_char IS NULL
    OR
    /* Reached beginning of string scanning backward. */
    return_value < 0;
    /* Shift return_value to move the next character. */
    return_value := return_value + scan_increment_in;
    END LOOP;
    -- If the return_value is negative, return 0, else the return_value
    RETURN GREATEST (return_value, 0);
    END;
    PROCEDURE increment_counter
    (counter_inout IN OUT NUMBER,
    count_type_in IN VARCHAR2,
    atomic_in IN CHAR)
    || The increment_counter procedure is used by nth_atomic and
    || number_of_atomics to add to the count of of atomics. Since you
    || can request a count by ALL atomics, just the WORD atomics or
    || just the DELIMITER atomics. I use the a_delimiter function to
    || decide whether I should add to the counter. This is not a terribly
    || complex procedure. I bury this logic into a separate module,
    however,
    || to make it easier to read and debug the main body of the programs.
    IS
    BEGIN
    IF count_type_in = 'ALL' OR
    (count_type_in = 'WORD' AND NOT a_delimiter (atomic_in)) OR
    (count_type_in = 'DELIMITER' AND a_delimiter (atomic_in))
    THEN
    counter_inout := counter_inout + 1;
    END IF;
    END increment_counter;
    /* ------------------------- Public Modules -----------------------*/
    PROCEDURE display_atomics
    (table_in IN atoms_tabtype, num_rows_in IN NUMBER)
    || Program to dump out contents of table. Notice I must also pass in
    || the number of rows in the table so that I know when to stop the
    || loop. Otherwise I will raise a NO_DATA_FOUND exception. For a more
    || elaborate display_table module, see Chapter 7 on PL/SQL tables.
    IS
    BEGIN
    FOR table_row IN 1 .. num_rows_in
    LOOP
    DBMS_OUTPUT.PUT_LINE (NVL (table_in (table_row), 'NULL'));
    END LOOP;
    END;
    PROCEDURE parse_string
    (string_in IN VARCHAR2,
    atomics_list_out OUT atoms_tabtype,
    num_atomics_out IN OUT NUMBER,
    delimiters_in IN VARCHAR2 := std_delimiters)
    || Version of parse_string which stores the list of atomics
    || in a PL/SQL table.
    ||
    || Parameters:
    ||          string_in - the string to be parsed.
    ||          atomics_list_out - the table of atomics.
    ||          num_atomics_out - the number of atomics found.
    ||          delimiters_in - the set of delimiters used in parse.
    IS
    BEGIN
    /* Initialize variables. */
    num_atomics_out := 0;
    len_string := string_length (string_in);
    IF len_string IS NOT NULL
    THEN
    || Only scan the string if made of something more than blanks.
    || Start at first non-blank character. Remember: INSTR returns 0
    || if a space is not found. Stop scanning if at end of string.
    start_loc := LEAST (1, INSTR (string_in, ' ') + 1);
    WHILE start_loc <= len_string
    LOOP
    || Find the starting point of the NEXT atomic. Go ahead and
    || increment counter for the number of atomics. Then have to
    || actually pull out the atomic. Two cases to consider:
    ||          1. Last atomic goes to end of string.
    ||          2. The atomic is a single blank. Use special constant.
    ||          3. Anything else.
    next_loc := next_atom_loc (string_in, start_loc);
    num_atomics_out := num_atomics_out + 1;
    IF next_loc > len_string
    THEN
    -- Atomic is all characters right to the end of the string.
    atomics_list_out (num_atomics_out) :=
    SUBSTR (string_in, start_loc);
    ELSE
    || Internal atomic. If RTRIMs to NULL, have a blank
    || Use special-case string to stuff a " " in the table.
    atomics_list_out (num_atomics_out) :=
    NVL (RTRIM (SUBSTR (string_in,
    start_loc, next_loc-start_loc)),
                                       a_blank);
    END IF;
    -- Move starting point of scan for next atomic.
    start_loc := next_loc;
    END LOOP;
    END IF;
    END parse_string;
    PROCEDURE parse_string
    (string_in IN VARCHAR2,
    atomics_list_out IN OUT VARCHAR2,
    num_atomics_out IN OUT NUMBER,
    delimiters_in IN VARCHAR2 := std_delimiters)
    || The version of parse_string which writes the atomics out to a packed
    || list in the format "|A|,|C|". I do not repeat any of the comments
    || from the first iteration of parse_string.
    IS
    BEGIN
    /* Initialize variables */
    num_atomics_out := 0;
    atomics_list_out := NULL;
    len_string := string_length (string_in);
    IF len_string IS NOT NULL
    THEN
    start_loc := LEAST (1, INSTR (string_in, ' ') + 1);
    WHILE start_loc <= len_string
    LOOP
    next_loc := next_atom_loc (string_in, start_loc);
    num_atomics_out := num_atomics_out + 1;
    IF next_loc > len_string
    THEN
    atomics_list_out := atomics_list_out || '|' ||      
    SUBSTR (string_in, start_loc);
    ELSE
    atomics_list_out :=
    atomics_list_out || '|' ||      
    NVL (RTRIM (SUBSTR (string_in,
    start_loc, next_loc-start_loc)),
                                       a_blank);
    END IF;
    start_loc := next_loc;
    END LOOP;
    /* Apply terminating delimiter to the string. */
    atomics_list_out := atomics_list_out || '|' ;
    END IF;
    END parse_string;
    FUNCTION number_of_atomics
    (string_in IN VARCHAR2,
    count_type_in IN VARCHAR2 := 'ALL',
    delimiters_in IN VARCHAR2 := std_delimiters)
    RETURN INTEGER
    || Counts the number of atomics in the string_in. You can specify the
    || type of count you want: ALL for all atomics, WORD to count only the
    || words and DELIMITER to count only the delimiters. You can optionally
    || pass your own set of delimiters into the function.
    IS
    return_value INTEGER := 0;
    BEGIN
    /* Initialize variables. */
    len_string := string_length (string_in);
    IF len_string IS NOT NULL
    THEN
    || This loop is much simpler than parse_string. Call the
    || next_atom_loc to move to the next atomic and increment the
    || counter if appropriate. Everything complicated is shifted into
    || sub-programs so that you can read the program "top-down",
    || understand it layer by layer.
    start_loc := LEAST (1, INSTR (string_in, ' ') + 1);
    WHILE start_loc <= len_string
    LOOP
    increment_counter (return_value, UPPER (count_type_in),
    SUBSTR (string_in, start_loc, 1));
    start_loc := next_atom_loc (string_in, start_loc);
    END LOOP;
    END IF;
    RETURN return_value;
    END number_of_atomics;
    FUNCTION nth_atomic
    (string_in IN VARCHAR2,
    nth_in IN NUMBER,
    count_type_in IN VARCHAR2 := 'ALL',
    delimiters_in IN VARCHAR2 := std_delimiters)
    RETURN VARCHAR2
    || Find and return the nth atomic in a string. If nth_in is greater
    || the number of atomics, then return NULL. If nth_in is negative the
    || function counts from the back of the string. You can again request
    || a retrieval by ALL atomics, just the WORDs or just the DELIMITER.
    || So you can ask for the third atomic, or the second word from the end
    || of the string. You can pass your own list of delimiters as well.
    IS
    /* Local copy of string. Supports up to 1000 characters. */
    local_string VARCHAR2 (1000) :=
    LTRIM (RTRIM (SUBSTR (string_in, 1, 1000)));
    /* Running count of atomics so far counted. */
    atomic_count NUMBER := 1;
    /* Boolean variable which controls the looping logic. */
    still_scanning BOOLEAN :=
    local_string IS NOT NULL AND nth_in != 0;
    /* The amount by which I increment the counter. */
    scan_increment INTEGER;
    /* Return value of function, maximum length of 100 characters. */
    return_value VARCHAR2 (100):= NULL;
    BEGIN
    IF nth_in = 0
    THEN
    /* Not much to do here. Find 0th atomic? */
    RETURN NULL;
    ELSE
    /* Initialize the loop variables. */
    len_string := string_length (local_string);
    IF nth_in > 0
    THEN
    /* Start at first non-blank character and scan forward. */
    next_loc := 1;
    scan_increment := 1;
    ELSE
    /* Start at last non-blank character and scan backward. */
    next_loc := len_string;
    scan_increment := -1;
    END IF;
    /* Loop through the string until the Boolean is FALSE. */
    WHILE still_scanning
    LOOP
    /* Move start of scan in string to loc of last atomic. */
    start_loc := next_loc;
    /* Find the starting point of the next atomic. */
    next_loc      :=
    next_atom_loc (local_string, start_loc, scan_increment);
    /* Increment the count of atomics. */
    increment_counter
    (atomic_count,
    UPPER (count_type_in),
    SUBSTR (local_string, start_loc, 1));
    || Keep scanning if my count hasn't exceeded the request
    || and I am neither at the beginning nor end of the string.
    still_scanning :=
    atomic_count <= ABS (nth_in) AND
    next_loc <= len_string AND
    next_loc >= 1;
    END LOOP;
    || Done with the loop. If my count has not exceeded the requested
    || amount, then there weren't enough atomics in the string to
    || satisfy the request.
    IF atomic_count <= ABS (nth_in)
    THEN
    RETURN NULL;
    ELSE
    || I need to extract the atomic from the string. If scanning
    || forward, then I start at start_loc and SUBSTR forward.
    || If I am scanning backwards, I start at next_loc+1 (next_loc
    || is the starting point of the NEXT atomic and I want the
    || current one) and SUBSTR forward (when scanning in
    || reverse, next_loc comes before start_loc in the string.
    IF scan_increment = +1
    THEN
    RETURN
    SUBSTR (local_string, start_loc, next_loc - start_loc);
    ELSE
    RETURN
    SUBSTR (local_string, next_loc+1, start_loc - next_loc);
    END IF;
    END IF;
    END IF;
    END nth_atomic;
    END PS_Parse;
    /

  • PC Suite stops working with Bluetooth after Laptop...

    I use PC Suite and Bluetooth to connect to my Phone. I use the Synchronise, and the Messages feature a great deal. It all works great after a reboot, and I think it's a real credit to Nokia that they provide this free and improve their standing compared to other manufacturers.
    However, the latest versions of PC Suite have taken a backward step in hardware compatibility. Previously, no matter what state my laptop was in - ie rebooted, returned from hibernate or standby, the laptop would connect to my phone over Bluetooth, and synchronizing would happen. When my phone went out of range, the connection would drop, and when it came back into range, the connection would re-establish and synchronizing would start again - wonderful!
    Now, this only works after clean reboot, and after I have manually clicked on "Get Connected". After my laptop returns from standby, if I try "Get Connected" I get the error:
    "Cannot use the connection type. Check that all the needed hardware, software and drivers are available. (Code: OpenMedia)"
    To get PC Suite working with Bluetooth after returning from standby I run a Repair, after which it works beautifully.
    Is this a known fault? I have uninstalled and re-installed PC Suite and the BT Stack as recommended in other posts to solve other issues. My configuration is:
    Operating system: Microsoft Windows XP
    Nokia PC Suite: Version 6.82.22.0
    Bluetooth Stack for Windows by Toshiba v4.00.23(D) SP2
    Bluetooth Specification: Version 2.0, 1.2, 1.1
    Many thanks...

    Thanks for your response Miksu. You have pointed me to the right place. It is the connection manager that fails to recognise the BT stack that causes my problems. This is always resolved by a repair. It seems that the order of initiation is very important which may be why Luist has started to have the problem.
    In my experience, once things stop to work, I've had to strip out any subsequent installs.
    My PCSuite also stopped working after it installed cable connection manager (or something like that) without me asking. I found it in Control Panel->Add/Remove programs. I removed it and PC Suite started to work again, so I completely removed PC Suite then re-installed, and allowed it to add the relevant devices relating to my phone (about 4 devices alltogether) but alas this did not solve my "return from standby" issue. I think I need to remove PC Suite and then Bluetooth, and maybe something else before re-installing - I'll leave that for a rainy day.
    Thanks again Miksu

  • Have Firefox & Bing and when I open Firefox I get Ref A and string of characters; then when I get to Bing, no toolbar with bookmarks, etc or way to access mail.

    I made Bing my browser and it was working fine until today. When I open Firefox I get a message Ref A: and then a long string of characters. I click on the home icon and the string changes. After doing this several times I get the Bing search page. I do not get the Firefox start page with the tool bar that has my book marks, history etc. I cannot clear the cache if I cannot not get the history tab. If I go the the mozilla firefox program folder and open it, there is a tool bar but cannot clear recent history, etc. there. I do not have an administrator & password on my home desk top; it is just me. I tried to follow your suggestions, but they do not apply to my situation. I really don't know if this is a firefox or bing problem. I used google before bing and had no problems; just wanted to try bing.

    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Use a compressed image type like PNG or JPG to save the screenshot.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Double to String with 2 characters decimals

    How to a get a String from a Double with only 2 characters after the dot/comma ?
    chmurb

    double aDbl = XXXXX;
    DecimalFormat fmt = new DecimalFormat( "0.00;-0.00"
    String stringVal = fmt.format( aDbl );^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    a better answer than mine :)

  • Normal string ASCII characters are not shown after using string reversal.

    In a VI that I have written, there is a point where I take a simple 5 character string and input it to a reverse string node.  I also have an indicator on the output of the reverse string node so I can look at the reversed string.  Both the input and output indicators are in normal display mode.   For the input indicator I can see the input string with no problem.  But on the indicator at the output of the reverse string node I see nothing.  If I then put each of the indicators in HEX display mode, both indicators display the hex equivalent characters of the original ASCII characters, and the output indicator shows the characters reversed from that of the input indicator, as expected.  So why when I am in normal display mode, are the characters in the output indicator not showing up?  Thanks.

    What are the ASCII values that you are trying to display?  Perhaps they are non-printable ASCII values.
    Perhaps you can post a simple VI with the values in a string control and saved as a default.
    EDIT:  After seeing Rod's message, that seems very likely, especially considering that there is likely an EOL character if you are doing serial communication with some other device.
    Message Edited by Ravens Fan on 03-23-2009 12:04 PM

  • Inconsistent delivery balance after return with restocking fee

    My client does not like the work around she must use to delete negative delivery balances after returns are processed with a restocking fee. Here is her description of the problem:
    1. We receive this unit back from customer. When a return is created the unit is received back into stock and cost account is credited.
    2. We revised the unit and decided to accept the return but charge a 10% restocking fee which means we will give back to the customer only 90% of what he paid for the unit.
    When a credit memo is created, the customer receives the credit and the revenue account is debited. Also the base return document is closed.
    3. However the system indicates that there is a negative delivery amount of $509 (On the BP master screen)  We donu2019t want to see that balance; there is no document open linked to that balance.
    If I do the same process, but add the total credit amount to the unit price directly the system does not show this negative balance even though the total amount of the return document is different than the total amount of the credit memo.
    In order for me to clear that balance, I needed to create a return, copy it to a credit memo, and create an invoice to offset the invoice.
    Is ther a better way to do this?

    The proper way to do it would be full credit plus new service invoice to complete this transaction.  The restocking fee s a new charge to customer.  That process will reflect the true financial transaction.
    Thanks,
    Gordon

  • When accessing certain websites, I am met with a random string of characters in the browser window. What could be causing this?

    When trying to access certain websites, http://redditenhancementsuite.com/ or http://www.channel4.com/programmes/the- ... od#3293733 for example, all I get is a random string of characters in my browser window like the following:
    ‹­XmoÛ6þ>`ÿáª/Ý€ZÊËú²Í6Ð%ÍZ¬íŠ&A±O%щTI*®‡ýø='J¶”8^†._L‰wÇ{yîá)ÓG§¿Ÿ\üñᜟx÷vþí7ÓÂWeû+Eο•ô‚ ïë‰üÜš›YtbŽ—ÚO.ÖµŒ(O³ÈË/>aåŸ)+„uÒÏ¿˜ŒˆØˆWŸ”ó2Ï•§Wº:“ŒÐy£Œœ&a‚¥Ò×de9‹œ_—ÒRúˆ<ŽêNÈœ‹š°r1‹¬t1?Îÿ›Z$kœ7ÕÄp#¹úÜH»ž4jr¿ˆŸÅa7‡S.³ªöC/®Äo#r6›Eœ Ÿ’$3¹Œƒ¹83Uoù0~WJÇWpvšExý»É•ëÜqïŽÅ‡¹º5/Y–r"Ž(×^enìàÃÍUâ+ƒ‹ÆVwNOŠ€A8’š| aÅï€Åšhš«›v%0Ú‚"A†UµUQ•XJ—”fiâZ/#Z©Ü³èèé@$Õ²ðxx—¹YÄ‚\!qÛjmMÌØÞa<õzÂÛ#ûÇ°ÙÛçug²ìà„i"˜¶‘¶Q!B-BTÓ†‘ð‡¶˜"ìÍeµh¢hþÚTh"Ï!žC%7+]‘‡zua­YEóÓnsŸ…Ÿá~I8ë÷©@z²ºWùøêœÎðžOe›å_ !Qûds“5Ì Â+£;·N‡ïö)‹Zu*/?ŒÙ'˜¬Ôµÿ»ŸEŠ¥Ð×ÑüÞîS©i|¯GÂÓ€-ì4 …fL/­iêŸ.®(óf€xÿŸ+BØÀVq8ç¬þÄÇ€gŒí°OЄÀ¿Ò©¥–9žœÒKÇüíL œ rz鳊,ךPý%ÒRR.\‘aóâçMÊ|–Jò†rå èPòèK‘£îwxg¬€…*œŽp…LÍ¥Ü%xYçÂÃé÷òFZ\9‹‡Ëd‡ÙSÕ¥ôÎÛmÀ—šóƃ®ÜZˆ¶§ŽÝ]’yÁíuOçcwÜùÏÜvþ‹£™ ×ûR"NN4¿‰Cýz&xšK¿ uŒÜãVÚm|;<ÌÛ;ošÔœ="" ò1êgôt;®]ôÍ+ÐÖ1]:0ªŒ‘ÛpJç;G †ÑÆ«…‚%€‚広ÜȲ6T rawpgYàÜñ•9J†ˆ®‘›“vŒ€Ó-_ö›”5S˜©cw\%Ê~bÞE Ñ#@8BšrÔ8DGN°fLï'¡×S誇#gCÑ1+žU0óàòŒLÀG‰Ë‡Ó5Á‚äºMËöÌ'H*ŸŽ…š®‹ZT„)¹‘­ûˆ.P%£îRU*\Äp?dÚÏ^J‡ëù«Áˆ‚õ7ù0™ÝØvJ2€­—倕:)*Î.œUºODÈïškÙ˜rú±§+TS#òÜè Zñ1£Ûš”ß—br|‹F·”òókºB’j‘]£\mMR¢XŠì\ãðÿožËJ42“9ÞÍùþèoCÁí¢·ÁÁcÐX·ÃóæîK¶C$ý}ï8šGr·žål0 ŽäöL…#¹]£àHàAóßHãÎÐ7Úý—Io${ÏxÇùçaÎRÒç—ñ„P–VTøZ[RºÞŽÝ'ãjµŠ|x@UÖø€5Õ݉óÜcö¡s“JÜVbNßm*70Ý~x‚3l24͇Olã{º|ƒ;•ÂûüÊ…V²Ìōʙ¡ônßN[)zÉwS§ÊÁÌâãÕø¹u°ŠŠÉµÈoÒ}‚¿*þò—ÔTÄ
    The characters change depending on the website. I've tried disabling all extensions and plugins, reinstalling firefox and reinstalling java to no avail. The issue seems to be isolated to firefox, chrome is able to display the webpages without a problem. The problem occures following a malware in infection which would redirect goolgle searches in firefox. It was dealt with using Malwarebytes Anti-malware and by removing some entries from C:\WINDOWS\system32\drivers\etc\hosts file.

    Hi,
    I tried everything above but to no avail. Windows firewall seemed to be allowing Firefox through without it actually being in the exception list. However, I did remove Firefox but this time removing all profile data too. Reinstalling Firefox seemed to make the websites work. However I then restored my bookmarks, and suddenly the websites stopped functioning again, displaying the random string of characters. Could this be an issue with my bookmarks?

  • Owa_text.vc_arr: can't handle the string with more than 4000 characters?

    In the Oracel Web Application Server 4.0 documment, it says
    about owa_text.vc_arr :Type vc_arr is table of varchar2(32767)
    index by binary_integer.
    I amusing PL_SQL with Oracle8i and OWA4.0 web server.I want to
    use owa_text.vc_arr to pass the multple line texts in my form.
    If the text length is less than 4000 characters, everything works
    fine.However when the texts are longer than 4000 characters but
    less than the max length 32767 characters, I got this error
    message:
    OWS-05101: Execution failed due to Oracle error 2005
    ORA-02005: implicit (-1) length not valid for this bind or define
    datatype.
    Owa_text.vc_arr is supposed to handle the string with more
    than 4000 characters, is it true? Could anyone tell me why? Any
    help will be greatly appreciated!!!
    Thanks very much.
    Helena Wang
    Here is the pl_sql procedure to create my form:
    PROCEDURE myform
    IS
    BEGIN
    htp.p('
    <form action="'||service_path||'helena_test.saveform3"
    method=post>
    <input type=hidden name=tdescription value="X">
    Input1: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    Input2: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    <input type=submit name=WSave value="Save">
    </form>
    END;
    /***** here is the pl_sql procedure which I use to save the
    form***/
    procedure saveform3(tdescription in owa_text.vc_arr,
    WSave in varchar2 default 'No')
    is
    len pls_integer;
    begin
    for i in 2..tdescription.count loop
    len := length(tdescription(i));
    htp.p(len);
    htp.p(tdescription(i));
    end loop;
    end;

    Helena, I think you might get a better response either from the SQL-PL/SQL forum, or perhaps the Portal Applications forum - both of these tend to have folks very familiar with PL/SQL and the OWA packages.
    This forum is on Web services based on SOAP, WSDL and UDDI. These can be PL/SQL based but typically don't use the mod_psql or OWA web solution.
    As a pointer, I suspect you may already be familiar with, but just in case, you can always take a look at chapter 3 of the OAS documentation, "Developer's Guide: PL/SQL and ODBC Applications" where they go through a number of examples using parameters. See:
    http://technet.oracle.com/doc/appsrvr4082/guides/plsql.pdf
    Hope this or folks from the other list can help.
    Mike.

  • Why can't  owa_text.vc_arr  handle the string with more than 4000 characters?

    I am using PL_SQL with Oracle8i and OAS 4.0 web server.I want to
    use owa_text.vc_arr to pass the inputs in serval text areas in the form on a web application.
    If the input string length is less than 4000 characters, everything works fine.However when the strings are longer than 4000 characters but less than the max length 32767 characters, I got this error message:
    OWS-05101: Execution failed due to Oracle error 2005
    ORA-02005: implicit (-1) length not valid for this bind or define datatype.
    In the Oracle Application Server 4.0 documment, it says
    about owa_text.vc_arr :Type vc_arr is table of varchar2(32767)
    index by binary_integer. It means that owa_text.vc_arr can handle multiple strings and each string can have up to 32767 single byte characters, is it right?
    Owa_text.vc_arr is supposed to handle the string with more
    than 4000 characters, is it true? Could anyone tell me why? Any
    help will be greatly appreciated!!!
    Thanks very much.
    Helena Wang
    Here is the pl_sql procedure to create my form on the web:
    PROCEDURE myform
    IS
    BEGIN
    htp.p('
    <form action="'||service_path||'helena_test.saveform3"
    method=post>
    <input type=hidden name=tdescription value="X">
    Input1: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    Input2: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    <input type=submit name=WSave value="Save">
    </form>
    END;
    /***** here is the pl_sql procedure which I use to save the
    form***/
    procedure saveform3(tdescription in owa_text.vc_arr,
    WSave in varchar2 default 'No')
    is
    len pls_integer;
    begin
    for i in 2..tdescription.count loop
    len := length(tdescription(i));
    htp.p(len);
    htp.p(tdescription(i));
    end loop;
    end;

    The maximum size of a VARCHAR2 field in Oracle 8i is 4000 bytes.
    you'll ned to use a LOB type (or LONG if you prefer the old way)

  • TS3276 I need feedback for the following issue. When I send email from this 27 inch iMac, the computer adds a string of characters in vertical column that represents the QWERTY key board, all alpha numeric characters are included. Yahoo mail, issue only o

    Restating my issue / question...
    When I send email from this iMac, there is a string of characters assigned. The characters are all the "alpha numeric" characters on the QWERTY key board. This only occurs when email is sent from this iMac. The issue does not manifest when using any other lap top or computer.
    Hence, I have ruled out the issue is a yahoo mail matter.
    Again, I can access the Yahoo mail account form multiple devices and send email without unintended assignment of character strings, but when I send wmail using this iMac, the issue happens everytime.
    Characters are stacked verticaly in a column. It looks as if all characters (except function keys) are included in the string.
    Any ideas?
    GMc

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The following procedure will help identify which such modifications you've installed. Don’t be alarmed by the complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing. 
    Below are instructions to enter some UNIX shell commands. The commands are harmless, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. 
    Some of the commands will line-wrap or scroll in your browser, but each one is really just a single line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it. The headings “Step 1” and so on are not part of the commands. 
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. The other steps should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply. 
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click the line of text below to select it:
    kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}' | open -f -a TextEdit 
    Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). A TextEdit window will open with the output of the command. Post the contents of that window, if any — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
    Step 2 
    Repeat with this line:
    { sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; sudo defaults read com.apple.loginwindow LoginHook; } | open -f -a TextEdit 
    This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. 
    Note: If you don’t have a login password, you’ll need to set one before taking this step. If that’s not possible, skip to the next step. 
    Step 3
    launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)/{print $3}' | open -f -a TextEdit 
    Step 4
    ls -1A /e*/mach* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts 2> /dev/null | open -f -a TextEdit  
    Important: If you formerly synchronized with a MobileMe account, your me.com email address may appear in the output of the above command. If so, anonymize it before posting. 
    Step 5
    osascript -e 'tell application "System Events" to get name of every login item' | open -f -a TextEdit 
    Remember, steps 1-5 are all copy-and-paste — no typing, except your password. Also remember to post the output. 
    You can then quit Terminal.

  • String with length 1 became 4 when nls_lang_semantics=CHAR

    Hi,
    We are using Oracle 9.2.0.1 database with charset = UTF-8, and we have set nls_lang_semantics=CHAR.
    We got a problem in our java program is that for a column with char(1), after I insert a java constant 'Y', the result I get back from select is a string of 'Y ', i.e. the string returned is not a string with length=1, but with length=4!! How can I correct the problem to get a string with length=1?
    Regards,
    Roy

    Hi,
    Thanks for the responses but I don't think you're quite right. Forms 6i should indeed work with Unicode as a database character set as long as it is UTF8 rather than AL32UTF8. This can be seen in various Metalink documents and also in the Release 6i Guidelines for Building Applications here (section 4.1.5):
    http://download-west.oracle.com/otn_hosted_doc/forms/forms/A73073_01.pdf
    The problems started when I changed NLS_LENGTH_SEMANTICS to CHAR. Its understandable if Forms 6i does not recognise this setting as it pre-dates it but I wanted to confirm this.
    We want to migrate our existing application to work with multibyte characters. Unfortunately there are table columns, PL/SQL variables etc. that are too small when defined as a length in bytes.
    I am looking for the least impact method to rectify this. On the server I can use NLS_LENGTH_SEMANTICS but if I can't get Forms to work with it then I may need to rethink.
    I realise that using Forms 9i or 10g would support the parameter but it is not possible to upgrade at the moment.
    Has anyone any other suggestions or methods for migrating an application to using multibyte characters?
    Thanks again,
    Kevin.

  • Converting strings with line feeds to a single line with identifying chars

    Hi, I dont want to re invent the wheel if there is something out there that does this already. I want to take some string with multiple
    line feeds and convert it to a single line. For example:
    "I want this string
    to be changed to
    a single line"
    to this...
    "I want this string\r\n to be changed tor\\n a single line"

    vsekvsek wrote:
    OK, Hope this will make better sense. So right now a I have a routine that loads files like below:
    "TEST\r\n TEST1\R\n TEST2"It's not clear to me at this point what you mean by that string.
    After the initial word TEST, does that string have a backslash character followed by an r followed by another backslash followed by an n? Or does it have a carriage return followed by a line feed. (\r followed by \n)
    We format it when loading in a way that it will look like this when queriing from the DB
    "TEST
    TEST1
    TEST2"It doesn't look like anything "when querying from the DB." That part doesn't make any sense.
    Either the string has a backslash followed by an r, in which case when you render in in a text editor or on a console it will look like a single line with a visible backslash character followed by an r, or it has a carriage return (\r) in which case it will look like multiple lines when rendered in a text editor or on a console.
    Later I re-extract it to a file from the DB and What confuses me is when I inspect the string it looks like this
    "TEST\r\n TEST1\R\n TEST2"How are you inspecting it? If it's in a debugger or similar tool, it's not uncommon for it to be showing a carriage return character (\r) as a visible backslash followed by an r, rather than interpreting it and rendering a new line. This is so that you can see exactly what characters are in there, rather than wondering about the specific whitespace.
    >
    but it extracts to my file like
    "TEST
    TEST1
    TEST2"
    So I guess there are some hidden cr's or something messing it up that I need to manipulate but not sure how to apprach it?I still don't know what you're trying to do, or if you even have an actual problem with your data or are simply not understanding what you're seeing.

Maybe you are looking for