Passing Order By String to Cursor

Hello, I am attempting to do the following:
Pass a parameter to a cursor that tells the cursor what to order by. I.e., if user clicks a date column, the tablename_datecolumn string is passed to the cursor. I thought this would have been relatively simple. However, for some reason, I can't get the following to work:
PROCEDURE my_procedure (pv_sort_code IN VARCHAR2 DEFAULT NULL)
IS
CURSOR lcur_requests (pv_sort_code IN VARCHAR2)
IS SELECT column1, column2, column3 FROM table1 WHERE column1 = item_id ORDER BY pv_sort_code ASC;
BEGIN
OPEN lcur_requests (pv_sort_code);
LOOP
FETCH lcur_requests INTO lv_value1, lv_value2, lv_value 3;
EXIT WHEN lcur_requests%NOTFOUND;
END LOOP;
END my_procedure;
When the above procedure gets called, it is aware of the pv_sort_code, which can equal any of the following:
pv_sort_code = column1, column2 -or- column3
Any ideas as to how I can accomplish the dynamic order by in the cursor?
Thanks ahead of time.

Here is a sample example of doing it using Dynamic SQL + Collections:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> set serveroutput on
SQL> select * from my_tab;
        C1         C2
         1          5
         2          4
         3          3
         4          2
         5          1
SQL> declare
  2      sort_order1 varchar2(100) := 'c1,c2';
  3      sort_order2 varchar2(100) := 'c1 desc,c2';
  4 
  5      type my_tab_rtype is table of my_tab%rowtype index by binary_integer;
  6      my_tab_rows my_tab_rtype;
  7 
  8      str1 varchar2(32000) := 'select * from my_tab order by '||sort_order1 ;
  9      str2 varchar2(32000) := 'select * from my_tab order by '||sort_order2 ;
10  begin
11      execute immediate str1 bulk collect into my_tab_rows;
12          dbms_output.put_line('Sort Order :: ' || sort_order1);
13          dbms_output.put_line('c1 c2');
14          dbms_output.put_line('-----');
15      for i in my_tab_rows.first..my_tab_rows.last loop
16          dbms_output.put_line(my_tab_rows(i).c1 || ' ' || my_tab_rows(i).c2);
17      end loop;
18     
19      dbms_output.put_line(chr(10));
20     
21      execute immediate str2 bulk collect into my_tab_rows;
22          dbms_output.put_line('Sort Order :: ' || sort_order2);
23          dbms_output.put_line('c1 c2');
24          dbms_output.put_line('-----');
25      for i in my_tab_rows.first..my_tab_rows.last loop
26          dbms_output.put_line(my_tab_rows(i).c1 || ' ' || my_tab_rows(i).c2);
27      end loop;
28  end; 
29  /
Sort Order :: c1,c2
c1 c2
1 5
2 4
3 3
4 2
5 1
Sort Order :: c1 desc,c2
c1 c2
5 1
4 2
3 3
2 4
1 5
PL/SQL procedure successfully completed.
SQL>

