Retrieve data TYPE

Hi all

I stated a type and an object of that type as:

CREATE OR REPLACE
TABLE AS ROLE_TABTYPE TYPE OF ROLE_TYPE;

CREATE OR REPLACE
OBJECT OF TYPE ROLE_TYPE AS
(
ROLE_CD VARCHAR2 (20));

I use them in a procedure such as:
-----------------------------------------------------------------------------------------------------------------------------------------
PROCEDURE pr_create_user_role
(ip_user_id IN VARCHAR2,
ip_role_cd IN ROLE_TAB,
op_error_cd OUT VARCHAR2,
op_error_desc OUT VARCHAR2
)
AS

BEGIN
FOR role_cursor IN (SELECT role_code FROM TABLE (ip_role_cd))
LOOP
INSERT INTO cp_user_role_tbl
(cp_user_role_tbl_seq_no,
role_cd,
user_id
)
VALUES (cp_user_role_tbl_seq. NEXTVAL,
role_cursor.role_code,
ip_user_id
);
END LOOP;
COMMIT;
op_error_cd: = 0;
op_error_desc: = NULL;
EXCEPTION
WHILE OTHERS
THEN
op_error_cd: = SQLCODE;
op_error_desc: = SQLERRM;
raise_application_error (SQLCODE,' ERROR WHILE CREATING a NEW USER ' |) SQLERRM);
END pr_create_user_role;
-----------------------------------------------------------------------------------------------------------------------------------------

I tried the steps like:
declare
role_tabtype v1.
VARCHAR2 (1000) v2;
VARCHAR2 (1000) v3.
Start
pr_create_user_role ('test', v1, v2, v3);
end;

The procedure runs correctly, but the o/p is always 0. No past the user gets created or procedure returns an error.

Now, I want to select the data TYPE to check if there is anything. How can I do? I think so

"SELECT role_code FROM TABLE (ip_role_cd)).

statement does not return anythign that there is no data in TYPE.
How to insert or check if the above query is fetch any value in table ip_role_cd.

Help, please.

Kind regards
Sylvie S.

I think so
"SELECT role_code FROM TABLE (ip_role_cd)).
statement does not return anythign that there is no data in TYPE.

This property is set to true because you didn't meet it.

Try sth like

declare
 v1 role_tabtype :=role_tabtype(ROLE_TYPE('some role'),ROLE_TYPE('some other role'));
 v2 varchar2(1000);
 v3 varchar2(1000);
begin
 pr_create_user_role('test',v1,v2,v3);
end;

Tags: Database

