René's URL Explorer Experiment


Title: timestamp in cursor comparison > expect() has problem with precision / nls · Issue #771 · utPLSQL/utPLSQL · GitHub

Open Graph Title: timestamp in cursor comparison > expect() has problem with precision / nls · Issue #771 · utPLSQL/utPLSQL

X Title: timestamp in cursor comparison > expect() has problem with precision / nls · Issue #771 · utPLSQL/utPLSQL

Description: In our project we use a lot of timestamp(6) columns. Our calls to ut.expect() run into problems with comparisons between sys_refcursors that contain timestamp(6) columns. I prepared three little attachments that should help demonstrate t...

Open Graph Description: In our project we use a lot of timestamp(6) columns. Our calls to ut.expect() run into problems with comparisons between sys_refcursors that contain timestamp(6) columns. I prepared three little at...

X Description: In our project we use a lot of timestamp(6) columns. Our calls to ut.expect() run into problems with comparisons between sys_refcursors that contain timestamp(6) columns. I prepared three little at...

Opengraph URL: https://github.com/utPLSQL/utPLSQL/issues/771

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"timestamp in cursor comparison > expect() has problem with precision / nls","articleBody":"In our project we use a lot of ```timestamp(6)``` columns. Our calls to ```ut.expect()``` run into problems with comparisons between sys_refcursors that contain ```timestamp(6)``` columns. \r\n\r\nI prepared three little attachments that should help demonstrate the problem and show our current solution. But this solution is not perfect, as it only fixes the problem for our ```timestamp(6)``` columns and we would like to see a more general solution.\r\n\r\nIf you can help in any way, that would be great.\r\n\r\n**Attachments**\r\n\r\n1. ```setup.sql``` - creates one table and two packages designed to demonstrate the problem.\r\n2. ```problem_demo.sql``` - shows our NLS_SESSION_PARAMETERS, starts the ut-test and quotes the fail message we get from this unit test run ... if we do not patch the current UT3 installation\r\n3. ```our_solution_so_far.txt``` - describes how we got around the problem with a very small patch, but we lack the utplsql knowlege to find a general fix, so we ask you for help.\r\n______________________________________________________________________\r\n\r\n```setup.sql``` - creates one table and two packages designed to demonstrate the problem\r\n\r\n```\r\n/*\r\n    name\r\n        setup.sql\r\n    version\r\n        1.0, 2018-10-31\r\n    author\r\n        MalachiasTS\r\n\r\n    purpose\r\n        Build a table and two packages in the current schema \r\n        which are needed to demonstrate a problem with the \r\n        comparison timestamp columns in sys_refcursors.\r\n\r\n    creates\r\n        tables\r\n            TMP_NLS_TEST\r\n        packages\r\n            P_NLS_TEST\r\n            P_NLS_TEST_UT\r\n*/\r\n\r\n--drop table tmp_nls_test;\r\n\r\ncreate table tmp_nls_test (\r\n    id number,\r\n\tats3 timestamp (3),\r\n\tats6 timestamp (6),\r\n\tats9 timestamp (9)\r\n);\r\n\r\ninsert into tmp_nls_test (id, ats3, ats6, ats9) \r\nvalues (1, systimestamp, systimestamp, systimestamp);\r\ncommit;\r\n\r\n--drop package p_nls_test;\r\n\r\ncreate or replace package p_nls_test\r\nis\r\n    procedure insert_into_nls_test (\r\n        i_id         tmp_nls_test.id%type,\r\n        i_timestamp3 tmp_nls_test.ats3%type,\r\n        i_timestamp6 tmp_nls_test.ats6%type,\r\n        i_timestamp9 tmp_nls_test.ats9%type\r\n    );\r\nend p_nls_test;\r\n/\r\n\r\ncreate or replace package body p_nls_test\r\nas\r\n    procedure insert_into_nls_test (\r\n        i_id         tmp_nls_test.id%type,\r\n        i_timestamp3 tmp_nls_test.ats3%type,\r\n        i_timestamp6 tmp_nls_test.ats6%type,\r\n        i_timestamp9 tmp_nls_test.ats9%type\r\n    )\r\n    is\r\n    begin\r\n        insert into tmp_nls_test (id, ats3, ats6, ats9) \r\n            values (i_id, i_timestamp3, i_timestamp6, i_timestamp9);\r\n\r\n        --commit;\r\n    end insert_into_nls_test;\r\nend p_nls_test;\r\n/\r\n\r\n--drop package p_nls_test_ut;\r\n\r\ncreate or replace package p_nls_test_ut\r\nis\r\n    -- %suite(nls_test)\r\n    -- %suitepath(nls_test)\r\n\r\n    -- %test(check that inserts into tmp_nls_test work correctly)\r\n    procedure ut_insert_into_nls_test;\r\nend p_nls_test_ut;\r\n/\r\n\r\ncreate or replace package body p_nls_test_ut\r\nis\r\n    procedure ut_insert_into_nls_test\r\n    is\r\n        lv_new_id number;\r\n        lv_ts timestamp(9);\r\n\r\n        lc_exp sys_refcursor;\r\n        lc_act sys_refcursor;\r\n    begin\r\n        -- get new id\r\n        select max(id)+1\r\n        into lv_new_id\r\n        from tmp_nls_test;\r\n\r\n        -- get a valid timestamp with timezone\r\n        select systimestamp\r\n        into lv_ts\r\n        from dual;\r\n\r\n        -- insert a record with these values\r\n        p_nls_test.insert_into_nls_test (lv_new_id, null, lv_ts, null);\r\n\r\n\r\n        -- build two cursors\r\n        ut.set_nls();\r\n\r\n        -- fill cursor with expected values by selecting from dual\r\n        open lc_exp for\r\n            select\r\n                lv_new_id           as id, \r\n                to_timestamp (null) as ats3, \r\n                lv_ts               as ats6,  \r\n                to_timestamp (null) as ats9\r\n            from dual;\r\n\r\n        -- fill cursor with actual table values.\r\n        open lc_act for\r\n            select id, ats3, ats6, ats9\r\n            from tmp_nls_test\r\n            where id = 2;\r\n            \r\n        ut.reset_nls();\r\n\r\n        -- compare variable with table values\r\n        ut.expect (lc_act).to_equal (lc_exp);\r\n        \r\n    end ut_insert_into_nls_test;\r\nend p_nls_test_ut;\r\n/\r\n```\r\n________________________________________________\r\n```problem_demo.sql``` - shows our NLS_SESSION_PARAMETERS, starts the ut-test and quotes the fail message we get from this unit test run ... if we do not patch the current UT3 installation.\r\n\r\n```\r\n/*\r\nselect * from NLS_SESSION_PARAMETERS;\r\n\r\nPARAMETER               VALUE\r\n----------------------------------------------------------\r\nNLS_LANGUAGE            AMERICAN\r\nNLS_TERRITORY           AMERICA\r\nNLS_CURRENCY            $\r\nNLS_ISO_CURRENCY        AMERICA\r\nNLS_NUMERIC_CHARACTERS  .,\r\nNLS_CALENDAR            GREGORIAN\r\nNLS_DATE_FORMAT         yyyy-mm-dd hh24:mi:ss\r\nNLS_DATE_LANGUAGE       AMERICAN\r\nNLS_SORT                BINARY\r\nNLS_TIME_FORMAT         HH.MI.SSXFF AM\r\nNLS_TIMESTAMP_FORMAT    yyyy-mm-dd hh24:mi:ssxff\r\nNLS_TIME_TZ_FORMAT      HH.MI.SSXFF AM TZR\r\nNLS_TIMESTAMP_TZ_FORMAT yyyy-mm-dd hh24:mi:ssxff tzh:tzm\r\nNLS_DUAL_CURRENCY       $\r\nNLS_COMP                BINARY\r\nNLS_LENGTH_SEMANTICS\tBYTE\r\nNLS_NCHAR_CONV_EXCP     FALSE\r\n*/\r\n\r\nbegin\r\n    ut.run ('p_nls_test_ut');\r\nend;\r\n/\r\n\r\n/*\r\nDBMS OUTPUT:\r\n\r\nnls_test\r\n  nls_test\r\n    check that inserts into tmp_nls_test work correctly [.149 sec] (FAILED - 1)\r\n \r\nFailures:\r\n \r\n  1) ut_insert_into_nls_test\r\n      Actual: refcursor [ count = 1 ] was expected to equal: refcursor [ count = 1 ]\r\n      Diff:\r\n      Rows: [ 1 differences ]\r\n        Row No. 1 - Actual:   \u003cATS6>2018-10-31T17:11:51.150893\u003c/ATS6>\r\n        Row No. 1 - Expected: \u003cATS6>2018-10-31T17:11:51.150893000\u003c/ATS6>\r\n      at \"\u003cschema>.P_NLS_TEST_UT.UT_INSERT_INTO_NLS_TEST\", line 46 ut.expect (lc_act).to_equal (lc_exp);\r\n      \r\n       \r\nFinished in .15082 seconds\r\n1 tests, 1 failed, 0 errored, 0 disabled, 0 warning(s)\r\n */\r\n```\r\n_________________________________________________________\r\n```our_solution_so_far.txt``` - describes how we got around the problem with a very small patch, but we lack the utplsql knowlege to find a general fix, so we ask you for help.\r\n\r\nWhat fixed it for us was ...\r\n\r\nWe patched two rows in the header of package ```UT_UTILS```:\r\n\r\nline 120:\r\n```\r\n    gc_timestamp_format         constant varchar2(100) := 'yyyy-mm-dd\"T\"hh24:mi:ssxff';\r\n->: gc_timestamp_format         constant varchar2(100) := 'yyyy-mm-dd\"T\"hh24:mi:ssxff6';    -- patched\r\n```\r\n\r\nline 121:\r\n```\r\n    gc_timestamp_tz_format      constant varchar2(100) := 'yyyy-mm-dd\"T\"hh24:mi:ssxff tzh:tzm';\r\n->: gc_timestamp_tz_format      constant varchar2(100) := 'yyyy-mm-dd\"T\"hh24:mi:ssxff6 tzh:tzm';  -- patched\r\n```\r\n\r\nThis patch only fixes it for ```timestamp(6)```.\r\nLucky for us, if we use timestamp types at all, then we always use ```TIMESTAMP(6)``` ... presently.\r\n\r\nWhat would be a general solution?","author":{"url":"https://github.com/MalchiasTS","@type":"Person","name":"MalchiasTS"},"datePublished":"2018-10-31T17:24:23Z","url":"https://github.com/utPLSQL/utPLSQL/issues/771"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:dc807eab-73f5-f2ba-122d-8826968c55a5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBCDA:378EF4:356619:4946B6:6B04BAD5
html-safe-nonce853b83d3fe702f3c4bff9d20cb0e2d34f02f4bd71d6ab85f47b355999e6fe9b5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0RBOjM3OEVGNDozNTY2MTk6NDk0NkI2OjZCMDRCQUQ1IiwidmlzaXRvcl9pZCI6IjI5MzkxMzczMzQ2Njg3MzcyMzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac26ee980b4d58da58decc21c133c03f5977798bb000bb6c9508a0912a2b8b29de
hovercard-subject-tagissue:376076156
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/utPLSQL/utPLSQL/771/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b87ec437bfdf23fbe901a54615a66a61e6b4bb4106122fd0d000734c8ac7322d/utPLSQL/utPLSQL/issues/771
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b87ec437bfdf23fbe901a54615a66a61e6b4bb4106122fd0d000734c8ac7322d/utPLSQL/utPLSQL/issues/771
og:image:altIn our project we use a lot of timestamp(6) columns. Our calls to ut.expect() run into problems with comparisons between sys_refcursors that contain timestamp(6) columns. I prepared three little at...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMalchiasTS
hostnamegithub.com
expected-hostnamegithub.com
None85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4
turbo-cache-controlno-preview
go-importgithub.com/utPLSQL/utPLSQL git https://github.com/utPLSQL/utPLSQL.git
octolytics-dimension-user_id15661281
octolytics-dimension-user_loginutPLSQL
octolytics-dimension-repository_id50728220
octolytics-dimension-repository_nwoutPLSQL/utPLSQL
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id50728220
octolytics-dimension-repository_network_root_nwoutPLSQL/utPLSQL
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/utPLSQL/utPLSQL/issues/771#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FutPLSQL%2FutPLSQL%2Fissues%2F771
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FutPLSQL%2FutPLSQL%2Fissues%2F771
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=utPLSQL%2FutPLSQL
Reloadhttps://github.com/utPLSQL/utPLSQL/issues/771
Reloadhttps://github.com/utPLSQL/utPLSQL/issues/771
Reloadhttps://github.com/utPLSQL/utPLSQL/issues/771
utPLSQLhttps://github.com/utPLSQL
utPLSQLhttps://github.com/utPLSQL/utPLSQL
Codehttps://github.com/utPLSQL/utPLSQL
Issues13 (13)https://github.com/utPLSQL/utPLSQL/issues
Pull requests1 (1)https://github.com/utPLSQL/utPLSQL/pulls
Discussionshttps://github.com/utPLSQL/utPLSQL/discussions
Actionshttps://github.com/utPLSQL/utPLSQL/actions
Projectshttps://github.com/utPLSQL/utPLSQL/projects
Security and qualityhttps://github.com/utPLSQL/utPLSQL/security
Insightshttps://github.com/utPLSQL/utPLSQL/insights
https://github.com/utPLSQL/utPLSQL
New issuehttps://github.com/login?return_to=https://github.com/utPLSQL/utPLSQL/issues/771
New issuehttps://github.com/login?return_to=https://github.com/utPLSQL/utPLSQL/issues/771
timestamp in cursor comparison > expect() has problem with precision / nlshttps://github.com/utPLSQL/utPLSQL/issues/771#top
discussionhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22discussion%22
documentationhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22documentation%22
enhancementhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/MalchiasTS
MalchiasTShttps://github.com/MalchiasTS
on Oct 31, 2018https://github.com/utPLSQL/utPLSQL/issues/771#issue-376076156
https://github.com/jgebal
jgebalhttps://github.com/jgebal
on Oct 31, 2018https://github.com/utPLSQL/utPLSQL/issues/771#issuecomment-434829540
@MalchiasTShttps://github.com/MalchiasTS
https://github.com/jgebal
jgebalhttps://github.com/jgebal
on Oct 31, 2018https://github.com/utPLSQL/utPLSQL/issues/771#issuecomment-434829773
jgebalhttps://github.com/jgebal
enhancementhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22enhancement%22
discussionhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22discussion%22
documentationhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22documentation%22
on Oct 31, 2018https://github.com/utPLSQL/utPLSQL/issues/771#event-1938957417
https://github.com/MalchiasTS
MalchiasTShttps://github.com/MalchiasTS
on Nov 1, 2018https://github.com/utPLSQL/utPLSQL/issues/771#issuecomment-434966485
MalchiasTShttps://github.com/MalchiasTS
completedhttps://github.com/utPLSQL/utPLSQL/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 1, 2018https://github.com/utPLSQL/utPLSQL/issues/771#event-1939918949
https://github.com/emanueol
emanueolhttps://github.com/emanueol
on Nov 1, 2018https://github.com/utPLSQL/utPLSQL/issues/771#issuecomment-434998949
https://github.com/MalchiasTS
MalchiasTShttps://github.com/MalchiasTS
on Nov 1, 2018https://github.com/utPLSQL/utPLSQL/issues/771#issuecomment-435005099
@emanueolhttps://github.com/emanueol
https://github.com/jgebal
jgebalhttps://github.com/jgebal
on Nov 17, 2018https://github.com/utPLSQL/utPLSQL/issues/771#issuecomment-439641179
@MalchiasTShttps://github.com/MalchiasTS
@Shoelacehttps://github.com/Shoelace
@emanueolhttps://github.com/emanueol
jgebalhttps://github.com/jgebal
on Nov 17, 2018https://github.com/utPLSQL/utPLSQL/issues/771#event-1972914880
https://github.com/jgebal
jgebalhttps://github.com/jgebal
on Nov 18, 2018https://github.com/utPLSQL/utPLSQL/issues/771#issuecomment-439661847
jgebalhttps://github.com/jgebal
on Nov 18, 2018https://github.com/utPLSQL/utPLSQL/issues/771#event-1973458208
Added description fo timestamp bind-variable comparison in cursor.https://github.com/utPLSQL/utPLSQL/commit/cad7bad100688ff7c8fb8271313c0bf53ed4bf50
https://docs.github.com/articles/closing-issues-via-commit-messages
cad7badhttps://github.com/utPLSQL/utPLSQL/commit/cad7bad100688ff7c8fb8271313c0bf53ed4bf50
jgebalhttps://github.com/jgebal
completedhttps://github.com/utPLSQL/utPLSQL/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#791https://github.com/utPLSQL/utPLSQL/pull/791
on Nov 19, 2018https://github.com/utPLSQL/utPLSQL/issues/771#event-1974420650
Sign up for freehttps://github.com/signup?return_to=https://github.com/utPLSQL/utPLSQL/issues/771
Sign in to commenthttps://github.com/login?return_to=https://github.com/utPLSQL/utPLSQL/issues/771
discussionhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22discussion%22
documentationhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22documentation%22
enhancementhttps://github.com/utPLSQL/utPLSQL/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.