How to check if a value exists in a column

Hello Experts,

version: 10.1.0.5

I am a novice in pl/sql programming. I am trying to create a procedure that checks if a value exists in a column and if it is not it inserts. Here's the procedure and errors,

SQL > CREATE OR REPLACE PACKAGE BODY manr.audit_pkg

2 PROCEDURE audit_proc (number of p_sessionid, p_username VARCHAR2, date of the p_date) IS

3 BEGIN

4 If p_sessionid not in (select manr.audit_history sessionid)

5. can

6 INSERT INTO manr.audit_history VALUES (p_sessionid, p_username, p_date);

7 validation;

8 end if;

9 END;

10 END audit_pkg;

11.

WARNING: The body of a Package created with compilation errors.

SQL > show error

PACKAGE BODY HÉLÈNE errors. AUDIT_PKG:

LINE/COL ERROR

-------- -----------------------------------------------------------------

4/1 PL/SQL: statement ignored

4/22 PLS-00405: subquery not allowed in this context

Could you please tell me where I'm wrong. Thanks for your help.

Rocky

Hello

If p_sessionid not in (select manr.audit_history sessionid)

Try:

.....

Select count (*) in the v_sessionid of manr.audit_history

where sessionid = p_sessionid;

If v_sessionid > 0 then

.....

on the other

....

end if;

Ziut

Tags: Database

