Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4340266
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:19:34+00:00 2026-05-21T11:19:34+00:00

i have to transform some query i´m using in SQL to Oracle code. I´m

  • 0

i have to transform some query i´m using in SQL to Oracle code. I´m having a lot of trouble with tis. Does anyone know any Query transformer o something like that?. Can someone translate some part of this code for me?.

This is the code:

SELECT PRUEBA = CASE (SELECT TIMEATT FROM READER WHERE PANELID = DEVID AND READERID = 
MACHINE) WHEN '1' THEN 'P10' ELSE 'P20' END 

+ '0001' 
+ CAST(YEAR(EVENT_TIME_UTC)AS VARCHAR)
+ Right('0' + Convert(VarChar(2), Month(EVENT_TIME_UTC)), 2)
+ Right('0' + Convert(VarChar(2), DAY(EVENT_TIME_UTC)), 2)
+ Right('0' + Convert(VarChar(2), DATEPART(HOUR,EVENT_TIME_UTC)), 2)
+ Right('0' + Convert(VarChar(2), DATEPART(MINUTE,EVENT_TIME_UTC)), 2)
+ Right('0' + Convert(VarChar(2), DATEPART(SECOND,EVENT_TIME_UTC)), 2) 
+ CAST(YEAR(EVENT_TIME_UTC)AS VARCHAR)
+ Right('0' + Convert(VarChar(2), Month(EVENT_TIME_UTC)), 2)
+ Right('0' + Convert(VarChar(2), DAY(EVENT_TIME_UTC)), 2)
+ Right('0' + Convert(VarChar(2), DATEPART(HOUR,EVENT_TIME_UTC)), 2)
+ Right('0' + Convert(VarChar(2), DATEPART(MINUTE,EVENT_TIME_UTC)), 2)
+ Right('0' + Convert(VarChar(2), DATEPART(SECOND,EVENT_TIME_UTC)), 2)
+ Right('00000000' + Convert(VarChar(8), CARDNUM), 8) 
+ Right('00000000' + Convert(VarChar(8), (SELECT SSNO FROM EMP WHERE ID = EMPID)), 8),

FROM events 

  WHERE eventid = 0 AND eventid = 0

  and machine in (11) AND DEVID IN (1,2)
  and CARDNUM <> 0 AND EMPID <> 0
  and EVENT_TIME_UTC between '2006-02-16' AND '2007-02-09'

Many thanks for your help, i´ll keep looking.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:19:35+00:00Added an answer on May 21, 2026 at 11:19 am

    Try this:

    SELECT CASE (SELECT timeatt FROM reader WHERE panelid = devid AND readerid = 
           machine) 
             WHEN '1' THEN 'P10' 
             ELSE 'P20' 
           END 
           || '0001' 
           || To_char(event_time_utc, 'RRRRMMDDHH24MISS') 
           || To_char(event_time_utc, 'RRRRMMDDHH24MISS') 
           || Lpad(cardnum, 8, '0') 
           || Lpad((SELECT ssno 
                             FROM   emp 
                             WHERE  id = empid), 8, '0') AS prueba 
    FROM   events 
    WHERE  eventid = 0 
           AND eventid = 0 
           AND machine IN ( 11 ) 
           AND devid IN ( 1, 2 ) 
           AND cardnum <> 0 
           AND empid <> 0 
           AND event_time_utc BETWEEN TO_DATE('2006-02-16', 'RRRR-MM-DD') AND TO_DATE('2007-02-09', 'RRRR-MM-DD') 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to take over and improve/finish some code that transforms Java objects from
i have a sql query that can bring back a large number of rows
I'm using Entity Framework 4.1 Code First. In my entity, I have three date/time
I have to transform a few hundred images every day in a specific way.
Have created a c++ implementation of the Hough transform for detecting lines in images.
I have IQueryable list of objects of type T which I want to transform
I have this Javascript data: [{id:123,type:test},{id:154,type:another}] How would you transform that into something so
In my Python app, I have an XML document that I'd like to transform
I'm faced with needing access for reporting to some data that lives in Oracle
I have some data, like this: BUG DATE STATUS ---- ---------------------- -------- 9012 18/03/2008

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.