How can I use a date/time from a cursor and insert it into a table later?

I have a cursor which retrieves data from a table which includes a date column, which has date and time.
I want to insert this value into a table which has another date column but when I do, it is dropping off the time data and putting in 00:00:00.
I am using execute immediate and trapped the SQL I am executing:
insert into ifsapp.GSCDB_TRANS_DTL_TAB values (
'GSCDB_COMPANY',to_date('01-DEC-06',3,0 )
and so you can see the date has no time.
The plsql is:
v_sql := 'insert into ifsapp.GSCDB_TRANS_DTL_TAB values ( '''||r_gscdbio.name||''','''||r_gscdbio.last_exec_time||''','||v_count||',0 )';
Any help appreciated, I feel I need to use to_date and/or to_char but my head is spinning!
Thank you

Why are you using EXECUTE IMMEDIATE for this? And why are you not using bind variables? It'll be much easier (and more efficeint, easier to debug, etc) to just have static SQL
INSERT INTO table_name
  VALUES( r_gscdbio.name, r_gscdbio.last_exec_time, v_count, 0 );Additionally, you'll want to explicitly specify the column list for your INSERT statement. Otherwise, if you add another column to the table, your code will break.
Justin

Similar Messages

  • How can I read an ID-value from the LMS and insert this into an URL?

    Hi
    Right now I am struggling with a little problem. Hopefully anyone here knows the answer. For the latest course I am building (Captivate 6), it is necessary that at one point the course reads an ID-value from the LMS. After that, this ID should be inserted into an URL.
    To be more precisely: the ID must be read (getValue) from cmi.archive_id and inserted into an URL like that: http://.../archive.php?action=pdf&objectID=ARCHIVE_ID.
    Unfortunately I am more of a designer und less of a javascript-maestro (well...I am a javascript-noob to be precisely), therefore I am pretty clueless how to do that. I tried a simple executed action (run Javascript: cpEIGetValue('cmi.archive_id'); and after that open URL http://.../archive.php?action=pdf&objectID=ARCHIVE_ID), but...well...that didn't work.
    Any ideas?
    Thanks a lot in advance

    Think you'll find help looking at Jim Leichliter's website:
    http://captivatedev.com/
    He has great tutorials about JavaScript and also a widget that allows to enter a variable in URL's
    Lilybiri

  • How can I input read a line from a file and output it into the screen?

    How can I input read a line from a file and output it into the screen?
    If I have a file contains html code and I only want the URL, for example, www24.brinkster.com how can I read that into the buffer and write the output into the screen that using Java?
    Any help will be appreciate!
    ======START FILE default.html ========
    <html>
    <body>
    <br><br>
    <center>
    <font size=4 face=arial color=#336699>
    <b>Welcome to a DerekTran's Website!</b><br>
    Underconstructions.... <br>
    </font> </center>
    <font size=3 face=arial color=black> <br>
    Hello,<br>
    <br>
    I've been using the PWS to run the website on NT workstation 4.0. It was working
    fine. <br>
    The URL should be as below: <br>
    http://127.0.0.1/index.htm or http://localhost/index.htm
    <p>And suddently, it stops working, it can't find the connection. I tried to figure
    out what's going on, but still <font color="#FF0000">NO CLUES</font>. Does anyone
    know what's going on? Please see the link for more.... I believe that I setup
    everything correctly and the bugs still flying in the server.... <br>
    Thank you for your help.</P>
    </font>
    <p><font size=3 face=arial color=black>PeerWebServer.doc
    <br>
    <p><font size=3 face=arial color=black>CannotFindServer.doc
    <br>
    <p><font size=3 face=arial color=black>HOSTS file is not found
    <br>
    <p><font size=3 face=arial color=black>LMHOSTS file
    <br>
    <p><font size=3 face=arial color=black>How to Setup PWS on NT
    <BR>
    <p><font size=3 face=arial color=black>Issdmin doc</BR>
    Please be patient while the document is download....</font>
    <font size=3 face=arial color=black><br>If you have any ideas please drop me a
    few words at [email protected] </font><br>
    <br>
    <br>
    </p>
    <p><!--#include file="Hits.asp"--> </p>
    </body>
    </html>
    ========= END OF FILE ===============

    Hi!
    This is a possible solution to your problem.
    import java.io.*;
    class AddressExtractor {
         public static void main(String args[]) throws IOException{
              //retrieve the commandline parameters
              String fileName = "default.html";
              if (args.length != 0)      fileName =args[0];
               else {
                   System.out.println("Usage : java AddressExtractor <htmlfile>");
                   System.exit(0);
              BufferedReader in = new BufferedReader(new FileReader(new File(fileName)));
              StreamTokenizer st = new StreamTokenizer(in);
              st.lowerCaseMode(true);
              st.wordChars('/','/'); //include '/' chars as part of token
              st.wordChars(':',':'); //include ':' chars as part of token
              st.quoteChar('\"'); //set the " quote char
              int i;
              while (st.ttype != StreamTokenizer.TT_EOF) {
                   i = st.nextToken();
                   if (st.ttype == StreamTokenizer.TT_WORD) {          
                        if (st.sval.equals("href")) {               
                             i = st.nextToken(); //the next token (assumed) is the  '=' sign
                             i = st.nextToken(); //then after it is the href value.               
                             getURL(st.sval); //retrieve address
              in.close();
         static void getURL(String s) {     
              //Check string if it has http:// and truncate if it does
              if (s.indexOf("http://") >  -1) {
                   s = s.substring(s.indexOf("http://") + 7, s.length());
              //check if not mailto: do not print otherwise
              if (s.indexOf("mailto:") != -1) return;
              //printout anything after http:// and the next '/'
              //if no '/' then print all
                   if (s.indexOf('/') > -1) {
                        System.out.println(s.substring(0, s.indexOf('/')));
                   } else System.out.println(s);
    }Hope this helps. I used static methods instead of encapsulating everyting into a class.

  • How can I eliminate the date & time from Sticky notes?

    If date & time cant be eliminated is there a way to have it continually updated to the current date & time every time the Sticky is clicked on?
    I am using Adobe Acrobat 9 Pro, version 9.0 running on Mac OSX version 10.5.6 with a HP 2840 printer

    Hello Theodora,
    You can do this via your iPod's Settings application.
    B-rock

  • HT1338 How can i use my data on windows or mac when i use one of them in the same time?

    Hi,
    i have a Mac book with 2 operating system, ( Windows& mac). How can i use my data on windows or mac when i use one of them in the same time?
    Thank you

    The following article(s) may help you.
    Resolving duplicate calendars
    Resolving duplicate contacts

  • How can I get the Date & Time to appear on my final project in iMovie11?

    I am using iMovie 11 and have imported video from a Canon Vixia-HF21 camera. The EXIF data is imported along with the video but when I produce the final product, the date and time do not appear.  How can I get the Date  & Time data to appear on the final product?

    There is a date and time Title you can use. If I recall correctly, it displays date plus hours and minutes, but not seconds.

  • HT204053 Dear Support Team, every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud???

    Dear Support Team,
    Every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud?
    Thanks

    It is not possible to create a new iCloud account using a Windows machine. You must create the account using a Mac (10.7.5 or more) or an IOS device (iPhone etc). Once that is done you can sign into and use the account on your Windows machine.

  • How can i use my iphone 4 from japan in india

    how can i use my iphone 4 from japan in india

    The only way to use an iPhone from Japan in India is to pay your Japanese carrier for international roaming. Japanese iPhones can not be unlocked.

  • How can i use the airport time capsule as a external hard drive?

    how can i use the airport time capsule as a external hard drive?

    Why do you recommend not place things like iTunes libraries or photo libraries on the drive? It was what I am looking for...
    I suggest that you ask the experts over in the iPhoto Support Community about their opinions on placing an iPhoto or Aperture library on the Time Capsule....even if you plan to use a wired connection for your Mac and the Time Capsule.
    But, if Terrence Devlin answers, be prepared for a lecture about why you should not ever do this.
    If you place the iTunes library on the Time Capsule, be prepared for iTunes to give you messages about not being able to find the library.
    In addtion, LaPastenague has the answer for you in a nutshell......corruption problems.
    Bottom line....the Time Capsule is for your backups.....not "everyday" files and especially not libraries.

  • How can I get the data back from my game

    How can I get the data back from minecraft if I deleted the app and bought with a different Apple ID

    No, they are tied to the ID that purchased them, and cannot be transferred to anyone else.

  • How can i set the date time year to my i pod

    how can i set the date time year to my i pod touch

    Hello Theodora,
    You can do this via your iPod's Settings application.
    B-rock

  • I do not have a credit card how can I use the App Store from Belize

    I do not have a credit card how can I use the App Store from Belize

    iTunes gift cards.

  • How can I use mp4 audio files from my iTunes library in an Elements 10 slide show?

    How can I use mp4 audio files from my iTunes library in an Elements 10 slide show?

    AAC is Advanced Audio Coding.  Basically it's a format that sounds better than MP3 but doesn't take up as much space as a lossless format (like you'd have on a CD).  More than likely you've had that encoding turned on when you ripped your music into itunes (it's the default encoder).  Therefore your LG phone won't play them.
    You need to turn off the AAC format by going to the iTunes menu, Preferences, General (at the top), then clicking the "Import Preferences" button.  Change the AAC Encoder to MP3 Encoder.  After that you'll have to make MP3 copies of your songs by right clicking them and selecting "Create MP3 Version."  You'll get a copy of the song that should transfer to your SD card and have MP3 encoding.  Hopefully your phone will play that.

  • How can I change the shipping time from 1-2 weeks to 2 days

    How can I change the shipping time from 1-2 weeks to 2 days. Thank you in advance.

    Right you are, R_Kelly. Thanks, that did the trick. Ukgaurav also pointed out some choices in the Displays and Cursors Preferences with which I fine-tuned the tool cursor appearance.

  • HT201328 My iPhone is from Japan and I want to activate it here in the Philippines because I'm living here. I have lost the original SIM from Softbank and replaced it with a new SIM card from Globe. How can I use the SIM card from Globe?

    My iPhone is from Japan and I want to activate it here in the Philippines because I'm living here. I have lost the original SIM from Softbank and replaced it with a new SIM card from Globe. How can I use the SIM card from Globe?

    You cannot. The iPhone is locked to Softbank, and only they can unlock it. Problem is that Softbank will NOT unlock the phone, as they do not offer iPhone unlocking.
    Buy an iPhone in the Phillipines.
    PS Before you go on a rant at Apple, be aware that Apple does NOT unlock phones and they do not set unlocking policies. The carriers (Softbank in this case) set the unlocking policy.

Maybe you are looking for

  • Month vs PY year measure in custom calendar

    Dear All I have go two RELATED tables in my Powerpivot data model: Table: PTV FLAT HITLIST       COUNTRY BRAND TV MODEL INCH SIZE SALES THS#EUR PERIOD HUNGARY PANASONIC TX-L32C20 32 100 2012 JUN HUNGARY SHARP LC-32SH7EBK 32 101 2012 JUN HUNGARY TRADE

  • Help on inporting from external drive

    when I drag my imovie files to idvd from the external drive, it does not take, I see my options as 1. make them into quicktime movies and then drag them 2. install idvd to my external drive. Any thoughts, thanks

  • International texts are not being received?

    Hello folks I have an iPhone 5. I can make and receive local and international calls. I can send and receive local text messages. I can receive international text messages but cannot send them. I have an International calling and texting plan. iMessa

  • [AS3] Cannot sync sharedObjects

    Hello, Ive tried converting the SharedObject tutorial [http://www.adobe.com/devnet/flashmediaserver/sample_apps.html] provided by Adobe from AS2 to AS3. When one client moves the ball, the other client should be able to see the ball moving on another

  • SAPEphi Fail during upg from NW7.01 to 7.02 in READ_BASE_PROFILE phase

    Hi, SAPEphi Fails with the message Error while executing PhaseTypeExecuteTask with input file ReadProfiles.xml and task READ_BASE_PROFILES. Could not determine profile parameters. Error while reading properties from /usr/sap/A57/SYS/profile/START_JC3