Cursor - Output in Continous form

Hello Experts,
I have the following cursor; i need to print the values continuosuly.
How can i do it?
declare
reference_name varchar2(256);
cursor reference_names is
       select distinct name as data
      from title
     and rownum <=5;                           
BEGIN
  for reference_name in reference_names
  loop   
          dbms_output.put_line(reference_name.data||'-');
  end loop; 
  END;
  /Values in Column
================
Titus
John
Bravid
Need desired output as
======================
Titus - John - Bravid
Thanks...

untested:
declare
cursor reference_names is
      select * from
        select distinct name as data
        from title
      where  rownum <=5;      
      v_sep varchar2(3):='';                    
BEGIN
  for reference_name in reference_names
  loop   
          dbms_output.put(v_sep||reference_name.data);
                v_sep:=' - ';
  end loop;
  dbms_output.put_line(''); 
END;
/ Edited by: hm on 28.09.2011 04:19

Similar Messages

  • Cursor Output

    Hi all,
    i need to form a comma seperated values from my cursor output .
    I have a procedure with a input parameter as p_group
    i need to pass this in a cursor and get the output in a comma sepereted values.
    select student_name from class_stds where group_name=p_group ;
    the output of the query , i need to make as a comma seperated values....

    Thanks for your input, but I haven't understood properly. Please have a look at the test case
    SQL> desc emp
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(35)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    SQL> select ename,length(ename) from emp;
    ENAME                               LENGTH(ENAME)
    SMITH                                           5
    ALLEN                                           5
    WARD                                            4
    JONES                                           5
    MARTIN                                          6
    BLAKE                                           5
    CLARK                                           5
    SCOTT                                           5
    KING                                            4
    TURNER                                          6
    ADAMS                                           5
    ENAME                               LENGTH(ENAME)
    JAMES                                           5
    FORD                                            4
    MILLER                                          6
    999999                                          6
    ABCDEFGHIJKLMNOPQRSTUVWXYZAAAAAA               32
    MY#@ ' "ABC                                    11
    17 rows selected.
    SQL> declare
      2    ename_tbl dbms_utility.uncl_array;
      3    cursor c1(p_deptno emp.deptno%TYPE) IS
      4      SELECT ename FROM emp where deptno = p_deptno;
      5    mystr      VARCHAR2(200);
      6    tbl_length BINARY_INTEGER;
      7  BEGIN
      8    OPEN c1(20);
      9    FETCH c1 BULK COLLECT
    10      INTO ename_tbl;
    11    tbl_length := ename_tbl.COUNT;
    12    dbms_utility.table_to_comma(ename_tbl, tbl_length, mystr);
    13    dbms_output.put_line(mystr);
    14  END;
    15  /
    SMITH,JONES,SCOTT,ADAMS,FORD,ABCDEFGHIJKLMNOPQRSTUVWXYZAAAAAA,MY#@ ' "ABC
    PL/SQL procedure successfully completed.To be specific I haven't used Name_array which is Table Of Varchar2(30), But I have used Uncl_array which is Table Of Varchar2(227). So in my understanding it can be problematic for columns greater than 227. Please clarify.

  • Central Management server - executed a query but how to send the query output in the form of mail?

    Hi All,
    i have used CMS in SQL 2008 R2. i have added couple of servers in its group. i have executed a query & i need to send the query output in the form of email.
    basically query is checking the rows count from couple of user tables in servers.
    issue here is how to copy the data that is used by CMS? i need to work on automate the rows count in difft user table in db servers
    could you please suggest how can i achieve this?

    Copy to what?
    SELECT COUNT(*) FROM sys.objects
    Running the above statement returns two columns (server name and count)
    All the servers SS2005  and onwards , then use
    EXEC msdb.dbo.sp_send_dbmail 
         @profile_name = 'name', 
         @recipients = '[email protected]', 
         @query = 'SELECT COUNT(*) FROM sys.objects', 
         @subject = 'Count rows'
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to call a Stored Procedure with a REF CURSOR output parameter

    I am looking forward an example that call a stored function/procedure with a REF CURSOR output parameter and get the result.
    In other words, I have a stored function/procedure that execute a SELECT statement using the OCI library and then it could get the values of each column and each row.
    I put a code snippet, it have only the main thing to call a simple stored procedure and print the name of each column of the cursor, but I couldn´t to print out the values in the table that call the stored procedure.
    I understand that the next step, it is to call a OCIStmtFetch.
    How to associate the cursor with the OCIStmtFetch?
    If you need more information, only tell me.
    I am using ANSI C with HP-UX Operative System (C for HP-UX) and Oracle 10g.
    Regards.
    Antonio Garcia
    /* callOracleSP */
    #include <stdio.h>
    #include <string.h>
    #include <oci.h>
    #include <stdlib.h>
    char* pConnectChar ="server";
    char* pUsernameChar = "user";
    char* pPasswordChar = "passwd";
    char* sqlCharArray1 = "BEGIN SP_GETCITIES(:s, :c); END;";
    int retval;
    ub4 parmcnt=0;
    ub4 pos2=0;
    text *pcoln[20];
    ub4 namelen[20];
    char state_key[5];
    OCIStmt* pOciStatement;
    OCIStmt* pOciStatCursor;
    OCIError* pOciError;
    OCIEnv* pOciEnviron;
    OCIServer* pOciServer;
    OCISession* pOciSession;
    OCISvcCtx* pOciServiceContext;
    OCIBind* pOciBind[500];
    OCIParam* pOciParam;
    int main()
    retval = OCIEnvCreate(&pOciEnviron, OCI_DEFAULT, NULL, NULL, NULL, NULL,0,NULL);
    retval = OCIEnvInit(&pOciEnviron, OCI_DEFAULT, 0, NULL);
    retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciError, OCI_HTYPE_ERROR, 0, NULL);
    retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);
    retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciStatement, OCI_HTYPE_STMT, 0, NULL);
    retval = OCILogon(pOciEnviron,pOciError,&pOciServiceContext,(unsigned char *)pUsernameChar,
         strlen(pUsernameChar), (unsigned char *)pPasswordChar, strlen(pPasswordChar),
                   (unsigned char *)pConnectChar,strlen(pConnectChar));
    printf("OCILogon retval=%d\n",retval);
    retval = OCIStmtPrepare(pOciStatement, pOciError, (unsigned char *)sqlCharArray1,strlen(sqlCharArray1),
         OCI_NTV_SYNTAX, OCI_DEFAULT);
    printf("StmtPrepare retval=%d\n",retval);
    retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciStatCursor, OCI_HTYPE_STMT, 0, NULL);
    retval = OCIBindByPos(pOciStatement,&pOciBind[0], pOciError, (ub4) 1, (void *)&state_key,
         (sb4) sizeof(state_key), SQLT_STR, (void *) 0, (ub2 *) 0, (ub2 *)0,(ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT);
    printf("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);
    retval = OCIBindByPos(pOciStatement,&pOciBind[1], pOciError, (ub4) 2, (void *)&pOciStatCursor,
         (sb4) 0, SQLT_RSET, (void *) 0, (ub2 *) 0, (ub2 *)0,(ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT);
    printf("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);
    strcpy(state_key,"CA");
    retval = OCIStmtExecute(pOciServiceContext, pOciStatement, pOciError, (ub4)1, (ub4) 0,
         (OCISnapshot *)NULL, (OCISnapshot *)NULL, (ub4) OCI_DEFAULT);
    printf("StmtExecute retval=%d\n",retval);
    /* How to get the values of the cursor? */
    /* Get number of parameters of the Cursor */
    OCIAttrGet((void *) pOciStatCursor, (ub4)OCI_HTYPE_STMT, (void*) &parmcnt,(ub4 *) 0,
         (ub4)OCI_ATTR_PARAM_COUNT, pOciError);
    printf("\nNumber of parameters of the cursor = %d\n",parmcnt);
    for (int pos = 1; pos <= (int)parmcnt; pos++)
         OCIAttrGet((void *) pOciStatCursor, (ub4)OCI_HTYPE_STMT, (void*) &pos2,(ub4 *) 0,
              (ub4)OCI_ATTR_CURRENT_POSITION, pOciError);
         retval = OCIParamGet((void *)pOciStatCursor, (ub4)OCI_HTYPE_STMT, pOciError, (void **)&pOciParam,
              (ub4) pos );
         OCIAttrGet((void*) pOciParam, (ub4) OCI_DTYPE_PARAM,(void*) &pcoln[pos-1],(ub4 *) &namelen[pos-1],
              (ub4) OCI_ATTR_NAME,(OCIError *)pOciError );
    for (int i = 1; i <=(int)parmcnt; i++)
    printf("Column %i\tNAME = %.*s\n",i,namelen[i-1],pcoln[i-1]);
    return 0;
    This is the script that create the table, insert records and create the stored procedure
    CREATE TABLE CITIES (
         STATE_CODE     VARCHAR2(2) NULL,
         CITY_CODE      NUMBER(15,5) NULL,
         CITY_NAME      VARCHAR2(30) NULL
    INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES('CA', 30, 'SAN DIEGO')
    INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES('CA', 40, 'SACRAMENTO')
    INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES('FL', 10, 'MIAMI')
    INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES('FL', 20, 'ORLANDO')
    INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES('NY', 10, 'NEW YORK')
    INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES('NY', 20, 'ALBANY')
    INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES('CA', 10, 'LOS ANGELES')
    INSERT INTO CITIES(STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES('CA', 20, 'SAN FRANCISCO')
    CREATE OR REPLACE PACKAGE globalPkg AUTHID CURRENT_USER AS
    /* The following are T/SQL specific global variables. */
    TYPE RCT1 IS REF CURSOR;/*new weak cursor definition*/
    END globalPkg;
    CREATE OR REPLACE PROCEDURE SP_ADDCITY(
    P_STATE_CODE IN VARCHAR,
    P_CITY_CODE      IN NUMBER,
    P_CITY_NAME      IN VARCHAR2,
    P_RETURN IN OUT NUMBER)
    AS
    StoO_error INTEGER;
    StoO_selcnt INTEGER;
    StoO_rowcnt INTEGER;
    StoO_errmsg VARCHAR2(255);
         BEGIN
    StoO_rowcnt := 0;
    StoO_error := 0;
    StoO_selcnt := 0;
    P_RETURN := 0;
    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES (P_STATE_CODE, P_CITY_CODE, P_CITY_NAME);
    StoO_rowcnt := SQL%ROWCOUNT;
    EXCEPTION
    WHEN TOO_MANY_ROWS THEN
    StoO_rowcnt := 2;
    WHEN OTHERS THEN
    StoO_rowcnt := 0;
    StoO_selcnt := 0;
    StoO_error := SQLCODE;
    StoO_errmsg := SQLERRM;
              IF StoO_error != 0 THEN
    BEGIN
                   P_RETURN := 1;
         RETURN;
         END;
              END IF;
         END;
    CREATE OR REPLACE PROCEDURE SP_GETCITIES(
    STATE_KEY IN VARCHAR,
    RC1      IN OUT globalPkg.RCT1)
    AS
    StoO_error INTEGER;
    StoO_selcnt INTEGER;
    StoO_rowcnt INTEGER;
    StoO_errmsg VARCHAR2(255);
    BEGIN
    StoO_rowcnt := 0;
    StoO_error := 0;
    StoO_selcnt := 0;
    OPEN RC1 FOR
    SELECT STATE_CODE, CITY_CODE, CITY_NAME
    FROM CITIES
    WHERE STATE_CODE = STATE_KEY
    ORDER BY CITY_CODE;
    StoO_rowcnt := SQL%ROWCOUNT;
    EXCEPTION
    WHEN OTHERS THEN
    StoO_rowcnt := 0;
    StoO_error := SQLCODE;
    StoO_errmsg := SQLERRM;
         END;
    /

    Hi Mark,
    Thanks for your recommendations.
    I change the code with OCIDefineByPos, one for each parameter from cursor and then use the OCIStmtFetch.
    I don´t receive a error when call OCIDefineByPos, but when I call OCIStmtFetch receive a -1 error number.
    What is wrong with the code?
    The script is the same.
    I need your help!
    Best Regards!
    Antonio Garcia (Mexico)
    This the new code:
    #include <stdio.h>
    #include <string.h>
    #include <oci.h>
    #include <stdlib.h>
      char*   pConnectChar ="ORAC617";
      char*   pUsernameChar = "C617_005_DBO_01";
      char*   pPasswordChar = "Tempora1";
      char*   sqlCharArray1 = "BEGIN SP_GETCITIES(:s, :c); END;";
      int     retval;
      ub4 parmcnt=0;
      ub4 pos2=0;
      sb2   *c_indp;
      text *pcoln[20], *name,*name2;
      ub4 namelen[20],len;
      ub2 type,size;
      char state_key[5];
      OCIDefine        *pdef;
      OCIBind          *p_bnd;
      ub1          **c_buf;
      OCIStmt*     pOciStatement;      /* Statement handle */
      OCIStmt*     pOciStatCursor;     /* Statement handle */   
      OCIError*    pOciError;          /* Error handle */
      OCIEnv*      pOciEnviron;        /* Environment handle */
      OCIServer*   pOciServer;         /* Server handle */  
      OCISession*  pOciSession;        /* Session handle */
      OCISvcCtx*   pOciServiceContext; /* Service Context handle */
      OCIBind*     pOciBind[500];      /* Bind handle */
      OCIParam*    pOciParam;          /* Param handle */
      int OCI_Fetch(OCIStmt *p_select,OCIError *p_err, int *piOcc)
      int iOcc, rc; 
      rc=OCIStmtFetch(p_select,p_err,1,OCI_FETCH_NEXT,OCI_DEFAULT);
      printf("rc fetch %i",rc);
      if(rc==0&&piOcc!=NULL){
           printf("entro al if");
        iOcc=*piOcc;
        *piOcc=iOcc+1;
      return rc;
    int main()
    int pos,i=0,rc;
      retval = OCIEnvCreate(&pOciEnviron, OCI_DEFAULT, NULL, NULL, NULL, NULL,0,NULL);
      printf("EnvCreate retval=%d\n", retval);
      retval = OCIEnvInit(&pOciEnviron, OCI_DEFAULT, 0, NULL);
      printf("EnvInit retval=%d\n",retval);
      retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciError, OCI_HTYPE_ERROR, 0, NULL);
      printf("HandleAlloc OCI_HTYPE_ERROR retval=%d\n",retval);
      retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);
      printf("HandleAlloc OCI_HTYPE_SVCCTX retval=%d\n",retval);
      retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciStatement, OCI_HTYPE_STMT, 0, NULL);
      printf("HandleAlloc OCI_HTYPE_STMT retval=%d\n",retval);
      retval = OCILogon(pOciEnviron,pOciError,&pOciServiceContext,(unsigned char *)pUsernameChar,
                  strlen(pUsernameChar), (unsigned char *)pPasswordChar, strlen(pPasswordChar),
                    (unsigned char *)pConnectChar,strlen(pConnectChar));
      printf("OCILogon retval=%d\n",retval);
      retval = OCIStmtPrepare(pOciStatement, pOciError, (unsigned char *)sqlCharArray1,strlen(sqlCharArray1),
                 OCI_NTV_SYNTAX, OCI_DEFAULT);
      printf("StmtPrepare retval=%d\n",retval);
      retval = OCIHandleAlloc(pOciEnviron, (void **)&pOciStatCursor, OCI_HTYPE_STMT, 0, NULL);
      printf("HandleAlloc OCI_HTYPE_STMT retval=%d\n",retval);
      retval = OCIBindByPos(pOciStatement,&pOciBind[0], pOciError, (ub4) 1, (void *)&state_key,
                 (sb4) sizeof(state_key), SQLT_STR, (void *) 0, (ub2 *) 0, (ub2 *)0,(ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT);
      printf("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);
      retval = OCIBindByPos(pOciStatement,&pOciBind[1], pOciError, (ub4) 2, (void *)&pOciStatCursor,
                 (sb4) 0, SQLT_RSET, (void *) 0, (ub2 *) 0, (ub2 *)0,(ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT);
      printf("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);
      strcpy(state_key,"CA");
      retval = OCIStmtExecute(pOciServiceContext, pOciStatement, pOciError, (ub4)1, (ub4) 0,
                   (OCISnapshot *)NULL, (OCISnapshot *)NULL, (ub4) OCI_DEFAULT);
      printf("StmtExecute retval=%d\n",retval);
      c_buf=(ub1 **)calloc(sizeof(ub1 *),3);
      c_indp=(sb2 *)calloc(sizeof(sb2 *),3);
      // Get number of parameters of the Cursor
      OCIAttrGet((void *) pOciStatCursor, (ub4)OCI_HTYPE_STMT, (void*) &parmcnt,(ub4 *) 0,
                  (ub4)OCI_ATTR_PARAM_COUNT, pOciError);
      printf("\nNumber of parameters of the cursor = %d\n",parmcnt);
      for (pos = 1; pos <= (int)parmcnt; pos++)
           OCIAttrGet((void *) pOciStatCursor, (ub4)OCI_HTYPE_STMT, (void*) &pos2,(ub4 *) 0,
                (ub4)OCI_ATTR_CURRENT_POSITION, pOciError);
           retval = OCIParamGet((void *)pOciStatCursor, (ub4)OCI_HTYPE_STMT, pOciError, (void **)&pOciParam,(ub4) pos );
           // Get the column name
           OCIAttrGet((void*) pOciParam, (ub4) OCI_DTYPE_PARAM,(void*) &name,(ub4 *) &len, (ub4) OCI_ATTR_NAME,(OCIError *)pOciError );
            // Get the column datatype
           OCIAttrGet((void*) pOciParam, (ub4) OCI_DTYPE_PARAM,(void*) &type,(ub4 *)0,(ub4)OCI_ATTR_DATA_TYPE,(OCIError *)pOciError);      
            // Get the column size
           OCIAttrGet((void*) pOciParam, (ub4) OCI_DTYPE_PARAM,(void*) &size,(ub4 *)0,(ub4)OCI_ATTR_DATA_SIZE,(OCIError *)pOciError);
           printf("Column %i\tNAME = %.*s \ttype %d \tsize %d\n",pos,len,name,type,size);
           // OCIDefine ByPos, one for each parameter
           // c_buf store the STATE_CODE, CITY_CODE and CITY_NAME columns from the cursor
           rc=OCIDefineByPos(pOciStatCursor,&pdef,(OCIError *)pOciError,pos,c_buf[pos-1],size+1,(ub2)type,(dvoid *)c_indp[pos-1],(ub2 *)0,(ub2 *)0,OCI_DEFAULT);     
          printf("OCIDefineByPos retval=%d\n,rc);
      // call OCIStmtFetch. In the next line, I receive the error
      rc=OCIStmtFetch(pOciStatCursor,pOciError,1,OCI_FETCH_NEXT,OCI_DEFAULT);
      printf("rc fetch %i",rc);
      return 0;
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Merging Smartform Output and Adobe Form Output in a single PDF File

    Hi All,
    My Requirement is as follows -
    I have multiple Smartforms and a single Adobe Form.
    I want to merge the Smartform Outputs and Adobe Form output in a single PDF.
    I am able to merge multiple Smartform Output in a PDF , but not able to find any way to merge smartform and adobe form output as the Smartform output is in OTF Format and Adobe form output is in PDF Format itself.
    I have tried few ways , but could not find any success.
    Request you all to give me some direction to this problem.
    Thanks & Regards
    Bhavika

    Kumar,
    I am afraid this is not possible using SAP functionality. There are probably 3rd party tools which allow you to merge several PDFs into one, but SAP itself does not offer such a mechanism. There is an internal SAP function, though, which can merge several "parts" (=several PDFs) within an Adobe-created spool request into a single PDF, intended for downloading this PDF from SP01.
    This is described in note 1717357.
    Best regards,
    Alexander

  • Reports output in Excel form fail - Finished successf output is voided

    Hi
    We have oracle 10g application server on solaris. A few of the reports are configured to have the output in PDF and other reports in excel form.
    The reports which are configured to give the output in excel form fail with Finished successfully but output is voided.
    I have the below paramters configured
    <property name="cacheSize" value="1024"/>
    <property name="cacheDir" value="/reports/reportoutput"/>
    Are there any other parameters I should set or look out for. So that the reports are which give excel output are successfull.
    Thanks

    The problem has been solved. The report is successfull. But the OEM status was showing the message like that.
    Thanks

  • XML output of a form after submission?

    Hi,
    Iv'e been tasked with creating a form rendered in HTML format, filled out, submitted with the results (a single XML file or String) written to a named database/table/field.
    When the submit button is pressed, I need to somehow capture the output of the form in XML with the fieldname and the field value that was entered present. How and where do I create an 'action' or process to be run behind the Submit button to create this output? Ideally I'd like to be able to submit the form and map the ouput xml String to a field in a table in a database.
    Any ideas how all of this can be done? This is my first Form so please bear with me...
    Thanks!

    You can place a submit button on the form. On the standard palette choose a button object. In the Object palette make it a submit button. A new Submit tab is available. All of your submit options appear on that tab.
    You will have to submit to a server based program and that program will have to do the database update.
    Paul

  • How to out Dynamic ref cursor from Procedure to Forms

    Hi
    I am trying to out Dynamic ref cursor from Procedure to Forms, But I am unable to do so. however cursor return the value within procedure but I am failed to capture the same in Forms
    Pl advice suggestion if any, Here I am attaching full procedure for reference
    CREATE PACKAGE winepkg
    IS
    TYPE wine IS RECORD ( mynumber number);
    /* Define the REF CURSOR type. */
    TYPE wine_type IS REF CURSOR RETURN wine;
    END winepkg;
    CREATE procedure find_wine
    (col1_in in number,
    c1 out winepkg.wine_type) as
    vsql varchar2(1000);
    cur sys_refcursor;
    x number;
    BEGIN
    vsql:='select bo_id from bo_details where bo_details.bo_id = '||col1_in ;
    open cur for vsql;
    c1:=cur;
    --fetch c1 into x;
    --dbms_output.put_line(x);
    END find_wine;
    In front end forms
    Declare
    TYPE F is REF CURSOR;
    CUR_F F;
    rec number;
    Begin
    break;
    find_wine( 1601480000011078,cur_f ) ;
    Loop
    fetch cur_f into rec ;
    Message(rec ) ;pause;
    exit when cur_f%notfound ;
    End loop ;
    exception
    when others then
    Message(sqlerrm) ;pause;
    End ;

    yo can use
    declare
    c_cursor EXEC_SQL.CursType;
    v_stmt varchar2(2000) = 'select a, b, c from mytab where cond1'; -- you can create this value dynamically
    begin
    c_cursor := Exec_SQL.Open_cursor;
    EXEC_SQL.PARSE(c_articulos, v_stmt);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,1, v_colchar1, 30);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,2, v_colchar2, 15);
    EXEC_SQL.DEFINE_COLUMN(c_articulos,3, v_colchar3, 30);
    v_exec := EXEC_SQL.EXECUTE(c_cursor);
    WHILE EXEC_SQL.FETCH_ROWS(c_cursor) > 0 LOOP
    EXEC_SQL.COLUMN_VALUE(c_cursor,1,v_colchar1);
    EXEC_SQL.COLUMN_VALUE(c_c_cursor,2,v_colchar2);
    EXEC_SQL.COLUMN_VALUE(c_c_cursor,3,v_colchar3);
    assign_values_to_block;
    END LOOP;
    EXEC_SQL.CLOSE_CURSOR(c_cursor);
    end;
    and WORKS IN FORMS 6

  • Using ref cursor in after parameter form in reports

    hi everyone,
    I have problem in usage of ref cursor in after parameter form. My actual requirement is I have user parameter :p_minval, :p_maxval. The values into these user parameters will be coming dynamically using sql_statement as shown below
    select min(empid),max(empid) into :p_minval, :p_maxval from emp where empid in (:p_emp);
    I will be writing this query in the after parameter form
    :p_emp is a lexical parameter as per me but the after parameter form is taking it as a bind variable. so I decided to define a ref cursor and then use it for retrieve. But when I use ref cursor it is returning pl/sql error 591 saying that this is not supported by client side can anyone help me plz..
    The following is the code i tried to use in after parameter form
    function afterPform return boolean is
    type rc is ref cursor;
    l_rc rc;
    sqlstmt varchar2(512);
    begin
    sqlstmt:='select min(empid),max(empid) from emp where empid in ('||:p_emp||')';
    open l_rc for
    select max(empid) from emp where empid in ('||:p_emp||')';
    fetch l_rc into :p_maxval;
    close l_rc;
    return(true);
    end;
    thanks & regards
    venkat

    I ran into the same problem. any body knows why?

  • Finding output type and form for the transaction

    hi all,
       i have a problem finding output type and form for the transaction j1iv .actually i need to find the standard output type and form name for the transaction j1iv. how can we do it.

    Hi Abinash,
         Go through the following steps.
                     1 . Go to the transaction <b>NACE.</b>
                     2. You will be able to see the <b>Application and description</b> tab over  
                         there. Select the Application for which you need the output type.
                     3. After selecting the Application..on the top you can see the tab--
                        output types...click in that..here you will be able to see all the <b>output
                        types for that application.</b>
                    4. Now select a output type ..and on the left side u will be able to see
                       the tab for processing routines...double click on it...
                    5. Here you will be able to see the standard SAP program...the form
                       routine...the form..attached to it..
                Please Reward..if helpful..
    Regards,
    Himanshu.

  • Output Type for Form 16

    Hi,
    I want to know the output type for Form 16, from where i can find it..
    Thanks

    Hi P ,
    have u seen the program of that Form 16? Run the program itself , it will give defalut  output types.
    i think its the Form name not the output type.
    regards
    Prabhu

  • Output of the form in various languages

    Questions on the forms output
    1) What is best way of achieving the output of a form in various languages? Both for SAPSCRIPTS and SMARTFORMS?
    2) If I develop a form(SAPSCRIPTS or SMARTFORMS) in English, what kind of efforts are required to get the output in German or Swedish?

    Hi Sapna,
    While creating a new form u must hv seen an input box of language below the form name input.
    Just select ur relevant language type by using F4. For eg: Swedish:SV & German:DE.
    Get ur relevant text for the corresponding language & create the form as normal.
    Regards,
    Himayan

  • How to down load the output of smart form into .XLS(spreadsheet) File.

    Hi All,
    We have one requirement like we need to down load the output of smart form into .XLS(spreadsheet) File.
    This output is related to Shipment(VT03N) in the output we are not displaying the any logo.
    Just we are displaying the address and item detail.
    Anyone tell me, If possible please let me know how can solve that problem.
    Thanks and regards,
    Amjad Hussain,

    Hi Mohammed,
    Absolutly you can download output from smartforms to excel.
    After execution of  your Smartforms in that layout Menu bar Do below  navigation.
    GoTo =>  ListDisplay      after that
    System  =>   List
                            =>    Save
                                             => Local File
                                                               => Spread Sheet.
    if helpful REWARD points
    Thank you .
    Regards
    Ramana

  • How can i display console outputs in my form?

    Hi,
    <p>I have an application which performs some actions like, insert 200 rows in the database. While inserting data i am using <code>
    int i=0;
    system.out.println ("Insert "+i+" row in database");
    i=i+1;
    </code>
    The output displays on the commnad line.</p>
    <p>what i am trying to do is i have a form, which has text area. I want to display the console output "Insert 1 row in database" and next "Insert 2 row in database"..... and soon in the text area. How could i do that?</p>
    <p>Thanks in advance!!</p>

    Hi Petes,
    Thanks for you response. I am very new to java. I just started learning jsp and have bit knowledge of swing. I am confused how to use jsp and swing componenets together. Can you please guide me a bit?
    Also i am using AJAX to update form field. I am able to work with the rest except bringing the console output in the text area.
    Do you think i have some other way to do it?
    Do you think, it is a good idea , if I will save the output strings in a file and with the help of jsp i can read the file in textarea.
    Pin2g

  • How can i display console outputs in my form field?

    Hi,
    I have an application which performs some actions like, insert 200 rows in the database. While inserting data i am using
    int i=0;
    system.out.println ("Insert "+i+" row in database");
    i=i+1;
    The output displays on the commnad line
    what i am trying to do is i have a form, which has text area. I want to display the console output "Insert 1 row in database" and next "Insert 2 row in database"..... and soon in the text area. How could i do that?
    Thanks in advance!!
    pin2g

    solution removed, because you crossposted.
    Message was edited by:
    Navy_Coder

Maybe you are looking for

  • Can not see the menu of New Business Components Package in jdeveloper

    I am just follow the developer guide. and when I create the Business Components Package, the guide said that ======================================== In the JDeveloper Navigator, select the OA Project where you want to create your package. From the m

  • My brand new ipod touch 4th gen wont let me sync new songs to it

    I just got my new ipod touch 4th gen 2 days ago and it wont let me sync any new songs to it and it wont let me take any songs off it either. Ive tried rebooting it and restoring it serveral times and nothing seems to work. Also I updates my itunes an

  • Connect a imac 2011 with beovision 7 HD ready?

    I want to connect my imac with a beovision 7-40 HD ready. iff possible without cabels?? Greetings noudfromnuenen

  • Special characters pop-in

    i have to do my homework in latin. i have the special characters pop-up available, but have to insert each character individually. is there any way i can assign these characters to my keyboard so i can just continue typing everything? it works in MS

  • Add Subject Areas after production

    We are implementing Oracle BI Apps for customer who initially requires only Financials Analytics. Now he want to add Procurement and Spend Analytics and Supply Chain Analytics. Anybody knows how to include new subject areas in a ETL extraction withou