Similar Questions

  • using dbms_metadata for retrieve data type name and the parameter of a procedure

    Hi guru,.

    is there a subprogramme in dbms_metadata which will extract that ideally the specifications of a procedure/function call

    If the my program spec is proc1 (id1 number, CRC in varchar2, id2 number)

    If I call something like

    Select * from table (dbms_metadata. < subprogramme > ("proc2"));

    It gives me

    Id1 number

    CRC in varchar2

    Id2 number

    ideas/pointers?

    Why do you need to do this?

    See S/n/ALL/$user_arguments.

  • to retrieve data from xml data type

    Hello...
    I have a doubt in the oracle database... Here's how to retrieve data from xml data type?

    Like this...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select xmltype('
      2  
    3 4 toMonth5 5 ctTestPan1 6 costType2 7 toYear2012 8 fromMonth12 9 fromYear2011 10 11
    ') as xml from dual) 12 -- 13 -- end of sample XMLDATA, use below query on your own table etc. as required 14 -- 15 select x.* 16 from t 17 ,xmltable('/DETAILS/FIELDS_VALUES/FIELD' 18 passing t.xml 19 columns name varchar2(30) path './NAME' 20 ,val varchar2(10) path './VALUE' 21* ) x SQL> / NAME VAL ------------------------------ ---------- toMonth 5 ctTestPan 1 costType 2 toYear 2012 fromMonth 12 fromYear 2011 6 rows selected.
  • Failed to retrieve hours of DATA data type?

    SELECT

    EXTRACT (time TO_DATE (January 1, 2008 11:15:26 ',))

    "HH24:MI:SS of MON-DD-YYYY")) AS YEA of double

    error: extract from field does not contain the specified field extracted

    HAVE to say if I can extract the timestamp time why not date...?

    SELECT

    EXTRACT (time TO_DATE (January 1, 2008 11:15:26 ',))

    "HH24:MI:SS of MON-DD-YYYY")) AS YEA of double

    error: extract from field does not contain the specified field extracted

    HAVE to say if I can extract the hour of the time zone, so why no date...?

    The Oracle documentation provides the answer

    http://docs.Oracle.com/CD/B28359_01/server.111/b28286/functions052.htm

    If HOUR , MINUTE , or SECOND is requested, then expr must match an expression to data type TIMESTAMP , TIMESTAMP WITH TIME ZONE , TIMESTAMP WITH LOCAL TIME ZONE , or INTERVAL DAY TO SECOND . DATE is not valid here, because the Oracle database treats like ANSI DATE datatype, which has no time field.

    You can extract the HOUR of a DATE ANSI that has no TIME.

  • OBIEE 11.1.1.6.2 repository of BP1 Variable data type

    I have a few created dynamic DATE variables that retrieves date values in a table. In the table, the data type of this field is an INTEGER.

    But at the start of the server, all date variables are initialized with .0d added in the end. Like 2012,0 etc.

    Please provide some guidance!

    Thank you
    KC

    Published by: 959902 on October 30, 2012 08:26

    Of course, we can do that.
    Your substring should not be bulk init, it suppose to be where you reference variable rep.
    In the command prompt to set the default values use the query sql, something like

    SELECT time. ' ' Month ' where 'HIS' Time. "Year"= Substring (VALUEOF ("PREVIOUS_MONTH") FROM 1 to 4)

    If brand can help pls ;)

  • With the help of the socket object to retrieve data from web application without the html files

    I tried to use the socket object to retrieve data from a web application (I just control script version vs version online). So all I want to do is access http://hyle.io/version that returns me the current version of the application (such as a simple string) in order to compare it in my script and then notifies the user accordingly. I have just a few problems using the socket object. I used this code from the Adobe Javascript Tools Guide:


    reply = "";
    conn = new Socket;
    // access Adobe’s home page
    if (conn.open ("www.adobe.com:80")) {
    // send a HTTP GET request
    conn.write ("GET /index.html HTTP/1.0\n\n");
    // and read the server’s reply
    reply = conn.read(999999);
    conn.close();
    }
    

    ... that I then adapted as:

    reply = "";
    conn = new Socket;
    if (conn.open ("hyle.io:80")) {
      conn.write ("GET /version HTTP/1.0\n\n");
      reply = conn.read(999999); 
      conn.close();
    }
    

    And here is what I get:

    HTTP/1.1 400 Bad Request
    Content-Length: 225
    Content-Type: text/html
    Server: Pagodabox-Routing-Mesh
    
    

    Bad Request

    Your browser sent a request that this server could not understand.

    Résultat : true

    I don't know a lot about HTTP requests, but I wondered if it was related to the fact that I am not pointing to a specific HTML file and the type of request was wrong or if I should rather check if there is something wrong with my host?

    The site/app is PHP and is hosted on PagodaBox if it helps.

    Thanks in advance!

    Hi Sebastien Lavoie,

    It should work

    var HTTPFile = function (url, port) {}

    If (arguments.length == 1) {}

    URL = arguments [0];

    port = 80;

    };

    This.url = url;

    This.port = port;

    this.httpPrefix = this.url.match(/http:\/\//);

    This.Domain = this.httpPrefix is nothing? This.URL.Split("/") [0] + ":" + this.port: this .url .split ("/") [2] +":" + this.port;

    This.Call = ' GET ' + (this.httpPrefix == null? ' "). " http://" (+ this.url: this.url) + "HTTP/1.0\r\nHost: ' + (this.httpPrefix is nothing? "This.URL.Split("/ ") [0]: this .url .split (" / ") [2]) +" \r\nConnection: close\r\n\r\n ";

    This.Reply = new String();

    This.Conn = new Socket();

    This.Conn.Encoding = "binary";

    HTTPFile.prototype.getFile = {function (f)}

    var typeMatch = this.url.match(/(\.) (\w{3,4}\b)/g);

    If (this.conn.open (this.domain, "binary")) {}

    This.Conn.Write (this.) Call);

    This.Reply = this.conn.read (9999999999);

    This.Conn.Close ();

    } else {}

    This.Reply = "";

    }

    (Return this.reply.substr(this.reply.indexOf("\r\n\r\n")+4);

    };

    }

    Hyle var = new HTTPFile ("http://hyle.io/version");

    Alert (hyle. GetFile());

    And by the way, I like the idea of 'http://hyle.io'. Can you give me your email address, I want to learn more about this Web site.

    Please send me an email to [email protected]

  • Returns the data type of XMLTYPE 1111 rather than 2009

    I'm trying to retrieve the metadata of a stored procedure that has a parameter of type XMLTYPE oracle.

    I use the oracle jdbc version 2 drivers support SQLXML of JDBC 4.0. I see that the setting and the extraction of the SQLXML works very well, but I am facing the problem when I try to extract the metadata.

         ResultSet rs = dbMetaData.getProcedureColumns(conn.getCatalog(),                           null,                           "%",                           "%");         while(rs.next()) {         // get stored procedure metadata         String columnName          = rs.getString(4);         int    columnDataType      = rs.getInt(6);         String columnReturnTypeName = rs.getString(7);             }

    Here's the getint (6) SQL type from java.sql.Types. However, if the data type is XMLTYPE, it returns 1111 that is not defined. As far as I know, The JDBC for XMLTYPE type should be java.sql.Types.SQLXML which corresponds to 2009. So I thought it should be back in 2009.

    Can someone let me know if I'm doing something wrong or if there is another way to extract the metadata correctly under JDBC 4.0 (i.e. without explicitly using the XDB)

    Thanks in advance.

    Véronique

    Published by: user7897488 on July 27, 2011 04:21

    Hello. 1111 is oracle extension, oracle\jdbc\OracleTypes.java: public final static int ANOTHER = 1111

    You need to open an official driver bug for his changing the SQLXML JDBC 4.0 value.
    I would first check that the problem exists with the latest ojdbc6.jar...
    Joe

  • Data Type error

    Hello

    Need is,

    How to change the String data type in the data type Number

    I want to retrieve the employeeid (NUMBER) of other VO and save another VO

    Hello

    You can use the code to change your number to string below

    String strNumber =
    pageContext.getOANLSServcies().NumberToString(num,"###,###,##0.00000;-###,###,##0.00000");
    

    or simply use

     import oracle.jbo.domain.Number;
    
    try
    {
    
    Number numValue = new Number (stringVal);
    
    }
    catch(SQLException e)
    {
    e.printStackTrace();
    }
    

    Thank you
    AJ

  • portable data types

    I have an application that store data in Oracle 10 g.

    the data will be retrieve to apply different, such as MS SQL 64 bit 64 bit of Oracle 11 g etc.

    What are the data types in Oracle allowing to easily make cross platform development?

    refer to http://www.morganslibrary.org/reference/sqlserver.html

    Please note that Oracle and Sql server are two completely different products, so "Portage" sqlserver to Oracle will always end in failure of the variant of the Oracle.

    ------------
    Sybrand Bakker
    Senior Oracle DBA

  • How to recover the data type of a column in a table?

    Hello

    I want to retrieve the data type of a column in a table. At the moment I'm querying attribute 'OCI_ATTR_DATA_TYPE', but it is SQLT_CHR varchar2 and nvarchar2 data type columns. I need to make a distinction between these columns of two separate data types. Y at - it all API through which I could get the exact data type of a column, i.e. "nvarchar2?

    Thanks in advance.

    Hashim

    Hello

    It is not a very direct way to do it. What you can do is to call OCIDescribeAny on the table that you want to get information. You can then get the OCI_ATTR_CHARSET_FORM attribute for the column. If the value of the attribute that you get is SQLCS_IMPLICIT, that would mean its a varchar/char/varchar2 column regular. If you get SQLCS_NCHAR, this means that the column is NCHAR. You can get the example of it here:

    http://download.Oracle.com/docs/CD/B14117_01/AppDev.101/b10779/oci06des.htm#446491

    Just look for the section "Recovering for a Table column Datatypes".

    Thank you
    Sumit

  • Data type for representing €

    Hello

    I want to create, a table, a field that represents money, specifically in €.

    looking on the net I found unfortunately that Oracle doesn't have a SPECIFIC type to represent money in euros or dollars.

    My idea was to use a NUMBER type, and then when I put the data try to concatenate the symbol €. But I think that's not possible.

    If I try to use the VARCHAR2 instead of the NUMBER type, but although functions for later converted to NUMBER, I have with that is not very professional and loses the functionality


    What would recommended you?

    Thank you. Concerning

    You can store your number, such as salary value.
    Show the euro sign is a problem with the output screen, and you can get it in the query that retrieve data from db: TO_CHAR (salary, 'L999G999D99')
    L as currency.
    To learn more:
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions181.htm#SQLRF06130

    Nicolas.

  • selection column of the table xml data type

    Hello.
    I tried the following example with xml as column name data type
    create table emp_detail( empno number,ename varchar2(32),empdetails sys.xmltype)
    
    Insert into EMP_DETAIL
       (EMPNO, ENAME, EMPDETAILS)
     Values
       (1, 'satya', XMLTYPE('<NAME>
      <FIRSTNAME>SATYA</FIRSTNAME>
      <LASTNAME>SREE</LASTNAME>
      <LOC>SECBAD</LOC>
    </NAME>
    '));
    Insert into EMP_DETAIL
       (EMPNO, ENAME, EMPDETAILS)
     Values
       (2, 'jo', XMLTYPE('<NAME>
      <FIRSTNAME>JO</FIRSTNAME>
      <LASTNAME>REDDY</LASTNAME>
      <LOC>MYPR</LOC>
    </NAME>
    '));
    So, after that I tried this query to retrieve the State of an attribute data.
    SELECT a.empdetails.extract('//NAME/text()').getStringVal() AS "Table Name"
    FROM   emp_detail a
    WHERE  a.empdetails.existsNode('/NAME')  = 1;
    But those who above indicates no record...
    Why?


    Thank you
    SQL>  SELECT a.empdetails.extract('//NAME/FIRSTNAME/text()').getStringVal() AS "first_name",
      2     a.empdetails.extract('//NAME/LASTNAME/text()').getStringVal() AS "last_name",
      3     a.empdetails.extract('//NAME/LOC/text()').getStringVal() AS "loc"
      4     FROM emp_detail a
      5    WHERE a.empdetails.existsNode('/NAME')  = 1;
    
    first_name           last_name            loc
    -------------------- -------------------- --------------------
    SATYA                SREE                 SECBAD
    JO                   REDDY                MYPR
    
  • length of the data type of a column

    Hello

    I would like to know if it is possible to find the length of the
    data type in a create table stmt.

    For example:
    create employee table (empno number (3), empname varchar (10));


    in the DDL above I mentioned the size of my 3 number data type.
    is there a way to retrieve this info. ?
    outside desc < table_name >?


    Thanks in advance
    SQL> create table employee(empno number(3),empname varchar(10))
      2  /
    
    Table created.
    
    SQL> select column_name
      2       , data_length
      3       , data_precision
      4       , data_scale
      5    from user_tab_columns
      6   where table_name = 'EMPLOYEE'
      7  /
    
    COLUMN_NAME                    DATA_LENGTH DATA_PRECISION DATA_SCALE
    ------------------------------ ----------- -------------- ----------
    EMPNO                                   22              3          0
    EMPNAME                                 10
    
    2 rows selected.
    

    Details on the columns can be found in the documentation: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2094.htm#I1020277

    Kind regards
    Rob.

  • Using film as a data type time codes?

    I work in the film, and I was hoping to use numbers to help me create quotes for a VFX project (based on cost per second). I tried to create a custom data type, and it works almost out of an important obstacle. -That, even if he is HOURS: MINUTES: seconds, DURING which it is not no matter what equivalent of FRAMES (which are usually 24, 25 or 30 depending on what video format you are working in).

    I use Adobe Premiere to export a list of lots of files under a CSV file, which are fine numbers. However, manipulate these data is - I would say - impossible without the support of the video time code. Anyone working on a solution for this? Or is there a suggestion feature to me link to forward this to the team of numbers?

    Thank you very much

    You can give your comments and suggestions to the numbers > provide comments numbers in your menu.

    But everything first, perhaps you could post more details of your problem, what your imported data looks like and what result you want.

    If the imported data includes a column for the frames I think you can convert that.  In all cases, the specifics would help.

    Wayne explains how to post a screenshot in this thing.

    SG

  • Work with the first HP data types?

    I'm trying to get a clear understanding of the data types of HP Premium so that I can better exploit feature internal rather than copy and paste, edit, or having to retype. However, I can't find a tutorial, guide to style "quick start" or comprehensive information on this subject anywhere. Finally, I would like to do things like the following:

    (NOTE: I only list these questions in order to better explain what I'm looking for.) "There ARE no need to answer.)

    • Pass a list of expressions (sometimes solve() returns a list) in a function such as unapply() and run it on each item, rather than interpret the list as parameters
    • Precede the value of formula 1, "Y =" and then save the result in V1
    • Understanding type (x), type (X) and ('X') - I understand that X is a floating point number; x and 'X' they return all two DOM_IDENT, but are in that they also treated the calls function?  Or 'X' becomes X and then treated as a float value?
    • Is there a better way than unapply(), to replace by X-> x to a function, a function of return?
      • For example if: F1 = X-> Sin (x)
      • NOT a function: the seizure of F1 (x) returns the expression: Sin (x)
      • IS a function: unapply entry (F1 (x), x) returns the function: x-> Sin (x)

    Is anyone know if such a guide or tutorial exist, and if so, could you please point me to it?

    Hi!, ETH:

    Try, with...

    (1) www-fourier.ujf-grenoble.fr/ ~parisse/calc/hprime.pdf

    (2) www-fourier.ujf-grenoble.fr/ ~parisse/calc/hprime2.pdf

Maybe you are looking for