Similar Messages

  • How to pass a litral string into cursor variable?

    Hi All
    I have a code like below:
    I need to select the following table,column with the criteria as such but it looks like the literal string does not work for cursor variable.
    I can run the SQL in sqlplus but how I can embed that in PL/SQL code??
    -Thanks so much for the help
    cursor ccol2(Y1 varchar2) is select table_name,column_name from user_tab_columns
    where table_name like 'HPP2TT%' and table_name like '%Y1'
    and column_name not in ('MEMBERID');

    Literal strings are fine in a cursor, however, your logic is likely wrong, and you are not using the Y1 parameter to the cursor correctly. If you are looking for tables that either start with HPP2TT or end with Y1 (whatever you pass as Y1), then you need something more like:
    cursor ccol2(Y1 varchar2) is
    select table_name, column_name
    from user_tab_columns
    where (table_name like 'HPP2TT%' or
           table_name like '%'||Y1) and
          column_name not in ('MEMBERID');In the unlikely event that you are lookig for table that actually do start with HPP2TT and end in whatever is passed in Y1 then your query could be simplified to:
    cursor ccol2(Y1 varchar2) is
    select table_name, column_name
    from user_tab_columns
    where table_name like 'HPP2TT%'||Y1 and
          column_name not in ('MEMBERID');Note in both cases, a single member in-list is bad practice, although Oracle will transform it to an equality predicate instead.
    John

  • Passing / parsing XML String IN / OUT from PL / SQL package

    Hello, People !
    I am wondering where can I find exact info (with code sample) about following :
    We use Oracle 8.1.6 and 8.1.7. I need to pass an XML String (could be from VARCHAR2 to CLOB) from VB 6.0 to PL/SQL package. Then I need to use built in PL/SQL XML parser to parse given string (could be large hierarchy of nodes)
    and the return some kind of cursor thru I can loop and insert data into
    different db Tables. (The return value may have complex parent/child data relationship - so I am not sure If this should be a cursor)
    I looked online many site for related info - can't find what I am looking
    for - seems like should be a common question.
    Thanx a lot !

    Hello, People !
    I am wondering where can I find exact info (with code sample) about following :
    We use Oracle 8.1.6 and 8.1.7. I need to pass an XML String (could be from VARCHAR2 to CLOB) from VB 6.0 to PL/SQL package. Then I need to use built in PL/SQL XML parser to parse given string (could be large hierarchy of nodes)
    and the return some kind of cursor thru I can loop and insert data into
    different db Tables. (The return value may have complex parent/child data relationship - so I am not sure If this should be a cursor)
    I looked online many site for related info - can't find what I am looking
    for - seems like should be a common question.
    Thanx a lot !

  • Passing comma separated string to stored procedure

    Hi,
    There is thread with same query I created earlier and that was answered. That solution worked if I pass comma separated string containing IDs. But due to changes in the logic, I have to pass usernames instead of userIDs. I tried to modify the solution provided to use with this.
    Following the link to previous post :
    Re: Passing comma separated string to stored procedure
    ------Package-------
    TYPE refcurQID IS REF CURSOR;
    TYPE refcurPubs IS REF CURSOR;
    procedure GetAllPersonalQueue (p_user_name in nvarchar2, TestQID OUT Test.refcurQID
    , TestPubs OUT Test.refcurPubs);
    ------Package-------
    ------Package Body-------
    PROCEDURE GetAllPersonalQueue (p_user_name in nvarchar2, TestQID OUT Test.refcurQID, TestPubs OUT Test.refcurPubs) as
    BEGIN
    Open TestQID for
    select id from cfq where name in (p_user_name);
    Open TestPubs for
    SELECT qid FROM queues WHERE qid in(
    select id from cfq where name in (p_user_name));
    END GetAllPersonalQueue;
    ------Package Body-------
    Thanks in advance
    Aditya

    Hi,
    I modified the query as per the solution provided by isotope, after which the logic changed and I am passing username instead of userID in comma separated string.
    Following is the changes SP, which does not throw any error, but no data is returned.
    PROCEDURE GetAllPersonalQueue (p_user_name in nvarchar2, TestQID OUT Test.refcurQID, TestPubs OUT Test.refcurPubs
    ) is
    --local variable
    strFilter varchar2(100);
    BEGIN
    Open TestQID for
    select id, name from cfq where name in
    select regexp_substr(p_user_name||',','[a-z]+[0-9]+',1,level)
    from dual
    connect by level <= (select max(length(p_user_name)-length(replace(p_user_name,',')))+1
    from dual)
    Open TestPubs for
    SELECT qid FROM queues WHERE qid in(
    select id from cfq where name in
    select regexp_substr(p_user_name||',','[a-z]+[0-9]+',1,level)
    from dual
    connect by level <= (select max(length(p_user_name)-length(replace(p_user_name,',')))+1
    from dual)
    END GetAllPersonalQueue;
    Edited by: adityapawar on Feb 27, 2009 8:38 AM

  • Pass SNMP community string a scripted monitor parameter in SCOM 2012

    Hi,
    Following the advice given here http://social.technet.microsoft.com/Forums/systemcenter/en-US/606d793c-b559-40b5-865a-ae312ee483d7/snmp-monitor-compare-oid-to-current-date
    I created a scripted monitor to poll the value of a SNMP OID and compare it to the current system date.
    It works perfectly fine, but I can't find how to pass the community string to the script in order to avoid having to hardcode it in clear text in the script... It seems this was published as a Target's Property with SCOM 2007 (like described here : http://www.burkard.it/2011/10/create-a-calculated-snmp-monitor/
    ) but that it's not the case anymore with SCOM 2012 (likely because SCOM 2012 now uses RunAs accounts to store community strings, I guess).
    So, what is the correct way to achieve this?
    Thanks!

    Ok, I just found the solution myself, it was quite easy actually (but as often not really documented anywhere) :
    you just have to pass this as a parameter :
    $RunAs[Name="NetworkLibrary!System.NetworkManagement.Snmp.MonitoringAccount"]/CommunityString$
    instead of the scom2007 property which was :
    $Target/Property[Type="NetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice"]/CommunityString$
    And that's it, you don't even need to decode the string in your script as it was the case with scom 2007.

  • Passing in values to a cursor in a package procedure

    Hi all
    I have a package :- test
    i have a procedure in the package :- test_proc
    in the procedure i have a cursor
    which has a select statement
    select jobid,jobname from jobs
    where jobcode = p_job_code; -- i think this is wrong
    when i execute the package i pass the job code to the package as a parameter which i use in the cursor above
    as a parameter i have values(i can select any of the above values )
    job code :-
    10
    20
    10,20
    how can i pass the values to the cursor in the procedure
    it is giving me invaiid number;

    Dear abcdxyz!
    As already stated you should try this with dynamic SQL. Here is an example for you:
    CREATE OR REPLACE PROCEDURE job_cursor(p_job_code VARCHAR2)
    IS
      l_jobid      NUMBER(5);
      l_jobname    VARCHAR2(30);
      c_job_cursor INTEGER;
      l_ignore     INTEGER;
    BEGIN
      -- open cursor on source table
      c_job_cursor := DBMS_SQL.Open_Cursor;
      -- parse the SELECT statement
      DBMS_SQL.parse(c_job_cursor, 'SELECT jobid, jobname FROM job WHERE job_code IN (' || p_job_code || ')', DBMS_SQL.NATIVE);
      -- define the column type
      DBMS_SQL.Define_Column(c_job_cursor, 1, l_jobid);
      DBMS_SQL.Define_Column(c_job_cursor, 2, l_jobname, 30);
      ignore := DBMS_SQL.Execute(c_job_cursor);
      LOOP
      -- Fetch a row from the source table
        IF DBMS_SQL.Fetch_Rows(c_job_cursor) > 0 THEN
            -- get column values of the row
            DBMS_SQL.Column_Value(c_job_cursor, 1, l_jobid);
            DBMS_SQL.Column_Value(c_job_cursor, 2, l_jobname);
        ELSE
           -- No more rows to copy
          EXIT;
        END IF;
      END LOOP;
      DBMS_OUTPUT.PUT_LINE(l_jobid || ', ' || l_jobname);
      DBMS_SQL.Close_Cursor(c_job_cursor);
    EXCEPTION
      WHEN OTHERS THEN
        IF DBMS_SQL.Is_Open(c_job_cursor) THEN
          DBMS_SQL.Close_Cursor(c_job_cursor);
        END IF;
        RAISE;
    END;
    /Yours sincerely
    Florian W.
    P.S. I haven't tested this procedure.

  • How to fix a problem with the order of strings in a JSON response for a CFHTTP request?

    Good morning, guys! (It's 10:50 a.m. in Brazil)
    First of all, I'm still new at CF and my questions may seem too much silly and my English's not the best, so, please be patient with me. hehe
    Well, I'm accessing a link via CFHTTP that gives me a JSON response. I'm not familiar with JSON yet, so I'm working it as a string and using string functions (Find,RemoveChars,Replace,etc), but it happens to me that I'm receiving a certain kind of order of the strings list from the JSON when I access it directly from the browser and other kind of order totally different when I access it from the CFHTTP.
    I only figured it out because I was working at home with my code and there everything went just fine as expected. Then I brought to my job to develop a little bit more as soon as I get a free time and here my code doesn't work anymore. When I took a look at the JSON by a CFOUTPUT, I realized the strings were in a different order.
    Does anyone know why is it happening?
    Link to the JSON: http://sigmine.dnpm.gov.br/ArcGIS/rest/services/extra/dados_dnpm/MapServer/0/query?text=83 0620/2012&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelInter sects&where=&returnGeometry=true&outSR=&outFields=FID,Shape,PROCESSO,ID,NUMERO,ANO,AREA_HA ,FASE,ULT_EVENTO,NOME,SUBS,USO,UF&f=pjson
    Basic code simplified to find out that the order of strings were coming different when access by CFHTTP:
    <cfhttp url="#URLAbove#" method="get" result="DadosDoDNPM" charset="utf-8" timeout="10000" />
    <cfset DadosJSON = deserializeJSON(DadosDoDNPM.FileContent) />
    <cfif arrayLen(DadosJSON.features)>
        <cfset CodigoFonteJSON = ToString(serialize(DadosJSON.features)) />   
        <cfoutput> #CodigoFonteJSON# </cfoutput>
    </cfif>
    Is there a way to fix it and to make my code work everywhere?
    If it matters, I use Railo at home and at my job.
    Since now, I thank you.

    When you deserialize JSON data, ColdFusion converts it into native structures and arrays (roughly equivalent to JavaScript objects and arrays).  In ColdFusion, structures are unordered (that is, they don't maintain keys in any particular ordered sequence).
    This really shouldn't be a problem though, at least not if you just want to work with the data contained in the deserialized JSON structure.  So DadosJSON should be a native ColdFusion structure, and you can interact with it like any other structure in ColdFusion.  In fact, you should not have to re-serialize it at all unless you need to send it to an external application using JSON.
    Why are you reserializing the data?  And why use serialize() instead of serializeJSON()?
    -Carl V.

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part

    Hi,
    I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
    http://server/pages/Default.aspx?Title=Arup&Title=Ratan
    But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
    I have followed the
    http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
    Please suggest me.
    Thanks | Arup
    THanks! Arup R(MCTS)
    SucCeSS DoEs NOT MatTer.

    Hi DH, sorry for not being clear.
    It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
    (or a Performance Point Dashboard etc.) and you insert it into your page and add
    a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
    with multiple values for one parameter. If you have any more questions let me know. See you, Ingo

  • Sun Studio 12u1 cc passes empty filename strings to the linker

    Hi,
    Sun Studio 12u1 cc passes empty filename strings to the linker, as demonstrated with the following
    trivial test case.
    This problem occurs while trying to compile the Boost 1.42 beta 1 libraries with Sun Studio 12u1.
    goanna% cat e.c
    int main()
    return 0;
    goanna% cc -V
    cc: Sun C 5.9 SunOS_i386 Patch 124868-11 2009/11/21
    usage: cc [ options] files. Use 'cc -flags' for details
    goanna% cc "e.c" ""
    goanna% kde12u1
    goanna% cc -V
    cc: Sun C 5.10 SunOS_i386 Patch 142363-03 2009/12/03
    usage: cc [ options] files. Use 'cc -flags' for details
    goanna% cc "e.c" ""
    ld: fatal: file : open failed: No such file or directory
    ld: fatal: File processing errors. No output written to a.out
    goanna%
    Thanks, Mark

    Thanks for filing the bug report. It will be visible at [http://bugs.sun.com] in a day or two as bug 6921481.

  • Order by clause in cursor problem

    Hello,
    I'm unable to compile package body when i'm using order by clause in cursor subquery in stored procedure.
    Sample code:
    CREATE PACKAGE Announces AS
    TYPE tRefCur IS REF CURSOR;
    PROCEDURE TopAnnounces(
    iiCount IN NUMBER,
    osAnnounces OUT tRefCur,
    oiRetVal OUT NUMBER
    END Announces;
    CREATE PACKAGE BODY Announces AS
    PROCEDURE TopAnnounces(
    iiCount IN NUMBER,
    osAnnounces OUT NUMBER,
    oiRetVal OUT NUMBER
    AS
    BEGIN
    OPEN osAnnounces FOR
    SELECT Id, Name, AnnCount FROM
    SELECT Id, Name, COUNT(CategoryId) AS AnnCount FROM tblAnnounces
    GROUP BY Id, Name
    -- bellow is the line, where the code crash
    ORDER BY AnnCount DESC
    WHERE ROWNUM < iiCount + 1;
    oiRetVal := 0;
    EXCEPTION
    WHEN OTHERS THEN
    oiRetVal := -255;
    END TopAnnounces;
    END Announces;
    If I compile the code above I will get this error:
    PLS-00103: Encoutered the symbol "ORDER" when expecting on of the following:
    After I remark the problematic line, the compilation is successful (but not the result :).
    Is there something I'm doing wrong?
    Thanks for advice
    Vojtech Novacek
    null

    Sorry you can not use order by clause into one temporal table created by subquery.
    Put the order by clause offside of subquery.
    Atte.
    CC.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Vojtech Novacek:
    Hello,
    I'm unable to compile package body when i'm using order by clause in cursor subquery in stored procedure.
    Sample code:
    CREATE PACKAGE Announces AS
    TYPE tRefCur IS REF CURSOR;
    PROCEDURE TopAnnounces(
    iiCount IN NUMBER,
    osAnnounces OUT tRefCur,
    oiRetVal OUT NUMBER
    END Announces;
    CREATE PACKAGE BODY Announces AS
    PROCEDURE TopAnnounces(
    iiCount IN NUMBER,
    osAnnounces OUT NUMBER,
    oiRetVal OUT NUMBER
    AS
    BEGIN
    OPEN osAnnounces FOR
    SELECT Id, Name, AnnCount FROM
    SELECT Id, Name, COUNT(CategoryId) AS AnnCount FROM tblAnnounces
    GROUP BY Id, Name
    -- bellow is the line, where the code crash
    ORDER BY AnnCount DESC
    WHERE ROWNUM < iiCount + 1;
    oiRetVal := 0;
    EXCEPTION
    WHEN OTHERS THEN
    oiRetVal := -255;
    END TopAnnounces;
    END Announces;
    If I compile the code above I will get this error:
    PLS-00103: Encoutered the symbol "ORDER" when expecting on of the following:
    After I remark the problematic line, the compilation is successful (but not the result :).
    Is there something I'm doing wrong?
    Thanks for advice
    Vojtech Novacek<HR></BLOCKQUOTE>
    null

  • Pass multiple query strings to url using HTTPWebRequest

    I'm trying to read data from API (in Json format) and load it into SQL server using script task in SSIS.
    Dim Request1 As System.Net.HttpWebRequest = DirectCast(System.Net.HttpWebRequest.Create(URL), System.Net.HttpWebRequest)
            Dim Object1 As [Object]
            Dim Response1 As System.Net.HttpWebResponse = Nothing
            Dim reader1 As System.IO.StreamReader
            Dim myResponseString As String
            Request1.Headers.Add("Authorization: Token *****")
            Try
                Response1 = DirectCast(Request1.GetResponse(), System.Net.HttpWebResponse)
                reader 1= New System.IO.StreamReader(Response1.GetResponseStream())
                myResponseString = reader.ReadToEnd()
    I'm able to do this with the URL. However, the requirement now is to pass different query strings to the URL and load the data into SQL.
    Could someone please provide the code sample to achieve this.
    Thanks

    If we sent you a code you must try and tell that it doesn't work or that's not what I want, this is better than repeating the same question again and again. Here you go another snippet for httpwebrequest with querstrings and tested:
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Try
    Dim request As HttpWebRequest = DirectCast(HttpWebRequest.Create(New Uri("http://www.google.com?querstring1=1&querystring2=2")), HttpWebRequest)
    request.BeginGetResponse(New AsyncCallback(AddressOf ReadCallback), request)
    Catch ex As WebException
     End Try
    End Sub
    Private Sub ReadCallback(asynchronousResult As IAsyncResult)
    Dim request As HttpWebRequest = DirectCast(asynchronousResult.AsyncState, HttpWebRequest)
    Dim response As HttpWebResponse = DirectCast(request.EndGetResponse(asynchronousResult), HttpWebResponse)
    Using streamReader1 As New StreamReader(response.GetResponseStream())
    Dim resultString As String = streamReader1.ReadToEnd()
    Dim result As String = Convert.ToString("Using HttpWebRequest: ") & resultString
    End Using
    End Sub
    Fouad Roumieh

  • Passing xml as string to xmlPanel function

    hello Genius,
    I am using XML2UI feature of Extending Flash. I want to pass
    XML through string in place of xml file in xmlPanel function.
    is there any way to avoid creating 20 xml files and
    distributing them as my planned extension have 20 ui's.
    thanks in advance.

    Hai Shyam,
    I have tried to do as u have mentioned but still its not taking it as a paramater.
    i mean the API say
    parse
    public void parse(InputSource input) throws IOException,
    SAXExceptionParse an XML document.
    The application can use this method to instruct the XML reader to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).
    Is is any way to convert string to (char stream or byte stream).
    Thanks a lot
    Pooja.

  • ORDERS05 IDOC to pass order type RE

    Hello All,
    We want to receive EDI 180 returns document from our warehouse. I figure I'll map the EDI document to ORDERS05. I need to pass order type RE to create the returns order in VA01. Where in the IDOC do I put the RE?
    Thank you.
    Farhaud

    Dear Farhaud,
    E1EDK01 (Document header general data)
    BSART (Document type)
    You can get more details from transaction WE60 -> Basic type: ORDERS05
    I hope this helps.
    Best regards,
    Ian Kehoe

  • Passing a long string from Vb to stored proc

    Hi,
    I am passing a long string from Vb to this stored proc ..
    defn:
    Create Or Replace Procedure saveTaxFormInDB(intFormUID IN number,
    intCLUID IN number,
    PDFdata IN varchar2,
    Status IN OUT Varchar2) AS
    Problem lies with the string pdfdata. I am sending it from VB as:
    Set cmdParamStr = cmdAdoCmd.CreateParameter("Data", adVarChar,
    adParamInput, 32767, strData)
    I have checked the parameters in VB while sending and I have the
    correct string argument to be passed to "PDFData", But i am not
    sure if it is getting the value correctly.
    Because I know that the code is raising exception while
    accessing PDFData. (eg. in places like insert ..(pdfdata) and
    length(pdfdata)...)
    Please advise how i can solve this problem.
    Please Note that the string is not VERY large. I do not need to
    use LOBS in any way. the string is definitely within the limits
    of varchar2(which i think is 4000 chars.. correct me if i am
    wrong).
    Many thanks

    what is the backend MS SQl server or Oracle.??
    If it is MS SQLSERVER, then
    1.Create a SqlCommand object with the parameters as the name of the stored procedure that is to be executed and the connection object con to which the command is to be sent for execution.
    SqlCommand command = new SqlCommand("Name of StoredProcedure",con);
    2.Change the command objects CommandType property to stored procedure.
    command.CommandType = CommandType.StoredProcedure;
    3.Add the parameters to the command object using the Parameters collection and the SqlParameter class.
    command.Parameters.Add(new SqlParameter("@parametername",SqlDbType.Int,0,"Filedname"));
    4.Specify the values of the parameters using the Value property of the parameters
    command.Parameters[0].Value=4;
    command.Parameters[1].Value="ABC";
    If it is oracle,
    OracleConnection con = new OracleConnection("uid=;pwd=");
    try
    con.Open();
    OracleCommand spcmd = new OracleCommand("Name of StoredProcedure");
    spcmd.CommandType = CommandType.StoredProcedure;
    spcmd.Connection = con;
    spcmd.Parameters.Add("empid", OracleType.Number, 5).Value = txtEmpid.Text;
    spcmd.Parameters.Add("sal", OracleType.Number, 5).Value = txtSal.Text;
    spcmd.ExecuteNonQuery();
    }

  • PDBookmarkAddNewChild -- Passing a unicode string

    Hello,
    I am trying to add the following bookmark to my PDF
    1.2 訂婚範圍和結垢
    I am using the following piece of code.
    PDBookmark InsertBookMark(PDBookmark bknode, CString strName)
    wchar_t *wname = strName.GetBuffer(strName.GetLength());
    size_t i;
    char *name = (char *)malloc( BUFFER_SIZE );
    wcstombs_s(&i, name, (size_t)BUFFER_SIZE, wname, (size_t)BUFFER_SIZE );
    PDBookmark newNkNode = PDBookmarkAddNewChild(bknode,name);
    However when i get the "name" buffer,, it is blank.. can someone advise as to how I can pass a unicode string to the PDBookmarkAddNewChild
    Thanks
    Swapneel

    Post your question in the forum for Acrobat SDK.

Maybe you are looking for

  • Sort negative amount in webdynpro ABAP (EHP5)

    Hello, We ahve recently installed EHP5. We are now re-implementing Enterprise Compensation Management (ECM) with the new WebDynpro ABAP MSS iViews. We have the following issue: one of our column in the compensation planing iView displays positive and

  • HTTP_RESP_STATUS_CODE_NOT_OK. Pls advice

    Hi All, Basically I have sender CRM system that send data to my SAP XI system. I am getting error in my CRM system "HTTP response contains status code 500 with the description Timeout Error while sending by HTTP (error code: 500, error text: Timeout)

  • My 'recently added' playlist doesnt want to sync correctly on my iphone5

    It's stuck and doesnt want to sync any new music i add.

  • QuickTime Player Sounds MUCH BETTER!?

    I downloaded a YouTube video, mp4.  By chance the original download was still on the desktop so I hit play -- AND IT SOUNDED GREAT! Then in iTunes I played it and it was very MUFFLED in comparisson. I turned off the equalizer but still the  QuickTime

  • Change in supplying plant in STO

    Hi, With ME21N, i'm doing STO and giving supplying plant and receiving plant and saved. immediately with ME22N, I have opened same STO and found supplying plant field disabled. I want to change supplying plant. Can anybody guide me for this? Regards,