Check if values exist in the database

Hello

I have problem with values that are not in the database.

I have a form, and there are two types of users: normal and Admins.

If the user is normal, it can not access anyone else entered the database. But the administrator can access all entries.

I did a check in so that the normal user can only access its entries:

< cfif NOT session. Admin AND process.addedBy NEQ #session. AccountID # >
< cflocation url = "main.cfm" addtoken = "no" > "
< cfelse >

<! - rest of the form - >

By these, a normal useer cannot access all entries other than his own.

But for admin, an administrator can access all entries, but not the entries that are not in the database. The query bound to the form is:

< cfquery name = "xx" datasource = "yy" >
Select Properties entryid, addedBy, deletedBy processedBy
Of yy
where entryid = #URL.entryid # AND processedBy IS NULL AND deletedBy IS NULL
< cfif NOT session. Admin > AND addedBy = #Session.AccountID #.
< / cfif >
So both users can access the respective entries, but when the administrator between an entryid in the URL doesn't exist not in the database, do not the page back to the home page, it shows rather the form.

So my question is how to avoid the values not in the database.

Thanks for the help.

Vijayvijay77.

Well, if you want to check that she thought, why not just use RECORDCOUNT? It's a bit what it is there for.

SOME stuff

Tags: ColdFusion

Similar Questions

  • How we prevent insert if the record with same EmpName exist in the database?

    Hi all

    My use case is as follows:

    The values of user input in a form of the adf, which includes a field EmpName. Then click on submit button. If that name exists in the database, user should not be allowed to save this record and shown an alert in place that says: 'record' already exists.

    All solutions?

    Here's what you'll need:

    http://www.gabrielsideras.com/2010/09/28/ADF-unique-key-validation/

  • ashrpt - ORA-20200: samples of ASH NO exist for the DATABASE/Instance

    Hello guyes,

    Please could you help me with the generation of the report of ASHES? I have the stack on:
    "ORA-20200: NO samples of ASH does exist for the DATABASE Instance / '.

    I tried to find how to sample, but the only things I found is for statspack or awr.

    Thanks a lot :)

    redy007 wrote:
    sb92075:
    SYS@PMBTEST > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11 g Release 11.2.0.2.0 - 64 bit version of PL/SQL Production 11.2.0.2.0 - Production
    CORE Production 11.2.0.2.0
    AMT for Linux: Version 11.2.0.2.0 - Production NLSRTL Version 11.2.0.2.0 - Production

    The active Session history exists only in the Enterprise edition.

  • How can we check that the data already exist in the database

    Hi friends

    I'm trying to create a procedure for adding clients in the database with the customer id as input parameter... but if the customer details database already exists that I would update this detail and is not in the database I want to add this detail in the database... How could I do that...

    any help would be appreciated

    Thank you
    Rommy

    Hello

    If your condition is to add to a table, and if the record exists in the other table, the merge statement does not work

    Example (Please check the column name and the parameter names). I do not commit or rollback because I do not know if you control the transaction within this procedure or outside it.

    CREATE OR REPLACE PROCEDURE add_cust(I_CUST_ID        IN VARCHAR2,
                                         I_CUST_F_NAME    IN VARCHAR2,
                                         I_CUST_L_NAME    IN VARCHAR2,
                                         I_CUST_ADD       IN VARCHAR2,
                                         I_CUST_CITY      IN VARCHAR2,
                                         I_CUST_STATE     IN VARCHAR2,
                                         I_CUST_ZIP       IN VARCHAR2,
                                         I_CUST_DOB       IN DATE,
                                         I_CUST_          IN VARCHAR2,
                                         I_CUST_ACCT_TYPE IN VARCHAR2,
                                         I_START_BAL      IN NUMBER) IS
    BEGIN
       INSERT INTO CUSTOMERS C
          (CUST_ID,
           CUST_F_NAME,
           CUST_L_NAME,
           CUST_ADD,
           CUST_CITY,
           CUST_STATE,
           CUST_ZIP,
           CUST_DOB,
           CUST_)
       VALUES
          (I_CUST_ID,
           I_CUST_F_NAME,
           I_CUST_L_NAME,
           I_CUST_ADD,
           I_CUST_CITY,
           I_CUST_STATE,
           I_CUST_ZIP,
           I_CUST_DOB,
           I_CUST_);
    
    EXCEPTION
       WHEN DUP_VAL_ON_INDEX THEN
          INSERT INTO CUSTOMER_ACCT
             (CUST_ID,
              CUST_ACCT_NO,
              cust_acct_type)
          VALUES
             (I_CUST_ID,
              CUST_ACCT_SEQ.NEXTVAL, -- CUST_ACCT_SEQ is a sequence, isn't?
              I_CUST_ACCT_TYPE);
    
    END add_cust;
    

    Kind regards

  • 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.

  • Check if e-mail exist in the database table

    I stumbled on this a few times before, but I'm not familiar with this system, whenever you enter an emailaddress, you see as a clock indicating the system checks if the e-mail address may be used, in other words, is not yet in a table. I would like something similar and when the "audit" is done and the emailaddress is not in the DB table, the rest of the form appears, otherwise, an error message indicates the address is already in use. I guess this could be done using Javascript, but is there also a PHP way to do this?

    It's simple to achieve. Create a query that filters your e-mail address in the database table WHERE = POST of the email field in the form is sent. If the query returns a line then the email already exist, otherwise it is available and can treat the rest of the form.

  • How to get the max sequence number when some record exists in the database table

    Hello

    I need to create the sequence that he should leave value max already exists in the table.

    Example:
    I have a table as below:

    ID NAME
    1A
    1 a
    3 C
    4 D


    Now, during the creation of sequence it should start from 5 but I should ' t START WITH 5 hard-code in the sequence to create. Is it possible to do without Hardcoding the max value in the sequence. It automatically brings the value max + 1 for the next data when I insert.


    CREATE THE TEST_SEQ SEQUENCE. NEXTVAL
    START WITH [Max + 1 val of the table]
    MAXVALUE 9999999999999999999999999999
    MINVALUE 1
    NOCYCLE
    CACHE 20
    ALL;


    Thank you...

    Published by: 998976 on April 18, 2013 04:37

    Published by: 998976 on April 18, 2013 04:38

    Hello

    All the numbers in a CREATE SEQUENCE statement are literals; no other types of numeric expressions are allowed.
    You need dynamic SQL statements to do something like what you want. For example:

    COLUMN     seq_start_col     NEW_VALUE  seq_start
    
    SELECT     1 + MAX (val)     AS seq_start_col
    FROM     table_x;
    
    CCREATE SEQUENCE TEST_SEQ.NEXTVAL
    START WITH  &seq_start
    MAXVALUE 9999999999999999999999999999
    MINVALUE 1
    NOCYCLE
    CACHE 20
    NOORDER;
    
  • RowAlreadyDeletedException so that the line exists in the database

    Hello

    JDev 11.1.2.4

    I put in place the mechanism to keep the current line on the restoration.

    http://andrejusb.blogspot.ch/2013/03/ADF-rollback-and-keep-current-row.html

    In a managed bean I call the restore operation, and if the restoreCurrentRow is called on all your.

    The code is in the VOImpl database which all your runs from:

    protected void restoreCurrentRow() {}

    If (currentRowKey! = null) {}

    _logger.fine ("START RESET CURRENT ROW");

    _logger.info ("restoreCurrentRow" + this.getClass () + "" + currentRowKey + "" + this.getName ());

    this.executeQuery (); < = RowAlreadyDeletedException thrown here

    Key k = new Key (currentRowKey.getAttributeValues ());

    [] Found line = this.findByKey (k, 1);

    If (found! = null & & found.length == 1) {}

    Line r = this.getRow (k);

    this.setCurrentRow (r);

    If (r! = null & & currentRowIndexInRange > = 0) {}

    this.scrollRangeTo (r, currentRowIndexInRange);

    }

    }

    _logger.fine ("FINISHING RESET CURRENT ROW");

    }

    currentRowKey = null;

    }

    For on VO, I get an RowAlreadyDeletedException exception:

    < Utils > < buildFacesMessage > ADF: addition of the following JSF error: line entity with key oracle.jbo.Key [2044346 null] is not in VwWrkdclWrkTitle.

    oracle.jbo.RowAlreadyDeletedException: Houston-25019: line entity with key oracle.jbo.Key [2044346 null] is not in VwWrkdclWrkTitle.

    at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:875)

    at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:552)

    at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:8311)

    at oracle.jbo.server.EntityImpl.populate(EntityImpl.java:6975)

    at oracle.jbo.server.EntityImpl.merge(EntityImpl.java:7314)

    at oracle.jbo.server.EntityCache.addForAltKey(EntityCache.java:1087)

    at oracle.jbo.server.EntityCache.add(EntityCache.java:541)

    at oracle.jbo.server.ViewRowStorage.entityCacheAdd(ViewRowStorage.java:3173)

    at oracle.jbo.server.ViewRowImpl.entityCacheAdd(ViewRowImpl.java:3799)

    at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:5913)

    at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:3637)

    at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:3492)

    at oracle.jbo.server.QueryCollection.get(QueryCollection.java:2209)

    at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:5125)

    at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2961)

    at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2817)

    at oracle.jbo.server.ViewRowSetIteratorImpl.refresh(ViewRowSetIteratorImpl.java:3058)

    at oracle.jbo.server.ViewRowSetImpl.notifyRefresh(ViewRowSetImpl.java:2797)

    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:1255)

    at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:1413)

    at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:1319)

    at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:1304)

    at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:7211)

    at org.xxx.common.model.adfbc.base.MyViewObjectImpl.restoreCurrentRow(MyViewObjectImpl.java:238)

    at org.xxx.common.model.adfbc.base.MyViewObjectImpl.afterRollback(MyViewObjectImpl.java:230)

    at oracle.jbo.server.DBTransactionImpl.rollback(DBTransactionImpl.java:2544)

    at oracle.adf.model.bc4j.DCJboDataControl.rollbackTransaction(DCJboDataControl.java:1600)

    VwWrkdclWrkTitle is a SQL view.

    In the managed bean, I call a PL/SQL operation. PL/SQL commits the changes, and then I call the restore operation.

    So I set a breakpoint after the operation of PL/SQL and test the SQL and I get a single record. Because the PL/SQL is committed, before restoring SQL must return the same as the restoreCurrentRow method.

    I do not understand this RowAlreadyDeletedException exception because the line exists.

    Thank you

    I changed to a primary key that is never zero, and it works. Seems to be a bug in the ADF.

  • Not available user: schema does not exist in the database?

    Hi team,

    I am trying to add to the existing table. Plaintiff mentioned schrma_name and table_name.

    I used under request... to find the schema exists or not.

    Select the username, ACCOUNT_STATUS from dba_users where username = "ABCD_USA_NUM";

    no selected line.

    Please suggest one., average user schema did not exist right did not exist? It is 4 knots of RAC database.

    Thnaks
    Please suggest any one., User not existed means schema not existed right?. This is 4 nodes RAC Database.
    

    In your case, Yes.

    Rgds,

    Ahmer

    N.B.: To win a good reputation on the forums, and if you want that your question will be answered in due time. Kindly adopt a used to score your closed questions as soon as you give the answer. and be courteous to people who tries to help.

  • Failed to load existing records from the database on SD card during initialization of the application

    When the Simulator is launched upward, not able to load existing records from the database in the Inbox, so no records appear in the Inbox even though they exist in the database. It seems to be a problem with the SD card in the Simulator - the file system for the SD card is not correctly initialized when the application starts first to the top. During initialization of the application tries to access the SD card by using the following code.

    Boolean

    sdCardPresent = false;

    Enumeration e = FileSystemRegistry.listRoots ();

    If

    (e! = null) { }

    While (e.hasMoreElements ()) {}

    root = (String) e.nextElement ();

    If

    (root.equalsIgnoreCase("SDCard/")) {

    sdCardPresent =

    true;

    }

    }

    }

    sdCardPresent is always set to false and was not able to access existing records from the database. Once the application is initialized and try to create the database, the database is created successfully on the SD card.  The code is the same as above when creating the database and was able to do sdCardPresent = true.

    Is there anyway to register or add the SD card during initialization of the application or any property as System.setProperty overide the path of the default directory value?

    I use BlackBerry 9550 Simulator. I checked the "file system using PC for files from the SD card" and I use "C:\bb\SDCard" for the file system of thr.

    Also tested on the BlackBerry and found the same thing, if the device is hard reset, then it not reading the SD card as well.

    Mark the thread as solved then.

  • Verify that the database is a node or normal grid

    Hi, is there a way to check (selet) to see if the database is 'A CCR node' ora a normal instance of RAC, but it must be with a database?

    Thank you and best Rgards

    You can use the command 'srvctl config database-d XX' and check the [type] value accordingly.

  • deleted table showing nt available in the database

    Dear friends,

    my database is running in mode newspaper archive and I dropped a table say table1.i ran the RMAN command below

    RMAN > run
    2 > {}
    3 > restore database;
    4 > restore database;
    {5 >}

    in the above command we restore from backup and applying all archivelogs, m I right?.
    After the restoration and recovery of the database by using the RMAN command above, when I checked the deleted table table1, I m getting error - table1 does not already exist in the database.
    can you please tell me why, after restoring and applying all archivelog why I have not dropped the table?

    OS-linux rhel 5.7
    DB - 10.2.0.3

    Mihael I m still confused because why the fall did not return after executing a full recovery of the database using the RMAN commands shown below

    RUN
    {
    RESTORE THE DATABASE;
    RECOVER THE DATABASE;
    }
    can you explain please?

    complete recovery means apply all changes to the database, including the fall of the table

  • Find the number of files repeatedin the database.

    Hi all

    I have a sample of the table in which sample_desc column is of type varchar2.

    Previously, I stored the sample_desc in lowercase only.

    Now, I had a requirememt to store data in the event of high, which is easily done.

    Now, I tried to question the values that are stored in lower and upper case.

    I mean, for example if "hhh11" is stored previously and if I memorized "HHH11" then
    I want to know that 'hhh11' and 'HHH11' exists in the database.

    I tried this by querying with upper and lower functions, but I'm unable to get the result.

    Please help me.

    Thank you
    Rambeau
    SQL> create table tab1 (id number);
    
    Table created.
    
    SQL> create table "tab1" (id number);
    
    Table created.
    
    SQL> select table_name from all_tables where table_name like '%1' and owner='SYS';
    
    TABLE_NAME
    ------------------------------
    TAB1
    tab1
    
    SELECT   UPPER (table_name), COUNT (UPPER (table_name))
        FROM all_tables
       WHERE table_name LIKE '%1' AND owner = 'SYS'
      HAVING COUNT (UPPER (table_name)) > 1
    GROUP BY UPPER (table_name)
    

    ------- -----
    TAB1 2

    - - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev a. (10g OCP)
    http://kamranagayev.WordPress.com

  • OK to install forms independent 10.2.1 on the same server as the database 10 g 2?

    Is it OK to install forms independent 10.2.1 on the same server as the database 10 g 2?

    According to the install for forms requirements check, I have until my kernel parameters of my original config that follows that install the values required for the database. Will I need to worry about these types of changes to the server on how it effects my current database?

    Thank you.

    Of course, there is no technical problem other than memory, drives, etc. constraints.

    We use these Frankenstein servers with a mix of Developer Suite and Oracle database of different development versions. Not the best situation, of course. Just be careful of path and ORACLE_HOME settings when doing things like patching with OPATCH since there is more than one instance in which these commands may apply.

    Published by: user577087 on August 28, 2008 01:24

  • Download file from the database server, through application server.

    Nice day

    I use Jdeveloper 11.1.2.3.0.

    I have a requirement to download a file that already exists on the database server Directory. Now my current scenario is that user is connected to the application server, and the user has no direct access to the database server.  I drew a diagram of my requirement as:


    DownloadFile.png


    I get a way to do this. Please suggest.


    Best regards,

    Julien

    The session does not expire if you are streaming data from the application to the client. However, you will need to manage the data sent over the network, because it can make the very slow network if you send this amount of data at high speeds on the network and then to the customer. This connection between client and server is the biggest problem, because bandwidth is usually small. Think about downloading software by one side oracle (for example 1 GB), this takes time and is prone to errors.

    We did something similar by transferring the data from the database (in our case, it has been stored in a BLOB) on a dedicated server with a server web apache on it. Then, we send a link to the client, which then uses the link to get the special file server data.

    The advantage is that you don't have to code the transfer of huge files in the application of the adf but can already use ready to use of software (balancing bandwidth and the recovery of a broken download).

    Timo

Maybe you are looking for

  • last updated

    the last update took away my ability to edit, trash all mails at once. I get every day about 1000 spam emails and it will still remove them one by one.  What is the solution? Thank you.

  • Satellite C850 - 1 2 Impossible to Win 8 to 8.1

    When I try to upgrade Win 8 to 8.1 I get a message that says update Win first 8.When I try to update Win 8 I get 132 updates. I spent many hours trying to perform this task, but the updates are not installed. I tried using the troubleshooting tool th

  • Cannot start the ms exchange system attendant service

    Hi, im having a hard time to troubleshooting why MSExchangeSA does not start...  It says "attendant Microsoft Exchange System on Local computer started and then stopped. Some services stop automatically if they have no work to do, for example, the se

  • convert fat32 to ntfs files

    peace be upon you Thank your answer ror I hope that your work of solution with me Thank you very much

  • installation window 10 on a hard drive not a solid, one State

    go pc not mac using window 7 install what to buy window 10 and do a full. look to see are back window 10 still come on a disc is there download a flash Pen. the other issue is if I format the hard drive to Windows 7 would I have trouble to install wi