Similar Questions

  • How to check if a string exists in varray or not

    Hi all

    How to check if a string exists in varray or not.

    Version Details 
    
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> get test
      1  DECLARE
      2     TYPE dnames_var IS VARRAY(7) OF VARCHAR2(30);
      3     dept_names dnames_var := dnames_var('Shipping','Sales','Finance','Payroll');
      4  BEGIN
      5    if dept_names.exists('Shipping')
      6    then
      7       dbms_output.put_line('Exists ................');
      8    end if ;
      9  /*   DBMS_OUTPUT.PUT_LINE('dept_names has ' || dept_names.COUNT
     10                          || ' elements now');
     11     DBMS_OUTPUT.PUT_LINE('dept_names''s type can hold a maximum of '
     12                           || dept_names.LIMIT || ' elements');
     13     DBMS_OUTPUT.PUT_LINE('The maximum number you can use with '
     14         || 'dept_names.EXTEND() is ' || (dept_names.LIMIT - dept_names.COUNT));
     15  */
     16* END;
     17  
     18  /
    DECLARE
    *
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 5
    
    
    SQL> 
    
    Any help in this regard is appreciated ...
    Thank you
    Prakash P

    Published by: prakash on April 29, 2012 05:42

    EXISTS checks for the existence of an element, not a value. Since you're using VARRAY (btw, it is not recommended), your only choice is a loop through:

    SQL> DECLARE
      2       TYPE dnames_var IS VARRAY(7) OF VARCHAR2(30);
      3       dept_names dnames_var := dnames_var('Shipping','Sales','Finance','Payroll');
      4  BEGIN
      5      for i in 1..dept_names.count loop
      6        if dept_names(i) = 'Shipping'
      7          then
      8            dbms_output.put_line('Exists ................');
      9            exit;
     10        end if;
     11      end loop;
     12  END;
     13  /
    Exists ................
    
    PL/SQL procedure successfully completed.
    
    SQL>  
    

    If you use the nested table, you can use MEMBER, SUMBULTISET, MULTISET EXCEPT:

    SQL> DECLARE
      2       TYPE dnames_var IS TABLE OF VARCHAR2(30);
      3       dept_names dnames_var := dnames_var('Shipping','Sales','Finance','Payroll');
      4  BEGIN
      5      if 'Shipping' member of dept_names
      6      then
      7         dbms_output.put_line('Exists ................');
      8      end if ;
      9  END;
     10  /
    Exists ................
    
    PL/SQL procedure successfully completed.
    
    SQL> DECLARE
      2       TYPE dnames_var IS TABLE OF VARCHAR2(30);
      3       dept_names dnames_var := dnames_var('Shipping','Sales','Finance','Payroll');
      4  BEGIN
      5      if dnames_var('Shipping') submultiset dept_names
      6      then
      7         dbms_output.put_line('Exists ................');
      8      end if ;
      9  END;
     10  /
    Exists ................
    
    PL/SQL procedure successfully completed.
    
    SQL> DECLARE
      2       TYPE dnames_var IS TABLE OF VARCHAR2(30);
      3       dept_names dnames_var := dnames_var('Shipping','Sales','Finance','Payroll');
      4  BEGIN
      5      if dnames_var('Shipping') multiset except dept_names = dnames_var()
      6      then
      7         dbms_output.put_line('Exists ................');
      8      end if ;
      9  END;
     10  /
    Exists ................
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • How to check if a folder exists

    Hello

    I have a custom filter component:
    public class BarcodeMetadataFilter implements FilterImplementor{
    }
    I check here if the file exists in xCollectionId value, so I have two qustions:

    (1) should what service I call to check if the file exists?
    (2) how to call this service from the filter?

    Kuba

    Call a service such as COLLECTION_GET_INFO. Pass the parameter dCollectionID which must be xCollectionID. If you receive and error, it may mean that the folder does not exist. You should check the error (exception) to ensure what he wants to say to you is that the folder does not exist.

    http://docs.Oracle.com/CD/E23943_01/doc.1111/e11011/c07_folders.htm#i1082467

    The following blog post will show you how to run a service, a filter: http://jonathanhult.com/blog/2012/06/execute-a-service-from-a-java-filter/

    Jonathan
    http://jonathanhult.com

  • How to check if a table exists in the database or not?

    People,

    Hello. I use the server of Oracle 11 GR 1 material with Oracle Linux 5 database.

    My instance of database is named HRCS90, which the user access Id is MyName, and his identification of user SYS system.

    I have a few questions about user ID to access the PSRECDEL and PSROLEDEFN table in the HRCS90 database as below:

    SQL > select * from PSRECDEL;

    His output under the SYS user: table or view does not exist.

    His output under user myName: no selected lines. This means that the table THAT PSRECDEL exists, and myName user can access.

    SQL > select * from PSROLEDEFN;

    His output under SYS and MyName: table or view does not exist.

    My questions are:

    How to check if a table really exists in the instance of database HRCS90 or not?

    Thanks in advance.


    If a table is present in the database, it must be present in DBA_OBJECTS. If he fell, he would be present in the TRASH. If he fell purged, it is not available in the database, Cant it confirm you this object is not in the database? See a little test here

    SQL > CREATE TABLE TESTTAB (ID);

    Table created.

    SQL >

    SQL > SELECT MASTER, OBJECT_NAME FROM DBA_OBJECTS WHERE OBJECT_NAME = 'TESTTAB.

    OBJECT_NAME OWNER

    ------------------------------ ---------------------------------------------

    SCOTT TESTTAB

    SQL >

    -Drop table (without purging. So now, it will be in the recyclebin)

    SQL > DROP TABLE TESTTAB;

    Deleted table.

    SQL >

    SQL > SELECT * FROM DBA_RECYCLEBIN WHERE ORIGINAL_NAME = "TESTTAB;

    OBJECT_NAME ORIGINAL_NAME OWNER

    ------------------------------ ------------------------------ --------------

    SCOTT BIN$ 8LKloIv3SYWA0WJ33GS + Aw == $0 TESTTAB

    Now see this case when you use PURGE. If it won't move the table to the trash. First of all I am clear the existing dba_recyclebin to the user entries. Then I'm falling table using purge.

    SQL > PURGE TABLESPACE USERS USER SCOTT.

    Purged tablespace.

    SQL >

    SQL > SELECT * FROM DBA_RECYCLEBIN WHERE ORIGINAL_NAME = "TESTTAB;

    no selected line

    SQL > CREATE TABLE TESTTAB (ID);

    Table created.

    SQL >

    SQL > SELECT MASTER, OBJECT_NAME FROM DBA_OBJECTS WHERE OBJECT_NAME = 'TESTTAB;

    OBJECT_NAME OWNER

    ------   ----------

    SYS TESTTAB

    SQL > DROP TABLE TESTTAB PURGE;

    Deleted table.

    SQL > SELECT * FROM DBA_RECYCLEBIN WHERE ORIGINAL_NAME = "TESTTAB;

    no selected line

    SQL > SELECT MASTER, OBJECT_NAME FROM DBA_OBJECTS WHERE OBJECT_NAME = 'TESTTAB;

    no selected line

    Since there is no entry to both DBA_OBJECTS and DBA_RECYCLEBIN. So that means that the particular object is not in the database.

  • How to check if an element exists

    Hello

    I have a code as shown below. My problem is that I put that if the cursor exists, then allow the user to drag and change the size of the image on that where it clicks. If the cursor is not there, create an If you click on "image".

    The application works if I start it up and click on an image, but if I have mousewheel on the slider and done disappears, even if I click on the image, the cursor does not.

    Could someone give me some ideas about what I've done wrong here?

    Thanks in advance.

    Alice

    Hello

    I found a get autour by checking if the value of the slider is 0 and if she is, recreate the slider, and that seems to work now. If anyone is interested, here is the code:

  • How to check if the link exists in the remote site

    Hi all:

    Guys please can you me if there is a way I can check if the link exists in the remote site? for example

    < cfif hyper link to www.mysite.com exists in www.remotesite.com >
    good... We will continue
    < cfelse >
    Please add link to www.mysite.com before continuing
    < / cfif >

    Is this possible... you have to use the spider? If yes how?

    Thanks guys,.
    A

    to develop the excellent suggestion of tclaremont:

    You can use refindnocase() to search the returned by cfhttp filecontent
    call us at:

    http://www.yourwebsite.com">
    method http://www.VisitorsPage' = 'GET' result = 'Foobar '.
    ResolveUrl = "yes" getasbinary = "auto" >

    <>
    foobar. StatusCode is "200 OK" >
    ] * href [^ >] *' & replace (myurl, '. ',' \.',)
    'all') & '[^>]*>(.*?) <\>', Foobar.filecontent) >
    link

    no link...


    ... connection error or the web page you requested does not exist...

    of course, if the www.VisitorsPage site is sneaky and has the link to
    your site code page, but hide it with css/javascript, it's going to
    be difficult to discover using regexp... better just go and watch their
    Web site...

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com/

  • How to check if a node exists in the XML file?

    I was asked to program a method to import data from xml files in our Coldfusion 8 Web site, I am new to the use of XML.

    My method worked however I encountered the following error:

    Element NETWORKORDER. SECONDARYADDRESS. CONTACTNAME is undefined in MYDOC.

    Investigation on the node in the XML file was not present.

    Is there a method I can use to resolve this error by checking if a node exists in the xml file, which works with my current code below?

    <!--> reading XML file
    < cffile action = "read" file = "D:\website\XML\#FileName#" variable = "myxml" >
    < cfset mydoc = XmlParse (myxml) >

    <!--> to extract data from the XML of NDS file
    < cfset aPrimaryContactName =(#mydoc.NetworkOrder.PrimaryAddress.ContactName#) >
    < cfset aPrimaryContactNumber =(#mydoc.NetworkOrder.PrimaryAddress.ContactNumber#) >
    < cfset aPrimaryContactNumber = tostring(#mydoc.NetworkOrder.PrimaryAddress.ContactNumber#) >
    < cfset aPrimaryContactAddressLine1 =(#mydoc.NetworkOrder.PrimaryAddress.line1#) >
    < cfset aPrimaryContactAddressLine2 =(#mydoc.NetworkOrder.PrimaryAddress.line2#) >
    < cfset aPrimaryContactAddressLine3 =(#mydoc.NetworkOrder.PrimaryAddress.line3#) >
    < cfset aPrimaryContactAddressLine4 =(#mydoc.NetworkOrder.PrimaryAddress.line4#) >
    < cfset aPrimaryContactAddressLine5 =(#mydoc.NetworkOrder.PrimaryAddress.line5#) >
    < cfset aPrimaryContactCity =(#mydoc.NetworkOrder.PrimaryAddress.City#) >
    < cfset aPrimaryContactPostcode =(#mydoc.NetworkOrder.PrimaryAddress.PostalCode#) >
    < cfset aPrimaryContactCounty =(#mydoc.NetworkOrder.PrimaryAddress.CountrySubdivision#) >
    < cfset aPrimaryContactCountryCode =(#mydoc.NetworkOrder.PrimaryAddress.CountryCode#) >
    < cfset aPrimaryContactCountry =(#mydoc.NetworkOrder.SecondaryAddress.Country#) >
    < cfset aSecondaryContactName =(#mydoc.NetworkOrder.SecondaryAddress.ContactName#) >
    < cfset aSecondaryAttentionOfName =(#mydoc.NetworkOrder.SecondaryAddress.AttentionOfName#) >
    < cfset aSecondaryContactNumber =(#mydoc.NetworkOrder.SecondaryAddress.ContactNumber#) >
    < cfset aSecondaryContactAddressLine1 =(#mydoc.NetworkOrder.SecondaryAddress.line1#) >
    < cfset aSecondaryContactAddressLine2 =(#mydoc.NetworkOrder.SecondaryAddress.line2#) >
    < cfset aSecondaryContactAddressLine3 =(#mydoc.NetworkOrder.SecondaryAddress.line3#) >
    < cfset aSecondaryContactAddressLine4 =(#mydoc.NetworkOrder.SecondaryAddress.line4#) >
    < cfset aSecondaryContactAddressLine5 =(#mydoc.NetworkOrder.SecondaryAddress.line5#) >
    < cfset aSecondaryContactCity =(#mydoc.NetworkOrder.SecondaryAddress.City#) >
    < cfset aSecondaryContactPostcode =(#mydoc.NetworkOrder.SecondaryAddress.PostalCode#) >
    < cfset aSecondaryContactCounty =(#mydoc.NetworkOrder.SecondaryAddress.CountrySubdivision#) >
    < cfset aSecondaryContactCountryCode =(#mydoc.NetworkOrder.SecondaryAddress.CountryCode#) >
    < cfset aSecondaryContactCountry =(#mydoc.NetworkOrder.SecondaryAddress.Country#) >

    Since you already have the XML parsed in a document, the easiest is to use xmlSearch(). Take a look at the doc, it is pretty easy to use. Something as simple as:

    To the most complex as:

    And in both cases:

    Read the doc and google is your friend "coldfusion xmlsearch.

  • How to check if a field exists in an if statement

    Hello

    I have several documents that are made up of a number of different areas of digital signature.

    Drawings may have fields of digital signature of Rev 0 up to 6 Rev.

    The script will move the existing digital signature fields to the right.

    I need to include an if statement to check if a particular field exists on the document, and if so to move the field.

    If the field does not exist then will not, it is the part of the script that I have a problem with.

    Error: b has no properties

    Can someone please help change the part of the script which is If (b! = null) / / check if the field exists - this part of the script does not work

    I like to keep a script and it not crack upinto several scripts, where the if statement to check if a field exists.

    The script is the following:

    Moving fields to the right

    var b = this.getField ("Chk R0");
    If (b! = null) / / check if the field exists

    aRect var = b.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    b.Rect = aRect; Update the original form field

    var c = this.getField ("of the App R0");
    If (c! = null);
    aRect var = c.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    c.Rect = aRect; Update the original form field

    var d = this.getField ("Proj App R0");
    If (d! = null);
    aRect var = d.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    d.Rect = aRect; Update the original form field


    e var = this.getField ("Chk R1");
    If (e! = null);
    aRect var = e.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    e.Rect = aRect; Update the original form field

    var f = this.getField ("Design App R1");
    If (f! = null);
    aRect var = f.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    f.Rect = aRect; Update the original form field

    var g = this.getField ("Proj App R1");
    If (g! = null);
    aRect var = g.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    g.Rect = aRect; Update the original form field


    var h = this.getField ("Chk R2");
    If (h! = null);
    aRect var = h.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    h.Rect = aRect; Update the original form field

    var i = this.getField ("Design App R2");
    If (I! = null);
    aRect var = i.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    i.Rect = aRect; Update the original form field

    var j = this.getField ("Proj App R2");
    If (j! = null);
    aRect var = j.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    j.Rect = aRect; Update the original form field

    var k = this.getField ("Chk R3");
    If (k! = null);
    aRect var = k.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    k.Rect = aRect; Update the original form field

    var l = this.getField ("Design App R3");
    If (l! = null);
    aRect var = l.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    l.Rect = aRect; Update the original form field

    var m = this.getField ("Proj App R3");
    If (m! = null);
    aRect var = m.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    m.Rect = aRect; Update the original form field


    var n = this.getField ("Chk R4");
    If (n! = null);
    aRect var = n.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    n.Rect = aRect; Update the original form field

    var o = this.getField ("Design App R4");
    If (o! = null);
    aRect var = o.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    o.Rect = aRect; Update the original form field

    var p = this.getField ("Proj App R4");
    If (p! = null);
    aRect var = p.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    p.Rect = aRect; Update the original form field
    var q = this.getField ("R5 Chk");
    If (q! = null);
    aRect var = q.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    q.Rect = aRect; Update the original form field

    var r = this.getField ("Design App R5");
    If (r! = null);
    aRect var = r.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    r.Rect = aRect; Update the original form field

    var s = this.getField ("Proj App R5");
    If (s! = null);
    aRect var = s.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    s.Rect = aRect; Update the original form field


    var t = this.getField ("Chk R6");
    If (t! = null);
    aRect var = t.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    t.Rect = aRect; Update the original form field

    var u = this.getField ("Design App R6");
    If (u! = null);
    aRect var = u.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    u.Rect = aRect; Update the original form field

    v var = this.getField ("Proj App R6");
    If (v! = null);
    aRect var = v.rect;
    aRect [0] += 39;
    aRect [2] += 39;
    v.Rect = aRect; Update the original form field

    You must place brackets around each if the block of code:

    If (c! = null) {}

    aRect var = c.rect;

    aRect [0] += 39;

    aRect [2] += 39;

    c.Rect = aRect; Update the original form field

    }

  • How to check if the value is NULL in the script

    Please, tell which function should I use to check if the value is NULL
    as: If some_member = NULL then...

    Thank you very much

    If you mean #missing:

    Commission (IF (sales <> #MISSING))
    Commission = sales *. 1;
    Another Commission = #MISSING;
    ENDIF ;);

    This example is from the SER60

    PLEASE NOTE: For some reason, the not equals sign does not appear on the first line of the IF statement. (i.e. IF (SALES does not #MISSING))

  • How to check the index, on the number of columns in the table is created

    How to check on the number of columns in the table the index has been created. ??

    OR

    How check index, on the number of columns in the table that it is been created?

    890306 wrote:
    How to check on the number of columns in the table the index has been created. ??

    >

    OR

    How check index, on the number of columns in the table that it is been created?

    query USER_IND_COLUMNS

    SQL> desc user_ind_columns
     Name                            Null?    Type
     ----------------------------------------- -------- ----------------------------
     INDEX_NAME                             VARCHAR2(30)
     TABLE_NAME                             VARCHAR2(30)
     COLUMN_NAME                             VARCHAR2(4000)
     COLUMN_POSITION                        NUMBER
     COLUMN_LENGTH                             NUMBER
     CHAR_LENGTH                             NUMBER
     DESCEND                             VARCHAR2(4)
    

    Handle: 890306
    Status level: Beginner
    Join date: October 8, 2011
    Messages total: 13
    Total Questions: 5 (5 open)

    Why all the question still pending?

    Published by: sb92075 on December 3, 2011 17:21

  • How to create a default value for the timestamp column?

    I am trying to create a table with a default value to a timestamp column, can it be done?


    CREATE TABLE matbl
    (
    Default TIMESTAMP WITH time ZONE SCHEDULE date FutureDateTime ' 23:23:59.000 2999-12-31'
    )

    incorrect data type. try rather timestamp with time zone.

    CREATE TABLE myTbl
    (
    FutureDateTime TIMESTAMP WITH TIME ZONE  default to_timestamp ('2999-12-31 23:23:59.000','yyyy-mm-dd hh24:mi:ss.ff')
    )
    
  • How to check if the value of text is in a view accessor? How can I check for validation?

    Hi Experts ADF,

    JDeveloper 12.1.1.3.0

    I have a VO with a Segment1 column. And I have an accessor in my VO as SegmentVA which contains all the numbers.

    So in the user interface, I'm having a Segment1 as an inputText. The user should then enter values in inputText.  How can I check to validate that the value you enter must be valid within the ViewAccessor.

    Thank you

    Animesh

    You can use a declarative approach and define the Validation rule on EO attribute.

    Or you can create the method in your ViewObjectImpl class, expose this method as a customer interface, create custom for your input field validator and invoke the VO method from there.

    Dario

  • How to check with 3 values of segment data

    Hi all

    The description has 4 segments separated with spaces, so I need to check if all the lines are there since the 3 combinations of the value of 'ABC100 (1). CCC (2). 5418 (3) .AR (3)'

    create table sample_test(cross_number varchar2 (15), item_id issue, description varchar2 (20));

    insert into sample_test values (12 345 100,'ABC100.) CCC.5418.AR');

    insert into sample_test values (12 346 101,'ABC100.) DDD.5418.AR');

    insert into sample_test values (12347,'ABC101.) DDD.5418.AR');

    insert into sample_test values (12347,'ABC102.) DDD.5418.AR');

    CROSS_NUMBERITEM_IDDESCRIPTION
    12345100ABC100. CCC.5418.AR
    12346101ABC100. DDD.5418.AR
    12347102ABC101. DDD.5418.AR
    12347103ABC102. DDD.5418.AR

    Expected results

    CROSS_NUMBERITEM_IDDESCRIPTION
    12345100ABC100. CCC.5418.AR
    12346101ABC100. DDD.5418.AR

    Thank you

    Post edited by: Rajesh123 added test additional to understand business

    Have you run my query... I get the expected result. See below...

    SQL > SELECT * FROM sample_test;

    CROSS_NUMBER ITEM_ID DESCRIPTION

    --------------- ------- --------------------

    12345 100 ABC100. CCC.5418.AR

    12346 101 ABC100. DDD.5418.AR

    12347 102 ABC101. DDD.5418.AR

    12347 103 ABC102. DDD.5418.AR

    SQL > WITH qry1 LIKE

    2 (SELECT cross_number,

    item_id 3,.

    REGEXP_SUBSTR 4 (DESCRIPTION,'[^.] +', 1, 1) col1,.

    5 REGEXP_SUBSTR (DESCRIPTION,'[^.] +', 1, 1) col2.

    6 REGEXP_SUBSTR (DESCRIPTION,'[^.] +' 1, 3) col3.

    7 REGEXP_SUBSTR (DESCRIPTION,'[^.] +' 1, 4) col4

    8 OF THE sample_test)

    9. SELECT *.

    Qry1 q1 10

    11. WHERE EXISTS (SELECT NULL

    Qry1 T2 12

    13 WHERE q1.col1 = q2.col1

    14 AND q1.col3 = q2.col3

    15 AND q1.col4 = q2.col4

    16 AND q1.cross_number <> q2.cross_number);

    CROSS_NUMBER ITEM_ID COL1 COL2 COL3 COL4

    --------------- ------- ---------- ---------- ---------- ----------

    12345 100 ABC100 ABC100 5418 AR

    12346 101 ABC100 ABC100 5418 AR

    Thank you

    Ann

  • How to check if a file exists?

    Hi guys.

    I am running javascript in Acrobat .pdf file created in LiveCycle Designer.

    I need to check in silence if an external file outside the open document (C:\something\something\something.pdf) exists or not.

    I understand that I'm only able to do this as a function of confidence within a script to the folder level javascript.  I am familiar with those.   The problem is, I don't know what function I should use and will have a difficult time in the research on it.

    Try to use: doc.exists?

    Try to open the document with a function and catch the error if the file does not exist?

    I'm not so sure that if I just spend my path as a string, say "/ C/Something/something/something.pdf" or if I should first deal with the file as an object like:

    var myFile = new File("/C/Something/something/something.pdf") (which was not in Acrobat... don't try to run it as a function of confidence)

    Please notify.

    Thank you!

    I finished this figure myself.

    XFA/JavaScript in my paper, I call a custom function that I have written and pass a string (or a string variable containing) my file path for that I would like to check:

    if(typeof(MJS_FileExists) == "function") {
        try {
            if(MJS_FileExists("/C/something/somethingelse/filetocheckfor.pdf") == true) {
                xfa.host.messageBox("file is there");
            } else {
                xfa.host.messageBox("file is NOT there");
            }
        }
        catch(e) {
            app.alert("Processing error: "+e)
        }
    }
    

    The function I call is a folder level javascript.   You have to maybe do some Googleing on how and where to install them.   In the my file .js file real javascript level where the function is housed I use:

    var MJS_FileExists = app.trustedFunction(function(filename) {
        app.beginPriv();
        var existingDoc = false;
        try {
             var checkDoc = app.openDoc(filename);
             checkDoc.closeDoc();
         existingDoc = true;
        } catch(e) {
         existingDoc = false;
        }
        return existingDoc;
        app.endPriv();
    });
    

    It took me a lot of trial and error.  It sucks there is not a lot of in on the internet on how to do it via Acrobat / Live Cycle.   Hope this helps someone else.

  • How to check an ascii value of the character in the string

    Hi all
    I have a string that contain alphanumeric values.
    I want only numeric values in this string.
    FRO this purpose.
    I created a varry
    TYPE tab IS VARRAY(10) OF VARCHAR2(10) ;
       var tab
    ;
    variable var of type varray contain this string

    and now I want to check each character in this string at end of validation

    How can I check this particular string

    can I use loop?

    Hello

    If str is a string, then

    REGEXP_LIKE ( str
                , '^[[:digit:]]+$'
                )
    

    Returns TRUE if and only if str contains digits (0 ith 9) and nothing else.
    Here's a way you can use REGEXP_LIKE in PL/SQL:

    SET     SERVEROUTPUT     ON
    
    DECLARE
        str          VARCHAR2 (10)     := '123.4';
    BEGIN
        IF  REGEXP_LIKE ( str
                      , '^[[:digit:]]+$'
                  )
        THEN
         dbms_output.put_line (  str
                        || ' is all digits.'
                        );
        ELSE
         dbms_output.put_line (  str
                        || ' contains something besides digits, or is NULL'
                        );
        END IF;
    END;
    /
    

    Published by: Frank Kulash, December 12, 2011 09:13
    Added PL/SQL example

Maybe you are looking for

  • Try to attach a PDF file (made 1000 times with success: today, it freezes the laptop: (downloaded the latest app new/switch deactivation/activation etc.) no go)

    With the help of Mac Maverick X.9.2 Thunderbird 24.4,0 report to Apple, but not sure that he is gone because there was no sentence of answer.

  • Save the error code 44

    Hi all I'm using labview 13.0 and I am trying to save my project in a different location using the "Save as-> double .lvproj file and content" with all the dependencies.  I select a location on my computer and it starts to run. Once he traveled a few

  • Questioning the compatibility of battery replacement

    I would get a spare battery. I have a V5 - 571P and the rest of the model is 6866. The battery is a 14.8V 2350 mAh. Replacements all seem to be for model numbers 6866 and 2200 mAh. Any idea of the compatibility of these batteries are on a large numbe

  • SPA2101 and WRT610N

    Hi all Before getting my VoIP everything worked fine with my Linksys WRT610.  I have NAT and transfer of facility that allows me to access my network outside port remotely.  I just bought a SPA2101 of my VoIP provider and they told me to install it b

  • IKEv1 and IKEv2

    I have a router 2821 with multiple IPSec Tunnels on it.  I would like to replace it with an ASA 5510.  My hope is to share these stars with a minimal impact on the active Tunnels.  I have the details of each well-documented Tunnel.  My question or co