SQL Expressions in Declarative SQL mode VOs - possible?

Hi all,
I am planning to create a declarative SQL mode VO and am wondering if I would be able to use SQL expressions on the select clause - for ex- SUBSTR(col1,1,10). Is this possible?
I searched around and could find no reference.
Thanks,
Srini

Srini, @chris hope you don't mind me stepping in
Just checked this in 11.1.1.4.0 and 11.1.1.6.0 and it worked for me.
I used the HR schema and the Departments table
  <ViewAttribute
    Name="DepartmentName"
    IsNotNull="true"
    PrecisionRule="true"
    EntityAttrName="DepartmentName"
    EntityUsage="Departments"
    AliasName="DEPARTMENT_NAME"/>
  <ViewAttribute
    Name="nnn"
    IsPersistent="false"
    PrecisionRule="true"
    Precision="255"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    AliasName="VIEW_ATTR"
    Passivate="true"
    Expression="SUBSTR(DEPARTMENT_NAME, 1, 5)"
    SQLType="VARCHAR"/>
...The nnn attribute I added to show only the first 5 characters of the department name.
Timo

Similar Messages

  • SQL access not possible (LC10 / LiveCahce)

    Hi All!
    I have installed my SCM system and LiveCache Client on the iSeries. My LiveCache Server is installed on a Windows 64-bit Server. I am following the post steps to Initialize LiveCache:
    To initialize the liveCache instance LCA:
    a) Choose Back (F3).  (in LC10)
    The liveCache: Initial Screen re-appears.
    b) Enter LCA in the Name of database connection field.
    c) Choose liveCache: Monitoring.
    In the tree structure select <LC_NAME>(<host name-LC_Name>) Administration and
    double-click on Operating.
    The liveCache Administration menu appears.
    e) From the menu, choose Administration Initialize liveCache
    Several dialog boxes appear.
    f) Confirm with Yes.
    But when the screen comes up after selecting LiveCache Monitoring, up in the left hand corner, there is an '!' that reads: SQL access not possible .
    Has anyone encountered this problem?
    Thanks!
    Diana

    Hello Diana,
    As I saw in your posts::
    B Connect to LCA as SUPERDBA with sapliv01-LCX
    Try to connect as SUPERDBA/<pwd>@sapliv01-LCX on connection 1 ...
    C Attach to SAP DB : Kernel 7.6.00 Build 029-123-130-265
    C Database release is SAP DB 7.6.00.029
    C INFO : Database 'LCX' instance is running on 'sapliv01'
    C INFO : LVC DEFAULTCODE = ASCII
    C *** ERROR => different codepage: application=UNICODE, LVC=ASCII
    http://dbslsdb.cpp 4668
    B ***LOG BY2=> sql error -4025 performing CON dbds#1 @ 1044 dbds 1044 "
    ==>
    The problem is that you tried to connect as SUPERDBA user, which was created
    with Default type < database parameter DEFAULT_CODE=ASCII > & the Application is UNICODE system.
    What has to be checked/fixed on your system:
    -> Go to TA LC10 -> LCA connection -> Integration && check what user you set for the Standard liveCache user. Why did you set 'SUPERDBA' user ? It has to be SAPR3 or SAP<SID>. Check what
       user you selected during the liveCache installation as LCUSER.
    -> Please check in LC10 -> Integration for LDA/LEA connections if you set the DBM user - control
       & liveCache user and passwords correctly. You could also test connections in /ndb59.
    -> For SAP liveCache documentation see the SAP note 767598.
         The SAP liveCache documentation in English available for SAP customers at: 
        http://help.sap.com/saphelp_nw70/helpdata/en/b6/cbdda6248ff648ae9f39f8e28eb24f/frameset.htm     
        -> Database Administration in CCMS: SAP liveCache Technology
        -> liveCache Assistant -> Integration
    -> The SUPERDBA user is usually SYSDBA user, see "Brief description of the user types" in the database in the SAP note 25591
    -> If you have further problems with liveCache/MAXDB please post them at
    MAXDB/liveCache forum: SAP MaxDB
    Thank you and best regards, Natalia Khlopina

  • LC10 - Monitoring: I get a message that SQL Access Not Possible

    In our SCM 2007 system, when going to transaction LC10 -> Monitoring, I get a message in the top left box that says SQL Access Not Possible.  Also, when I go to LCA03, I get a short dump with: Exception condition "LC_CONNECT_FAILED" raised.
    This started happening after I changed the password for users:  control and lcuser within the livecache database.  I updated these passwords withing SCM -> LC10 -> integration and restarted the SCM system, but I still get this failure.  I can run commands against the livecache database directly with dbmcli using the same username / password I put into LC10 and I don't get any errors.
    This error shows up in the work process trace:
    C  *** ERROR => Connect to database failed, rc = -4008 (POS(1) Unknown user name/password combination)
    If anyone has experienced this before, I appreciate any input.  Thank you.
    ~TJ

    Hello,
    Please update with additional information :
    -> Did you follow the SAP note 616555 to change the passwords in the liveCache.
    -> Please logon to the liveCache server, run the following commands & update
         with the outputs:
           xinstinfo <SID>
          dbmcli -d <SID> -u control,<new_password>
          <enter>
         dbmcli on <SID>>db_state
         dbmcli on <SID>>sql_execute select * from users
         u2026.
         dbmcli on <SID>>sql_connect lcuser,<new_pwd>
         u2026
         dbmcli on <SID>>sql_release
         u2026
         dbmcli on <SID>>sql_execute user-type=SAP select user from dual
         u2026
         dbmcli on <SID>>exit
    -> Run the test connection on your system in /ndb59 for the LCA connection & update the thread with the log.
    Thank you and best regards, Natalia Khlopina

  • Error Message: Change of update mode not possible due to open V3 update

    Hi Gurus,
    I got error message when i change update mode (LBWE) from V3 to Direct or Queued delta method.
    Error Message: Change of update mode not possible due to open V3 update
    Long text: You are not allowed to change the update mode for application 11 from V3 to another method. This is because there are still V3 update entries for update module MCEX_UPDATE_11 that have not been processed yet.
    Pls anyone give solution for this.
    Thanks
    Muthu

    Hi Sreeni,
    i did check in all the below Tcode as you adviced.
    1. Clear all record at SM13, LBWQ / SMQ1, Setup tables, RSA7 for particular datsasource or application..
    2. For LBWQ provide date range and delete not required records.
    I did not get the 3rd point " Need to clear in CLINTS of R/3 system" of your reply.
    what does that mean?
    I checked all the above tcodes and got the same message as no queue or data exists".
    I went SBIW tcode and activated my data source and try to change the Update mode but still it is throwing error message as "Change of update is not possible due to open V3"
    Please help me out.
    It will be very helpful for me if you could share steps or docs regarding this issue.
    Thanks,
    Shailaja

  • Airport Express in 802.11n mode with an Xbox 360

    I have an Airport Express (with software 7.5.2) and am having problems connecting my Xbox 360 in 802.11n mode.  I have an Xbox 360 (one year old, not the new 360 S Console) and an Xbox Wireless N Networking Adapter (Model 1398).
    I believe my Airport Express is working fine as I've been able to connect my MacBook and iPad 2 when I've run the Airport Express in any combination of modes -- 802.11g 2.4 or 5.0 GHz, 802.11b compatibility, etc. 
    I've also found that the Xbox will connect when I run the Airport Express in 802.11g mode, but it fails to connect in any n mode.  I've tried several combinations including varying the security -- WPA2 or no security at all.  Since the same Xbox and Apple hardware can connect when running in 802.11g mode, and I've got Apple devices talking to the AE in 802.11n mode, I'm suspecting the Xbox hardware.
    I've looked through a few forum posts here, and most of them seemed to be older and referenced a bug in an older version of the AE software.  At least one mentioned that the person had a defective Xbox wireless adapter, which I'm beginning to suspect.
    I've even turned on syslog logging on the Airport Express and used my MacBook as the syslog server.  Even though I've turned the Syslog level up to 7 (Debug) on the AE, I don't get any messages about Xbox connection attempts -- just successful connections from my iPad and MacBook.
    Any advice is appreciated!
    Thanks,
    Dan

    Hi. Thanks for the reply. It turns out that the router was not going into n mode because of the security I set on it. I finally figured this out and the AE did connect in n mode after all.
    Well at least it's working now but I feel a little bad for posting when it was my fault!!
    Cheers!

  • PL/SQL cursor question (possible to pass in the table name?)

    I want to pass the name of a table to a cursor and select from that,
    Is this possible in PL/SQL?
    CURSOR get_rows(table_name IN VARCHAR2) IS
    SELECT * FROM table_name;
         The actual sql statement that will be used is more complex.
         I have 18 tables for which the same query would work varrying only in the name of the table.
    I get an error when I try to do the above.

    >
    I am not quite sure how you can derive anything from the design given the example that has all other details stripped out
    >
    What Justin said is pretty clear
    >
    If you are really doing a SELECT * and you have 18 different tables, it seems unlikely that all tables would always have exactly the same set of columns. If they do, that is almost certainly an indication that the data model is incorrect.
    >
    A data model that includes 18 tables with the same set of columns has something wrong with it. You explained that by clarifying that it is only TWO columns in each of the 18 tables that is the same. Perhaps the tables have one-to-many relationships and the two columns are the key columns. That is different.
    >
    The 'select *' will actually pull back only two columns, both of which are primary keys (long). I need to select all rows into a data structure that is global that I can iterate through at a later time. So given that I can use a ref cursor and have a dynamic table name, how would I select into a data structure that is of two primary keys and make that global to be used in another method at a later time?
    >
    Why not use an actual table to store the column data? An index-organized table would be perfect for that use and won't use up valuable user memory.
    And by global do you mean the data needs to be accessible by a different session than the one that collected the data?
    And what do you mean by 'later'? Tomorrow or next week?
    The use case you describe sounds like you are having to update primary key values in tables that have parent-child foreign key constraints. Is that what you are doing? Can you do this offline and defer or disable the constraints, perform an update (rather than insert/delete) and then reenable the constraints?

  • Using variable as table name in pl/sql query - Is possible?

    I am relatively new to PL/SQL and I am trying to create a function that accepts a table name and a rowid as arguments and returns a comma-delimited record string of the values of the table/rowid being passed. The problem is , I cannot code a select stmt as follows
    SELECT * FROM v_table_name
    WHERE rowid = v_row_id
    in PL/SQL. There must be a easy way to approach this.
    Thanks for any and all advice.
    GC

    I don't understand the use of the concat symbol along with the commas and field namesYou just need (if you really need it) to create variable which contains you column separated by comma:
    Simple example (in the second case separate variables are used to create
    the list of columns):
    SQL> declare
      2   rc sys_refcursor;
      3   cols varchar2(200) := 'ename, empno, sal';
      4   tab varchar2(30) := 'emp';
      5  begin
      6   open rc for 'select ' || cols || ' from ' || tab;
      7   close rc;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2   rc sys_refcursor;
      3 
      4   ename_col varchar2(10) := 'ename';
      5 
      6   empno_col varchar2(10) := 'empno';
      7 
      8   sal_col varchar2(10) := 'sal';
      9 
    10   tab varchar2(30) := 'emp';
    11 
    12  begin
    13 
    14   open rc for 'select ' || ename_col || ',' || empno_col || ',' || sal_col ||
    15   ' from ' || tab;
    16 
    17   close rc;
    18  end;
    19  /
    PL/SQL procedure successfully completed.Rgds.

  • SQL Mode Command to update database table

    Hi All,
    I have a couple of scenarios which I need help with:
    1)
    - I have a sql query which pulls two columns lets say Equipment and a val1 from a sql database table displayed in a grid.
    - Once the user clicks on a record I have two text boxes which get the value of the selected records on the same page (equipment, val1).
    - I then have an update button, wherein they can change the value of the val1 column.
    I have created a sql query of mode command with an update statement. My question is, how do I execute this update query from the webpage, I know how to assign the parameters so the get passed to the update query I just am not sure how to kick off the update query. Do I have to have it as part of an applet to even refer to it from within my webpage? If so, don't I have to assign an applet a display template? (this command query does not have an output). Please help...
    Thanks,
    Mahwish

    I have done scenario 2, but its not easy.  This is how I did it.
    Instead of using the iGrid applet, I used an XSLT stylesheet to create a "grid" of input boxes in HTML that allow direct editing of the value.  At the end of each row you had an "update" button that passed the value of the updated box, and the corresponding information you need for icommand update.  You can either display the information you need for the update query in the "grid"  or you can use hidden form objects to store the information.   Indexing is pretty easy, you just name the form elements by positions  (eg. frmTxtR1C1)  for example.
    The solution is not for the faint of heart, takes some development time and a fair amount of XSLT knowledge, but if you need this functionality repeatedly in your application, it works great.  It looks really slick too because you can do things like change the color of your form after you have updated it so the user knows there has been a change.    Of course there are always multiple ways to attack a problem I love hearing other suggestions.

  • SQL Server 2005 - Possible Replication Related Error

    hey all,
    I was setting up a replication job on a server.  I was setting up the publisher end.  I used the wizard to create a scheduled job to do a snapshot of one of our databases.  
    I completed the wizard and clicked Finish.  The progress window appeared and it appeared to get hung on step one of the process (Adding articles).  I killed the job via Task Manager.  This was at 2:11 pm.
    At about 3:30 pm, the server started to become very slow.  I brought up Performance Monitor and the Pages/sec was maxed out.  CPU usage was at 11%.  Memory consumption was at about 50% of total memory.  
    The issue did not clear up and we had to bring the server down and restart it to clear up the issue.  This was at 4:00pm.
    Looking at the error logs, there is a warning for stopping the replication publisher job and removing it.  Then there is an error message regarding a "deactivated schedule 41".  Then errors from bringing the server down.
    I'm wondering if it is possible for the replication publisher job that I killed to have kept running in the background gobbling up resources.  I've done a search of the internet and several forums and I've found nothing conclusive.  
    screen shot of the error logs but I can't insert it yet until my account is verified.

    It is probable that there is an open transaction you will need to kill. Issue a call to dbcc opentran in your publication database and evaluate any open spids to see if you can kill them.
    looking for a book on SQL Server 2008 Administration?
    http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
    http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

  • Tricky SQL - is it possible using just SQL and no PL/SQL

    Hello everyone,
    Here is my data
    create table experience (exp_id number(10), exp_name varchar2(20), root_exp_id number(10));
    insert into experience values (642, 'Test', 5172);
    create table experience_node (exp_node_id number(10), exp_node_type_id number(2));
    insert into experience_node values (5172, 1);
    insert into experience_node values (5173, 2);
    insert into experience_node values (5174, 2);
    create table experience_connector (exp_conn_id number(10), exp_conn_type_id number(2), exp_node_id number(10), parent_exp_node number(10) );
    insert into experience_connector values (4287, 1, 5173, 5172);
    insert into experience_connector values (4288, 2, 5174, 5173);
    insert into experience_connector values (4289, 2, 5175, 5174);
    When we run these queries:
    select     parent_experience_node_id
    from     experience_connector
    where     experience_node_id = 5175;
    select     parent_experience_node_id
    from     experience_connector
    where     experience_node_id = 5174;
    select     parent_experience_node_id
    from     experience_connector
    where     experience_node_id = 5173;
    select     parent_experience_node_id
    from     experience_connector
    where     experience_node_id = 5172;
    gives 5174, 5173, and 5172 and null. exp_node_type_id = 1 and exp_node_conn_type_id = 1 indicate that it is at the root level. Hope my explanation is helpful. What I am trying to get is - to get great great grant parent for 5175 which is 5172. Is this possible to do this with SQL?
    Thank you so much for you help.
    Best,
    Lakshmi

    We can use "model clause" ;-)
    create table T (id number(10), parentID number(10) );
    insert into T values (5173, 5172);
    insert into T values (5174, 5173);
    insert into T values (5175, 5174);
    commit;
    select parentID
      from T
    model RETURN UPDATED ROWS
    dimension by(id)
    measures(parentID)
    rules(
    parentID[9999] = parentID[5175],
    parentID[9999] = parentID[parentID[9999]],
    parentID[9999] = parentID[parentID[9999]]);
    PARENTID
        5172
    or
    select parentID
      from T
    model RETURN UPDATED ROWS
    dimension by(id)
    measures(parentID)
    rules(
    parentID[9999] = parentID[parentID[5175]],
    parentID[9999] = parentID[parentID[9999]]);

  • Sql lite database possible

    I have not tried it
    but can we do a sql lite database with iphones?Or is this only possible with air for android?

    I found out why I couldn't save. In case anyone's interested, the SQLite database I included when publishing the .ipa file is stored in the read-only application directory. You have to copy the database (or text file/XML etc) to the app's storage directory.
    There's a superb explanation and very useful bit of code here: http://blog.ericd.net/?p=315

  • Bulk loading BLOBs using PL/SQL - is it possible?

    Hi -
    Does anyone have a good reference article or example of how I can bulk load BLOBs (videos, images, audio, office docs/pdf) into the database using PL/SQL?
    Every example I've ever seen in PL/SQL for loading BLOBs does a commit; after each file loaded ... which doesn't seem very scalable.
    Can we pass in an array of BLOBs from the application, into PL/SQL and loop through that array and then issue a commit after the loop terminates?
    Any advice or help is appreciated. Thanks
    LJ

    It is easy enough to modify the example to commit every N files. If you are loading large amounts of media, I think that you will find that the time to load the media is far greater than the time spent in SQL statements doing inserts or retrieves. Thus, I would not expect to see any significant benefit to changing the example to use PL/SQL collection types in order to do bulk row operations.
    If your goal is high performance bulk load of binary content then I would suggest that you look to use Sqlldr. A PL/SQL program loading from BFILEs is limited to loading files that are accessible from the database server file system. Sqlldr can do this but it can also load data from a remote client. Sqlldr has parameters to control batching of operations.
    See section 7.3 of the Oracle Multimedia DICOM Developer's Guide for the example Loading DICOM Content Using the SQL*Loader Utility. You will need to adapt this example to the other Multimedia objects (ORDImage, ORDAudio .. etc) but the basic concepts are the same.
    Once the binary content is loaded into the database, you will need a to write a program to loop over the new content and initialize the Multimedia objects (extract attributes). The example in 7.3 contains a sample program that does this for the ORDDicom object.

  • Accidentally overwritten a sql database - Recover possible?

    Hi there, 
    My wife uses a piece of software called salon Iris.
    It uses an SQL database to store client info etc.
    She accidentally overwrite her original database with a 'practice template' of clients.
    This has overwritten her original.
    I have no back up.
    Can anyone help?
    Thanks

    Hi there, 
    My wife uses a piece of software called salon Iris.
    It uses an SQL database to store client info etc.
    She accidentally overwrite her original database with a 'practice template' of clients.
    This has overwritten her original.
    I have no back up.
    Can anyone help?
    Thanks
    If it means restoring the database with the 'Practice Template' then hardly there is a way except some previous MDF or LDF files placed somewhere.
    Restores operation overwrites everything including schema, data etc. so hard to rollback.
    However, if it just a matter of overwriting a few tables (check how the overwriting was done. Was it through the User Interface or the application or through the SSMS or script etc.
    I am not sure about Salon Iris app but many application who allows a template to be imported to overwrite the database operates on few master tables to change the status (accessibility) of the records. But it all depends and varies for application based
    on their Technical design. As Erland has suggested you may contact the vendor for to understand this more clearly.
    Keep Learning!! Regards Vishal Singh Please take a moment to mark this reply as answered if it solved your issue however if it doesn't but looks helpful to you or for someone else you may vote as helpful. This will enable the reply for other forum members
    to benefit from. My Blogs: http://vishalhsingh.blogspot.com

  • SAPscript SQL within form possible?

    Hi All
    Is it possible for me to do a SELECT statement within the SAPscript form in SE71? I don't want to change the print program just to add one long text from T003T.
    Thanks,
    Adrian

    Hi,
    It is not possible to perform a select query within the SAP SCRIPT.
    I think you can go for an external subroutine. Check the below link for more details.
    http://wiki.sdn.sap.com/wiki/display/profile/ExternalSubroutinesinSAPScript
    Regards,
    Vijaymadhur.

  • Assign Application item from PL/SQL package-not possible? Right?

    I have to be sure about tittle statement...
    If is possible please some lead where to look for that.
    THX!

    If I have in "Aplication items" item, in plsql is there any way to change it's value.
    FSP_SET_PREFERENCE is making some things for named user (AFAIK)...and I want to change some vars on session based ... but not in WEB but in PLSQL enviroment .
    Hope now is clear...
    THX for replies
    Message was edited by:
    Funky

Maybe you are looking for

  • Unable to restore database using RMAN in oracle 10g

    Hi Everyone!!!!!!! I have following scenario. In which I don't want to drop newly created tablespace (test). So, let me know how to restore database from existing backup without dropping new tablespace and taking new backup? 1. I took database backup

  • Pop 3 mail on iPad

    I'm having trouble setting up my POP3 e-mail account on my iPad 3...I know all the settings I've entered are correct (verified with provider) but I receive the message the "secureserver.net" is not responding.  I enabled SSL and have shut down, reboo

  • Third party apps can't connect to iTunes afteer last update

    The iLike and the win 7 music gadget cannot connect to iTunes since the last update. Has anyone else seen this? I installed the most recent iLike and it didn't help. I understand it might just be an issue where I have to wait for the apps to be updat

  • What's the latest version of itunes that works with powermac?

    Trying to update Ipod Touch software but can't find latest version of itunes software that runs on a powermac (not Intel mac).

  • IWork 9 now - Do I need to keep iWork 8 installed

    Hi all, I primarily use Pages and Numbers, now iWork 09. Because I have installed and am comfortably working in iWork 09 is there any reason to keep iWork 08 installed? If I remove it do I simply drag it to the trash. That would be a welcome answer.