forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use text/ntext/image column types for varchar(max)/nvarchar(max)/varb…
…inary(max) results Signed-off-by: Alex Kasko <[email protected]>
- Loading branch information
1 parent
fe7419a
commit d444237
Showing
9 changed files
with
177 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
CREATE TABLE BINARY_dt(a BINARY(8), b VARBINARY(10)); | ||
#inserting random values | ||
INSERT INTO BINARY_dt(a, b) values (1234, 12345); | ||
~~ROW COUNT: 1~~ | ||
|
||
INSERT INTO BINARY_dt(a, b) values (NULL, NULL); | ||
~~ROW COUNT: 1~~ | ||
|
||
#INSERT INTO BINARY_dt(a, b) values (0x31323334, 0x3132333435); | ||
SELECT * FROM BINARY_dt | ||
~~START~~ | ||
binary#!#varbinary | ||
00000000000004D2#!#00003039 | ||
<NULL>#!#<NULL> | ||
~~END~~ | ||
|
||
#prepst#!# INSERT INTO BINARY_dt(a, b) values(@a, @b) #!#binary|-|a|-|1234#!#varbinary|-|b|-|12345 | ||
DROP TABLE BINARY_dt | ||
|
||
|
||
CREATE TABLE BINARY_dt(a VARBINARY(max)); | ||
INSERT INTO BINARY_dt(a) values (NULL); | ||
~~ROW COUNT: 1~~ | ||
|
||
SELECT * FROM BINARY_dt; | ||
~~START~~ | ||
image | ||
<NULL> | ||
~~END~~ | ||
|
||
DROP TABLE BINARY_dt; | ||
|
||
create table BINARY_dt (a VARBINARY(max), b int, c int, d int, e int ,f int, g int, h int, i int); | ||
insert into BINARY_dt (a,b,c,d,e,f,g,h,i) values (NULL,1,2,3,4,5,6,7,8); | ||
~~ROW COUNT: 1~~ | ||
|
||
select * from BINARY_dt; | ||
~~START~~ | ||
image#!#int#!#int#!#int#!#int#!#int#!#int#!#int#!#int | ||
<NULL>#!#1#!#2#!#3#!#4#!#5#!#6#!#7#!#8 | ||
~~END~~ | ||
|
||
drop table BINARY_dt; | ||
|
||
CREATE TABLE BINARY_dt(a BINARY(8), b VARBINARY(10)); | ||
INSERT INTO BINARY_dt(a, b) values (1234, 12345); | ||
~~ROW COUNT: 1~~ | ||
|
||
prepst#!# INSERT INTO BINARY_dt(a, b) values(?, ?) #!#binary|-|a|-|1234#!#varbinary|-|b|-|12345 | ||
~~ROW COUNT: 1~~ | ||
|
||
prepst#!#exec#!#binary|-|a|-|12345678#!#varbinary|-|b|-|12345 | ||
~~ROW COUNT: 1~~ | ||
|
||
prepst#!#exec#!#binary|-|a|-|1234#!#varbinary|-|b|-|123456789 | ||
~~ROW COUNT: 1~~ | ||
|
||
SELECT * FROM BINARY_dt; | ||
~~START~~ | ||
binary#!#varbinary | ||
00000000000004D2#!#00003039 | ||
3132333400000000#!#3132333435 | ||
3132333435363738#!#3132333435 | ||
3132333400000000#!#313233343536373839 | ||
~~END~~ | ||
|
||
DROP TABLE BINARY_dt; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ INSERT [dbo].[NOTIFICATION_DEFINITION] VALUES (13, N'INTRA_MSG', N'Intra-System | |
|
||
SELECT ID,NAME_TX,LOCK_ID,DESCRIPTION_TX,N'' as emptystring, SCHEDULE_XML,DEFAULT_SENDER_TX,SETTINGS_XML,AGENCY_ID FROM NOTIFICATION_DEFINITION | ||
~~START~~ | ||
bigint#!#nvarchar#!#tinyint#!#nvarchar#!#nvarchar#!#ntext#!#nvarchar#!#ntext#!#bigint | ||
bigint#!#nvarchar#!#tinyint#!#ntext#!#nvarchar#!#ntext#!#nvarchar#!#ntext#!#bigint | ||
13#!#INTRA_MSG#!#63#!#Intra-System Message#!##!#<NULL>#!#[email protected]#!#<Settings><SubjectTemplateTypeCd>NTF_SUB_INTRA_MSG</SubjectTemplateTypeCd><MessageTemplateTypeCd>NTF_MSG_INTRA_MSG<MessageTemplateTypeCd><VariableRefDomainName>PolicyDocumentTemplateVars<VariableRefDomainName><ProcessDefinitionId>11</ProcessDefinitionId></Settings>#!#1 | ||
~~END~~ | ||
|
||
|
@@ -47,7 +47,7 @@ prepst#!# INSERT [dbo].[NOTIFICATION_DEFINITION] VALUES(?, ?, ?, ?, ?, ?, ?, ?) | |
#INSERT [dbo].[NOTIFICATION_DEFINITION] VALUES (13, N'INTRA_MSG', N'Intra-System Message', NULL, N'[email protected]', 63,N'<Settings><SubjectTemplateTypeCd>NTF_SUB_INTRA_MSG</SubjectTemplateTypeCd><MessageTemplateTypeCd>NTF_MSG_INTRA_MSG<MessageTemplateTypeCd><VariableRefDomainName>PolicyDocumentTemplateVars<VariableRefDomainName><ProcessDefinitionId>11</ProcessDefinitionId></Settings>', 1) | ||
SELECT ID,NAME_TX,LOCK_ID,DESCRIPTION_TX,N'' as emptystring, SCHEDULE_XML,DEFAULT_SENDER_TX,SETTINGS_XML,AGENCY_ID FROM NOTIFICATION_DEFINITION | ||
~~START~~ | ||
bigint#!#nvarchar#!#tinyint#!#nvarchar#!#nvarchar#!#ntext#!#nvarchar#!#ntext#!#bigint | ||
bigint#!#nvarchar#!#tinyint#!#ntext#!#nvarchar#!#ntext#!#nvarchar#!#ntext#!#bigint | ||
13#!#INTRA_MSG#!#63#!#Intra-System Message#!##!#NULL#!#donotreply_OPMQA#!#<Settings><SubjectTemplateTypeCd>NTF_SUB_INTRA_MSG</SubjectTemplateTypeCd><MessageTemplateTypeCd>NTF_MSG_INTRA_MSG</MessageTemplateTypeCd><VariableRefDomainName>PolicyDocumentTemplateVars</VariableRefDomainName><ProcessDefinitionId>11</ProcessDefinitionId></Settings>#!#1 | ||
~~END~~ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.